anomalie
anomalii
anonim
anonimă
ansamblu
ansamblul
anselm
antantist
ante
antebraţul
antepresupoziţiuni
anterioară
anterioare
anterior
antică
antice
antici
anticipat
anticipată
anticipaţie
anticipaţiilor
anticipez
antiintervenţionist
antilopă
antinomie
antipatic
HERE;
$words = explode("\r\n", $words);
foreach ($words as $word) {
    echo $word . ' - ' . RomanianStemmer::Stem($word) . '<br />';
}
Ejemplo n.º 2
0
octet
octeţ
octogenar
octombr
ocular
ocult
ocult
ocult
ocult
ocultăr
oculţ
ocup
ocup
ocup
ocupanţ
ocupanţ
ocup
ocup
HERE;
$words = explode("\n", $words);
$expectedResults = explode("\n", $expectedResults);
for ($i = 0; $i < count($words); $i++) {
    $word = $words[$i];
    $expected = $expectedResults[$i];
    $stem = RomanianStemmer::Stem($words[$i]);
    if (strcmp($stem, $expected) !== 0) {
        echo 'Word: ' . $words[$i] . ' - Stem ' . $stem . ' - Expected: ' . $expected . PHP_EOL;
        exit(1);
    }
}
echo 'Success';