singularize() public static method

Returns the singular of the $word
public static singularize ( string $word ) : string
$word string the english word to singularize
return string Singular noun.
 /**
  * Gets the source and returns a string. If a relation is defined adjusts the source in order
  * to match that url.
  *
  * Base source name is defined by the table name in the model
  *
  * @return string
  */
 public function getSource()
 {
     /* @var $modelClass ActiveRecord */
     $modelClass = $this->modelClass;
     $source = $modelClass::tableName();
     if (!empty($this->where['id'])) {
         $source = BaseInflector::singularize($source) . '/' . $this->where['id'];
         unset($this->where['id']);
     } else {
         if (!empty($this->link)) {
             $pre = '';
             foreach ($this->link as $key => $link) {
                 $pre .= "{$key}/{$link}";
             }
             $source = $pre . '/' . $source;
         }
     }
     return 'discovery/' . $source;
 }