/**
  * @todo Implement testConstructFromPosAndGrammems().
  */
 public function testConstructFromPosAndGrammems()
 {
     $this->assertEquals($this->object, phpMorphy_UserDict_GrammarIdentifier::constructFromPosAndGrammems('PART_OF_SPEECH', "a , \t\t b\t\t , \t c   "));
     $obj3 = phpMorphy_UserDict_GrammarIdentifier::constructFromPosAndGrammems("*     \t\t\t", '');
     $this->assertFalse($obj3->hasPartOfSpeech());
     $this->assertEquals(array(), $obj3->getGrammems());
 }
예제 #2
0
 /**
  * @param DOMNode $node
  */
 private function onDeleteCommand(DOMNode $node)
 {
     $pattern = new phpMorphy_UserDict_Pattern($this->normalizeEncoding($this->getAttribute($node, 'lexem')), phpMorphy_UserDict_GrammarIdentifier::constructFromPosAndGrammems($this->normalizeEncoding($this->getAttribute($node, 'lexem-pos', false, null)), $this->normalizeEncoding($this->getAttribute($node, 'lexem-grammems', false, ''))));
     $from = strtolower($this->getAttribute($node, 'from', false, 'both'));
     $delete_from_internal = $from === 'internal' || $from === 'both';
     $delete_from_external = $from === 'external' || $from === 'both';
     $this->visitor->deleteLexem($pattern, $delete_from_internal, $delete_from_external);
 }