public function testFalsePositiveNormalizedInNegative() { Word::$falsePositiveNormalizedList = array('блядь'); Word::$falseNegativeList = array('бляди'); $this->assertFalse(Word::stemm('блядь')->isBadWord()); $this->assertFalse(Word::stemm('блядей')->isBadWord()); $this->assertTrue(Word::stemm('бляди')->isBadWord()); }
public function testNoVariantsWord() { $word = Word::stemm('ololo'); $this->assertFalse($word->checkGrammeme(MystemConst::DATIVE)); $this->assertNull($word->getNounCase(1)); }
<?php require __DIR__ . '/../vendor/autoload.php'; $verbs = array('шедший', 'идущий', 'вычислявшийся', 'вычисляющийся'); foreach ($verbs as $word) { echo $word . " - " . \Mystem\Word::stemm($word)->getVerbTime() . "\n"; }