예제 #1
0
파일: gen.php 프로젝트: Sywooch/dump
 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);
 }
예제 #2
0
 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);
     }
 }