bug 3056: quick search - english inflections improvements

git-svn-id: http://piwigo.org/svn/trunk@28196 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices
2014-04-15 20:22:10 +00:00
parent f010cc86b8
commit ac316cee71
+9 -4
View File
@@ -96,12 +96,13 @@ class Inflector_en
$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'
));
}
@@ -138,8 +139,12 @@ class Inflector_en
$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;