From ac316cee7109652edf2edeb715b8012a654433d2 Mon Sep 17 00:00:00 2001 From: rvelices Date: Tue, 15 Apr 2014 20:22:10 +0000 Subject: [PATCH] bug 3056: quick search - english inflections improvements git-svn-id: http://piwigo.org/svn/trunk@28196 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/inflectors/en.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/include/inflectors/en.php b/include/inflectors/en.php index c9663a3e5..2ce43fb22 100644 --- a/include/inflectors/en.php +++ b/include/inflectors/en.php @@ -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;