Example #1
0
 function getAccents()
 {
     // HACK: all lemmas points to accent model with 0 index and length = 4096
     $accent_model = new phpMorphy_Dict_AccentModel(0);
     $accent_model->import(new ArrayIterator(array_fill(0, 4096, null)));
     return new ArrayIterator(array(0 => $accent_model));
 }
Example #2
0
 protected function processLine($line)
 {
     if (substr($line, -1, 1) == ';') {
         $line = substr($line, 0, -1);
     }
     $result = new phpMorphy_Dict_AccentModel($this->getPosition());
     $result->import(new ArrayIterator(array_map(array($this, 'processAccentValue'), explode(';', $line))));
     return $result;
 }
 /**
  * @param phpMorphy_Dict_AccentModel $model
  * @return string
  */
 function formatAccentModel(phpMorphy_Dict_AccentModel $model)
 {
     $this->formatSimpleModel('AccentModel', array('id' => $model->getId(), 'accents' => implode(', ', $model->getAccents())));
 }