public static function singular($string)
	{
		//assing the input string to a result variable
		$result = $string;

		//loop through the array of singular patterns, getting the regular exppression patters
		foreach ($self::$singulars as $rule => $replacement) 
		{
			//get the regular expression friendly pattern
			$rule = self::normalize($rule);

			//check if there is a matching pattern in the input string
			if ( preg_match($rule, $string) ) 
			{
				//replace with the appropriate string and return
				$result = preg_replace($rule, $replacement, $string);

				//once  a replacement is found, break out of the loop
				break;

			}

		}

		//return the result that was found
		return $result;

	}
public static function singular($string)
	{
		//assing the input string to a result variable
		$result = $string;

		//loop through the array of singular patterns, getting the regular exppression patters
		foreach ($self::$singulars as $rule => $replacement) 
		{
			//get the regular expression friendly pattern
			$rule = self::normalize($rule);

			//check if there is a matching pattern in the input string
			if ( preg_match($rule, $string) ) 
			{
				//replace with the appropriate string and return
				$result = preg_replace($rule, $replacement, $string);

				//once  a replacement is found, break out of the loop
				break;

			}

		}

		//return the result that was found
		return $result;

	}
public static function singular ( $ string ) { //assing the input string to a result variable $ result = $ string ; //loop through the array of singular patterns, getting the regular exppression patters foreach ( $ self :: $ singulars as $ rule => $ replacement ) { //get the regular expression friendly pattern $ rule = self :: normalize ( $ rule ) ; //check if there is a matching pattern in the input string if ( preg_match ( $ rule , $ string ) ) { //replace with the appropriate string and return $ result = preg_replace ( $ rule , $ replacement , $ string ) ; //once  a replacement is found, break out of the loop break ; } } //return the result that was found return $ result ; }
This method gets the singular form of an input string

@param string $string The input string for which an singular term is to be found.
@return string The output string after appropriate replacement has been done.
This method gets the singular form of an input string