commit
2cc39b05b8
1 changed files with 2 additions and 2 deletions
|
@ -93,9 +93,9 @@ class Stemmer
|
||||||
public static function removeEndings(&$word, $regex, $region)
|
public static function removeEndings(&$word, $regex, $region)
|
||||||
{
|
{
|
||||||
$prefix = mb_substr($word, 0, $region, 'UTF-8');
|
$prefix = mb_substr($word, 0, $region, 'UTF-8');
|
||||||
$ending = substr($word, strlen($prefix));
|
$ending = mb_substr($word, mb_strlen($prefix, 'UTF-8'), null, 'UTF-8');
|
||||||
if (is_array($regex)) {
|
if (is_array($regex)) {
|
||||||
if (preg_match('/.+[а|я]' . $regex[0] . '/ui', $ending)) {
|
if (preg_match('/.+[ая]' . $regex[0] . '/ui', $ending)) {
|
||||||
$word = $prefix . preg_replace('/' . $regex[0] . '/ui', '', $ending);
|
$word = $prefix . preg_replace('/' . $regex[0] . '/ui', '', $ending);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue