Skip to content

Commit

Permalink
bug 3056: quick search - english inflections improvements
Browse files Browse the repository at this point in the history
git-svn-id: http://piwigo.org/svn/trunk@28196 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rvelices committed Apr 15, 2014
1 parent f010cc8 commit ac316ce
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions include/inflectors/en.php
Expand Up @@ -96,12 +96,13 @@ function __construct()

$this->er2ing = array_reverse(array(
'/ers?$/' => 'ing',
'/((be|riv)ers?)$/' => '\1'
'/(be|draw)ers?$/' => '\0'
));

$this->ing2er = array_reverse(array(
'/ing$/' => 'er',
'/(being)$/' => '\1'
'/(th|r|hous)ing$/' => '\0',
'/(be|draw)ing$/' => '\0'
));

}
Expand Down Expand Up @@ -138,8 +139,12 @@ private static function run($rules, $word, &$res)
$rc = preg_replace($rule.'i', $replacement, $word, -1, $count);
if ($count)
{
$res[] = $rc;
return $rc;
if ($rc !== $word)
{
$res[] = $rc;
return $rc;
}
break;
}
}
return false;
Expand Down

0 comments on commit ac316ce

Please sign in to comment.