function __construct(phpMorphy_Storage $ancodesMap) { if (false === ($this->ancodes_map = unserialize($ancodesMap->read(0, $ancodesMap->getFileSize())))) { throw new phpMorphy_Exception("Can`t open phpMorphy => Dialing ancodes map"); } $this->reverse_map = array_flip($this->ancodes_map); }
protected function __construct(phpMorphy_Storage $storage) { $this->data = unserialize($storage->read(0, $storage->getFileSize())); if (false === $this->data) { throw new phpMorphy_Exception("Broken gramtab data"); } $this->grammems = $this->data['grammems']; $this->poses = $this->data['poses']; $this->ancodes = $this->data['ancodes']; }