Changeset 28319 for trunk/include


Ignore:
Timestamp:
Apr 30, 2014, 8:49:36 PM (10 years ago)
Author:
rvelices
Message:

english inflection rules ing/er

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/inflectors/en.php

    r28196 r28319  
    9797    $this->er2ing = array_reverse(array(
    9898      '/ers?$/' => 'ing',
    99       '/(be|draw)ers?$/' => '\0'
     99      '/(be|draw|liv)ers?$/' => '\0'
    100100    ));
    101101
    102102    $this->ing2er = array_reverse(array(
    103103      '/ing$/' => 'er',
    104       '/(th|r|hous)ing$/' => '\0',
    105       '/(be|draw)ing$/' => '\0'
     104      '/(snow|rain)ing$/' => '\1',
     105      '/(th|hous|dur|spr|wedd)ing$/' => '\0',
     106      '/(liv|draw)ing$/' => '\0'
    106107    ));
    107108
     
    124125    self::run($this->pluralizers, $word, $res);
    125126    self::run($this->singularizers, $word, $res);
    126     self::run($this->er2ing, $word, $res);
    127     $rc = self::run($this->ing2er, $word, $res);
    128     if ($rc !== false)
     127    if (strlen($word)>4)
    129128    {
    130       self::run($this->pluralizers, $rc, $res);
     129      self::run($this->er2ing, $word, $res);
     130    }
     131    if (strlen($word)>5)
     132    {
     133      $rc = self::run($this->ing2er, $word, $res);
     134      if ($rc !== false)
     135      {
     136        self::run($this->pluralizers, $rc, $res);
     137      }
    131138    }
    132139    return $res;
Note: See TracChangeset for help on using the changeset viewer.