protected function createAncodesResolverInternal(phpMorphy_GramTab_Interface $gramtab, phpMorphy_FilesBundle $bundle) { switch ($this->options['resolve_ancodes']) { case self::RESOLVE_ANCODES_AS_TEXT: return array('phpMorphy_AncodesResolver_ToText', array($gramtab)); case self::RESOLVE_ANCODES_AS_INT: return array('phpMorphy_AncodesResolver_AsIs', array()); case self::RESOLVE_ANCODES_AS_DIALING: return array('phpMorphy_AncodesResolver_ToDialingAncodes', array($this->storage_factory->open($this->options['storage'], $bundle->getAncodesMapFile(), true))); default: throw new phpMorphy_Exception("Invalid resolve_ancodes option, valid values are RESOLVE_ANCODES_AS_DIALING, RESOLVE_ANCODES_AS_INT, RESOLVE_ANCODES_AS_TEXT"); } }