aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Kiryukhin <alexander@kiryukhin.su>2018-01-14 00:26:24 +0300
committerGitHub <noreply@github.com>2018-01-14 00:26:24 +0300
commit2cc39b05b8e34b46413c89a197647a9f70f1180b (patch)
treee42fd3eff72881ad25e2bf41ec431afca0a2ebd2
parent24910f8add42cb281506751ecb916f7a27e1448f (diff)
parent2d504dac47d00c15a4a21a5bfc4ef7070f2a0350 (diff)
Merge pull request #10 from vklimin/patch-3HEADmaster
Update Stemmer.php
-rw-r--r--src/NXP/Stemmer.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/NXP/Stemmer.php b/src/NXP/Stemmer.php
index 0188434..09b24f7 100644
--- a/src/NXP/Stemmer.php
+++ b/src/NXP/Stemmer.php
@@ -93,9 +93,9 @@ class Stemmer
public static function removeEndings(&$word, $regex, $region)
{
$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 (preg_match('/.+[а|я]' . $regex[0] . '/ui', $ending)) {
+ if (preg_match('/.+[ая]' . $regex[0] . '/ui', $ending)) {
$word = $prefix . preg_replace('/' . $regex[0] . '/ui', '', $ending);
return true;
}