Returns the plural category for a given value.
- "=value" when the case exists,
- the plural category otherwise

@internal
335458
function getPluralCategory(value, cases, ngLocalization) {
	        var nbCase = "=" + value;
	        return cases.indexOf(nbCase) > -1 ? nbCase : ngLocalization.getPluralCategory(value);
	    }
541023
protected function resolveTypeDescription($value): string
    {
        $type = gettype($value);

        if ($type === 'object') {
            return 'an instance of ' . get_class($value);
        }

        if ($type === 'integer') {
            return 'an integer';
        }

        return 'a ' . $type;
    }
719075
public static function typeOfValue($value)
    {
        if (is_null($value)) {
            return self::TYPE_NULL;
        }
        if (is_int($value)) {
            return self::TYPE_INT;
        }
        if (is_bool($value)) {
            return self::TYPE_BOOL;
        }
        return self::TYPE_STR;
    }
1301083
public static function pluralize($count = 1, $singular, $plural = null)
    {
        if ($count == 1) {
            return $singular;
        }

        return is_null($plural) ? Inflector::pluralize($singular) : $plural;
    }
561353
def get_default(cls, category):
        """"""
        value = cls._DEFAULTS[category]
        if not value or not isinstance(value, list):
            return value
        return value[0]
1112415
def coerce(self, value):
        """"""
        if isinstance(value, dict):
            value = [value]
        if not isiterable_notstring(value):
            value = [value]
        return [coerce_single_instance(self.lookup_field, v) for v in value]
1168873
def pluralize(count, item_type):
  
  def pluralize_string(x):
    if x.endswith('s'):
      return x + 'es'
    else:
      return x + 's'

  text = '{} {}'.format(count, item_type if count == 1 else pluralize_string(item_type))
  return text
1085284
public static function pluralToSingular($pluralWordToCheck) {
        $listOfSingular = [
            'categories'    => 'category',
            'kb_item'       => 'knowledge base item',
            'list_email'    => 'email list',
            'listlist'      => 'list',
            'people'        => 'person',
            'peoples'       => 'person',
            'social'        => 'social site',
            'todo_item'     => 'to do item',
            'email_message' => 'email message',
        ];

        foreach ($listOfSingular as $plural => $singular) {

            if (strtolower($pluralWordToCheck) == strtolower($plural)) {
                return $singular;
            }
        }

        return $pluralWordToCheck;
    }
979849
public static function singular($value)
	{
		if (isset(static::$singularCache[$value]))
		{
			return static::$singularCache[$value];
		}

		$result = static::inflect($value, static::$singular, static::$irregular);

		return static::$singularCache[$value] = $result ?: $value;
	}
1018394
public static function determine($value): string
    {
        $type = \gettype($value);

        switch ($type) {
            case 'object':
                return \get_class($value);

            case 'integer':
                return 'int';

            case 'boolean':
                return 'bool';

            case 'NULL':
                return 'null';

            case 'double':
                return 'float';

            default:
                return $type;
        }
    }
1076590
public function getSortFromValue ($value) {
		// Make all lower-case
		$value = strtolower($value);

		// Default is descending
		$sort = 'FALSE';

		// Is value set to allow ascending sorting?
		if ($value == 'asc' || $value == 'true' || $value == 'ascending') {
			// Sort ascending
			$sort = 'TRUE';
		}

		// Return it
		return $sort;
	}
735109
function (value) {

            var options = $('option', this.$select);
            var valueToCompare = value.toString();

            for (var i = 0; i < options.length; i = i + 1) {
                var option = options[i];
                if (option.value === valueToCompare) {
                    return $(option);
                }
            }
        }
788446
private String getStringValue(Collection<CmsCategory> categories) {

        CmsObject cms = A_CmsUI.getCmsObject();
        String result = "";
        for (CmsCategory cat : categories) {
            result += cms.getRequestContext().removeSiteRoot(cat.getRootPath()) + ",";
        }
        if (result.length() > 0) {
            result = result.substring(0, result.length() - 1);
        }
        return result;
    }
739362
public function createDefaultCategory($value)
    {
        if (is_array($value)) {
            $value = isset($value['value']) ? $value['value'] : '';
        }

        if ('professions' != $value && 'employmentTypes' != $value && 'industries' != $value) {
            return null;
        }

        $builder = $this->getService('Jobs/DefaultCategoriesBuilder');

        $category = $builder->build($value);

        $this->store($category);

        return $category;
    }
166045
public static Object toExternalObject( Object value)
    {
    return
      Optional.ofNullable(
        toExternalNumber( value))
      .orElse(
        toObject( String.valueOf( value)));
    }
1035685
private function getNativeValueFromDefinition($value)
    {
        if ($this->strStartsWith($value, "'") && $this->strEndsWith($value, "'")) {
            $value = trim(trim($value, "'")); // single quote
        } else {
            if ($this->strStartsWith($value, '"') && $this->strEndsWith($value, '"')) {
                $value = trim(trim($value, '"')); // double quote
            } else {
                if ($value == 'true') {
                    $value = true;
                } else {
                    if ($value == 'false') {
                        $value = false;
                    } else {
                        if (is_numeric($value)) {
                            if (ctype_digit($value)) {
                                return (integer)$value;
                            } else {
                                return (float)$value;
                            }
                        }
                    }
                }
            }
        }

        return $value;
    }
867997
public function singular($value)
        {
            // First we'll check the cache of inflected values. We cache each word that
            // is inflected so we don't have to spin through the regular expressions
            // each time we need to inflect a given value for the developer.
            if (isset($this->singular[$value])) {
                return $this->singular[$value];
            }

            // English words may be automatically inflected using regular expressions.
            // If the word is English, we'll just pass off the word to the automatic
            // inflection method and return the result, which is cached.
            $irregular = $this->config['irregular'];

            $result = $this->auto($value, $this->config['singular'], $irregular);

            return $this->singular[$value] = $result ?: $value;
        }