Get the singular form of the given word.

@param  string  $value
@return string
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;
	}
1145294
public function filter($value)
    {
        if (!is_string($value)) {
            return $value;
        }

        $value = (string) $value;

        // Split the string into separate words
        /** @var array $words */
        $words   = explode(' ', (string) $value);
        $results = [];

        foreach ($words as $key => $word) {
            // If this is the first, or it's not a small word, capitalize it
            if ($key === 0 || !in_array($word, static::$_excludeWords, true)) {
                if ($this->options['encoding'] !== null) {
                    $word = mb_convert_case($word, MB_CASE_TITLE, $this->options['encoding']);
                } else {
                    $word = ucwords(strtolower($word));
                }
            }

            $word = trim($word);

            if (strlen($word) > 0) {
                $results[] = $word;
            }
        }

        return implode(' ', $results);
    }
3774
private function pluralize($singular)
    {
        if (null === $this->pluralizer) {
            return $singular;
        }

        return call_user_func($this->pluralizer, $singular);
    }
945116
protected function resolveValue($value)
    {
        if (is_array($value)) {
            foreach ($value as $index => $val) {
                $value[$index] = $this->resolveValue($val);
            }

            return $value;
        }

        if (is_string($value) && '@' == $value[0]) {
            return $this->offsetGet(substr($value, 1));
        }

        return $value;
    }
1108105
public static function singularize(string $word): string
    {
        if (isset(static::$inflectorCache['singularize'][$word])) {
            return static::$inflectorCache['singularize'][$word];
        }

        if (!isset(static::$inflectorCache['irregular']['singular'])) {
            static::$inflectorCache['irregular']['singular'] = '(?:' . implode('|', static::$irregular) . ')';
        }

        if (preg_match('/(.*?(?:\\b|_))(' . static::$inflectorCache['irregular']['singular'] . ')$/i', $word, $regs)) {
            static::$inflectorCache['singularize'][$word] = $regs[1] . substr($regs[2], 0, 1) .
                substr(array_search(strtolower($regs[2]), static::$irregular), 1);

            return static::$inflectorCache['singularize'][$word];
        }

        if (!isset(static::$inflectorCache['uninflected'])) {
            static::$inflectorCache['uninflected'] = '(?:' . implode('|', static::$uninflected) . ')';
        }

        if (preg_match('/^(' . static::$inflectorCache['uninflected'] . ')$/i', $word, $regs)) {
            static::$inflectorCache['pluralize'][$word] = $word;

            return $word;
        }

        foreach (static::$singular as $rule => $replacement) {
            if (preg_match($rule, $word)) {
                static::$inflectorCache['singularize'][$word] = preg_replace($rule, $replacement, $word);

                return static::$inflectorCache['singularize'][$word];
            }
        }

        static::$inflectorCache['singularize'][$word] = $word;

        return $word;
    }
1198860
public function pluralize($value)
    {
        $key = $this->truncate ? self::APPEND : '_';

        return $this->getValue($value, $key, $this->plurals, $this->cache['p'], $this->truncate);
    }
1025757
public function getFullnameAttribute($value)
    {
        if (!strlen($this->firstname) and ! strlen($this->lastname)) {
            return '---';
        }
        return $this->firstname . ' ' . $this->lastname;
    }
1016008
public function getNameByValue($value)
    {
        $i = array_search($value, $this->__data, true);
        if($i===false)
        {
            return null;
        }
        return $i;
    }
11579
private function getName($value)
    {
        if (is_object($value)) {
            return get_class($value);
        }
        if (is_array($value)) {
            return $this->getArrayName();
        }

        return $this->getScalarName($value);
    }
612877
public function getString($value)
    {
        $output = '[';
        for ($i = 0; $i < count($value); $i++) {
            $output .= $value[$i];
            if ($i < (count($value) - 1)) {
                $output .= ', ';
            }
        }
        $output .= ']';
        return $output;
    }
161880
protected function numberToEnglish(string $value): string
    {
        if ('.' !== $this->getDecimalPoint()) {
            return str_replace($this->getDecimalPoint(), '.', $value);
        }
        return $value;
    }
45690
public static function snakePlural(string $value): string
    {
        if (isset(self::$snakePluralCache[$value])) {
            return self::$snakePluralCache[$value];
        }

        $snake_case = self::convertCamelCaseToSnakeCase($value);
        $snakeCaseEx = explode('_', $snake_case);

        $plural = '';
        foreach ($snakeCaseEx as $word) {
            if ($word !== '') {
                if (substr($word, -1, mb_strlen($word)) === 'y') {  // si finit par "y" ...
                    $w = substr($word, 0, -1);
                    $test = substr($word, -2, mb_strlen($word));
                    if (preg_match("/^[BCDFGHJKLMNPQRSTVWXZ]+y$/i", $test)) {
                        $plural .= '_'.$w.'ies';  // ... si finit par "consonne + y" -> mettre "ies" à la place
                    } else {
                        $plural .= '_'.$word.'s';  // ... si finit par "voyelle + y" -> mettre "ys" à la place
                    }
                } elseif (substr($word, -1, mb_strlen($word)) === 'o') {
                    $plural .= '_'.$word.'es';  // si finit par "o" -> mettre "oes" à la place
                } else {
                    $plural .= '_'.$word.'s';  // si non, ajouter un "s"
                }
            }
        }

        return self::$snakePluralCache[$value] = trim($plural, '_');
    }
52032
public function shorthand($value) {
		$important = '';
		if ($this->parser->is_important($value)) {
			$values = $this->parser->gvw_important($value);
			$important = '!important';
		}
		else
			$values = $value;

		$values = explode(' ', $values);
		switch (count($values)) {
			case 4:
				if ($values[0] == $values[1] && $values[0] == $values[2] && $values[0] == $values[3]) {
					return $values[0] . $important;
				} elseif ($values[1] == $values[3] && $values[0] == $values[2]) {
					return $values[0] . ' ' . $values[1] . $important;
				} elseif ($values[1] == $values[3]) {
					return $values[0] . ' ' . $values[1] . ' ' . $values[2] . $important;
				}
				break;

			case 3:
				if ($values[0] == $values[1] && $values[0] == $values[2]) {
					return $values[0] . $important;
				} elseif ($values[0] == $values[2]) {
					return $values[0] . ' ' . $values[1] . $important;
				}
				break;

			case 2:
				if ($values[0] == $values[1]) {
					return $values[0] . $important;
				}
				break;
		}

		return $value;
	}
1205081
public static function convertDashToCamelCase ($value)
    {
        $Filter = new \Zend\Filter\Word\DashToCamelCase();
        return $Filter->filter($value);
    }
18983
public function singularize($value)
    {

        $key = $this->truncate ? self::REDUCE : '_';

        return $this->getValue($value, $key, $this->singulars, $this->cache['s'], $this->truncate);
    }
395030
public static function singular($word)
    {
        if(is_array($word)) {
            $keys = array_keys($word);
            $size = sizeof($keys);

            for($i = 0; $i < $size; $i++) {
                $word[$keys[$size]] = Str::singular($word);
            }

            return $word;
        }

        return Inflector::singular($word);
    }
1004874
public function getNamePrefix($value)
    {
        if (empty($value)) {
            return null;
        }
        preg_match('/(?:\@(?P<prefix>INLINE))?(?P<value>.+)/is', $value, $matches);

        return [
            'prefix' => Helper::getValue($matches['prefix']),
            'value' => Helper::getValue($matches['value'])
        ];
    }