/** * @param phpMorphy_WordForm_WordFormInterface $wordForm * @return phpMorphy_WordForm_WordForm */ function assignFromWordForm(phpMorphy_WordForm_WordFormInterface $wordForm) { $this->common_prefix = $wordForm->getCommonPrefix(); $this->form_prefix = $wordForm->getFormPrefix(); $this->base = $wordForm->getBase(); $this->suffix = $wordForm->getSuffix(); $this->part_of_speech = $wordForm->getPartOfSpeech(); $this->grammems = array_merge($wordForm->getCommonGrammems(), $wordForm->getFormGrammems()); $this->common_grammems_count = count($wordForm->getCommonGrammems()); return $this; }
function printWordForm(phpMorphy_WordForm_WordFormInterface $form) { echo $form->getWord(), ' [', $form->getCommonPrefix(), self::COMMON_PREFIX_SEPARATOR, $form->getPrefix(), self::PREFIX_SEPARATOR, $form->getBase(), self::SUFFIX_SEPARATOR, $form->getSuffix(), '] (', $form->getPartOfSpeech(), ' ', implode(',', $form->getCommonGrammems()), self::COMMON_GRAMMEMS_SEPARATOR, implode(',', $form->getFormGrammems()), ')'; }