diff options
author | rvelices <rv-github@modusoptimus.com> | 2014-04-30 18:49:36 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2014-04-30 18:49:36 +0000 |
commit | e9f39d188d6d6db26c8ae012aaf78f8be8b2abc0 (patch) | |
tree | 9e121120e96575c5552571d923560fbea805796f /include/inflectors | |
parent | 5e1cf61f2009d4d05ad4d95d1f56a84e2ddd0de2 (diff) |
english inflection rules ing/er
git-svn-id: http://piwigo.org/svn/trunk@28319 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/inflectors')
-rw-r--r-- | include/inflectors/en.php | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/include/inflectors/en.php b/include/inflectors/en.php index 2ce43fb22..63571440d 100644 --- a/include/inflectors/en.php +++ b/include/inflectors/en.php @@ -96,13 +96,14 @@ class Inflector_en $this->er2ing = array_reverse(array( '/ers?$/' => 'ing', - '/(be|draw)ers?$/' => '\0' + '/(be|draw|liv)ers?$/' => '\0' )); $this->ing2er = array_reverse(array( '/ing$/' => 'er', - '/(th|r|hous)ing$/' => '\0', - '/(be|draw)ing$/' => '\0' + '/(snow|rain)ing$/' => '\1', + '/(th|hous|dur|spr|wedd)ing$/' => '\0', + '/(liv|draw)ing$/' => '\0' )); } @@ -123,11 +124,17 @@ class Inflector_en self::run($this->pluralizers, $word, $res); self::run($this->singularizers, $word, $res); - self::run($this->er2ing, $word, $res); - $rc = self::run($this->ing2er, $word, $res); - if ($rc !== false) + if (strlen($word)>4) { - self::run($this->pluralizers, $rc, $res); + self::run($this->er2ing, $word, $res); + } + if (strlen($word)>5) + { + $rc = self::run($this->ing2er, $word, $res); + if ($rc !== false) + { + self::run($this->pluralizers, $rc, $res); + } } return $res; } |