original_string: public static function irregular($singular, $plural, $locale = 'default')
      {
          $rules = !is_array($singular) ? [$singular => $plural] : $singular;
  
          $len = min(strlen($singular), strlen($plural));
  
          $prefix = '';
          $index = 0;
          while ($index < $len && ($singular[$index] === $plural[$index])) {
              $prefix .= $singular[$index];
              $index++;
          }
          if (!$sSuffix = substr($singular, $index)) {
              $sSuffix = '';
          }
          if (!$pSuffix = substr($plural, $index)) {
              $pSuffix = '';
          }
  
          static::singular("/({$singular})$/i", "\\1", $locale);
          static::singular("/({$prefix}){$pSuffix}$/i", "\\1{$sSuffix}", $locale);
          static::plural("/({$plural})$/i", "\\1", $locale);
          static::plural("/({$prefix}){$sSuffix}$/i", "\\1{$pSuffix}", $locale);
      }
code: public static function irregular($singular, $plural, $locale = 'default')
      {
          $rules = !is_array($singular) ? [$singular => $plural] : $singular;
  
          $len = min(strlen($singular), strlen($plural));
  
          $prefix = '';
          $index = 0;
          while ($index < $len && ($singular[$index] === $plural[$index])) {
              $prefix .= $singular[$index];
              $index++;
          }
          if (!$sSuffix = substr($singular, $index)) {
              $sSuffix = '';
          }
          if (!$pSuffix = substr($plural, $index)) {
              $pSuffix = '';
          }
  
          static::singular("/({$singular})$/i", "\\1", $locale);
          static::singular("/({$prefix}){$pSuffix}$/i", "\\1{$sSuffix}", $locale);
          static::plural("/({$plural})$/i", "\\1", $locale);
          static::plural("/({$prefix}){$sSuffix}$/i", "\\1{$pSuffix}", $locale);
      }
code_tokens: public static function irregular ( $ singular , $ plural , $ locale = 'default' ) { $ rules = ! is_array ( $ singular ) ? [ $ singular => $ plural ] : $ singular ; $ len = min ( strlen ( $ singular ) , strlen ( $ plural ) ) ; $ prefix = '' ; $ index = 0 ; while ( $ index < $ len && ( $ singular [ $ index ] === $ plural [ $ index ] ) ) { $ prefix .= $ singular [ $ index ] ; $ index ++ ; } if ( ! $ sSuffix = substr ( $ singular , $ index ) ) { $ sSuffix = '' ; } if ( ! $ pSuffix = substr ( $ plural , $ index ) ) { $ pSuffix = '' ; } static :: singular ( "/({$singular})$/i" , "\\1" , $ locale ) ; static :: singular ( "/({$prefix}){$pSuffix}$/i" , "\\1{$sSuffix}" , $ locale ) ; static :: plural ( "/({$plural})$/i" , "\\1" , $ locale ) ; static :: plural ( "/({$prefix}){$sSuffix}$/i" , "\\1{$pSuffix}" , $ locale ) ; }
docstring: Set a new exception in inflection.
  
  @param string $singular The singular form of the word.
  @param string $plural   The plural form of the word.
  @param string $locale   The locale where this irregularity will be applied.
docstring_tokens: Set a new exception in inflection .