Issue 1, Issue 2, Issue 3, Issue 4
This commit is contained in:
parent
c24974c7de
commit
c0d8c1c291
2 changed files with 4 additions and 5 deletions
|
@ -36,7 +36,6 @@ class Stemmer
|
||||||
|
|
||||||
private $word = '';
|
private $word = '';
|
||||||
private $RV = 0;
|
private $RV = 0;
|
||||||
private $R1 = 0;
|
|
||||||
private $R2 = 0;
|
private $R2 = 0;
|
||||||
|
|
||||||
public function getWordBase($word)
|
public function getWordBase($word)
|
||||||
|
@ -105,7 +104,8 @@ class Stemmer
|
||||||
private function findRegions()
|
private function findRegions()
|
||||||
{
|
{
|
||||||
$state = 0;
|
$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');
|
$prevChar = mb_substr($this->word, $i - 1, 1, 'utf8');
|
||||||
$char = mb_substr($this->word, $i, 1, 'utf8');
|
$char = mb_substr($this->word, $i, 1, 'utf8');
|
||||||
switch ($state) {
|
switch ($state) {
|
||||||
|
@ -117,7 +117,6 @@ class Stemmer
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if ($this->isVowel($prevChar) && !$this->isVowel($char)) {
|
if ($this->isVowel($prevChar) && !$this->isVowel($char)) {
|
||||||
$this->R1 = $i + 1;
|
|
||||||
$state = 2;
|
$state = 2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue