function readFlexiaData($info) { $offset = $info['offset']; if (!isset($this->flexia[$offset])) { $this->flexia[$offset] = parent::readFlexiaData($info); } return $this->flexia[$offset]; }
function readAncodes($info) { $offset = $info['offset']; if (isset($this->cache[$offset])) { $this->hits++; return $this->cache[$offset]; } else { // in theory misses never occur $this->miss++; return parent::readAncodes($info); } }
/** * @param phpMorphy_GramInfo_GramInfoInterface $object * @param string $cacheFilePath * */ function __construct(phpMorphy_GramInfo_GramInfoInterface $object, $cacheFilePath) { parent::__construct($object); $this->cache = $this->readCache($cacheFilePath); $this->ends = str_repeat("", $this->getCharSize() + 1); }