private function doGenerate($outFile) { if (false === ($fh = fopen($outFile, 'wt'))) { throw new Exception("Can`t open '{$outFile}' file"); } fputs($fh, '<' . "?php\n"); fputs($fh, '// This file is autogenerated at ' . date('r') . ', don`t change it!' . "\n\n"); $files = phpMorphy_GramTab_Const_Factory::getAllXmlFiles(); foreach ($files as $file) { $helper = phpMorphy_GramTab_Const_Factory::createByXml($file); $this->writeConsts($fh, $helper); fputs($fh, '// ' . str_repeat('-', 79) . "\n\n"); } fclose($fh); }
function __construct(phpMorphy_Dict_Source_Interface $source) { $this->helper = phpMorphy_GramTab_Const_Factory::create($source->getLanguage()); foreach ($source->getAncodes() as $ancode) { $this->ancodes[] = $this->createAncode($ancode); } }