original_string: public function getSingularForm($root) {
  		$singularForm = $root;
  
  		if (!is_string($root)) {
  			throw new \InvalidArgumentException('The pluralizer expects a string.');
  		}
  
  		if (!in_array(strtolower($root), $this->uncountable)) {
  			if (null !== $replacement = $this->checkIrregularForm($root, array_flip($this->irregular))) {
  				$singularForm = $replacement;
  			} elseif (null !== $replacement = $this->checkIrregularSuffix($root, $this->singular)) {
  				$singularForm = $replacement;
  			} elseif (!$this->isSingular($root)) {
  				// fallback to naive singularization
  				return substr($root, 0, -1);
  			}
  		}
  
  		return $singularForm;
  	}
code: public function getSingularForm($root) {
  		$singularForm = $root;
  
  		if (!is_string($root)) {
  			throw new \InvalidArgumentException('The pluralizer expects a string.');
  		}
  
  		if (!in_array(strtolower($root), $this->uncountable)) {
  			if (null !== $replacement = $this->checkIrregularForm($root, array_flip($this->irregular))) {
  				$singularForm = $replacement;
  			} elseif (null !== $replacement = $this->checkIrregularSuffix($root, $this->singular)) {
  				$singularForm = $replacement;
  			} elseif (!$this->isSingular($root)) {
  				// fallback to naive singularization
  				return substr($root, 0, -1);
  			}
  		}
  
  		return $singularForm;
  	}
code_tokens: public function getSingularForm ( $ root ) { $ singularForm = $ root ; if ( ! is_string ( $ root ) ) { throw new \ InvalidArgumentException ( 'The pluralizer expects a string.' ) ; } if ( ! in_array ( strtolower ( $ root ) , $ this -> uncountable ) ) { if ( null !== $ replacement = $ this -> checkIrregularForm ( $ root , array_flip ( $ this -> irregular ) ) ) { $ singularForm = $ replacement ; } elseif ( null !== $ replacement = $ this -> checkIrregularSuffix ( $ root , $ this -> singular ) ) { $ singularForm = $ replacement ; } elseif ( ! $ this -> isSingular ( $ root ) ) { // fallback to naive singularization return substr ( $ root , 0 , - 1 ) ; } } return $ singularForm ; }
docstring: Generate a singular name based on the passed in root.
  
  @param  string $root The root that needs to be pluralized (e.g. Author)
  @return string The singular form of $root (e.g. Authors).
  @throws \InvalidArgumentException If the parameter is not a string.
docstring_tokens: Generate a singular name based on the passed in root .