Example #1
0
 protected function createAncodesResolverInternal(Gram\Tab\TabInterface $gramtab)
 {
     switch ($this->options['resolve_ancodes']) {
         case self::RESOLVE_ANCODES_AS_TEXT:
             return array('\\Deimos\\Morphy\\AncodesResolver\\ToText', array($gramtab));
         case self::RESOLVE_ANCODES_AS_INT:
             return array('\\Deimos\\Morphy\\AncodesResolver\\AsIs', array());
         case self::RESOLVE_ANCODES_AS_DIALING:
             return array('\\Deimos\\Morphy\\AncodesResolver\\ToDialingAncodes', array($this->factory->open($this->options['storage'], $this->bundle->getAncodesMapFile(), true)));
         default:
             // todo
             throw new \Exception("Invalid resolve_ancodes option, valid values are RESOLVE_ANCODES_AS_DIALING, RESOLVE_ANCODES_AS_INT, RESOLVE_ANCODES_AS_TEXT");
     }
 }