diff options
author | Alexander kiryukhin <alexander@symdev.org> | 2014-11-13 15:53:59 +0300 |
---|---|---|
committer | Alexander kiryukhin <alexander@symdev.org> | 2014-11-13 15:53:59 +0300 |
commit | c0d8c1c291759e319ad603f2267aa240ba455ee7 (patch) | |
tree | 91cc657ae62ca8a66f126402558b8082d334d722 /src/NXP/Stemmer.php | |
parent | c24974c7de1340e8aff654dd66158ccb8d98136a (diff) |
Issue 1, Issue 2, Issue 3, Issue 4
Diffstat (limited to 'src/NXP/Stemmer.php')
-rw-r--r-- | src/NXP/Stemmer.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/NXP/Stemmer.php b/src/NXP/Stemmer.php index 3457c21..76d494b 100644 --- a/src/NXP/Stemmer.php +++ b/src/NXP/Stemmer.php @@ -36,7 +36,6 @@ class Stemmer private $word = ''; private $RV = 0; - private $R1 = 0; private $R2 = 0; public function getWordBase($word) @@ -105,7 +104,8 @@ class Stemmer private function findRegions() { $state = 0; - for ($i = 1; $i < mb_strlen($this->word, 'utf8'); $i++) { + $wordLength = mb_strlen($this->word, 'utf8'); + for ($i = 1; $i < $wordLength; $i++) { $prevChar = mb_substr($this->word, $i - 1, 1, 'utf8'); $char = mb_substr($this->word, $i, 1, 'utf8'); switch ($state) { @@ -117,7 +117,6 @@ class Stemmer break; case 1: if ($this->isVowel($prevChar) && !$this->isVowel($char)) { - $this->R1 = $i + 1; $state = 2; } break; @@ -135,4 +134,4 @@ class Stemmer { return (strpos($this->vowel, $char) !== false); } -}
\ No newline at end of file +} |