Exemplo n.º 1
0
function usage($message = null)
{
    if ($message != null) {
        echo "\n*** {$message} ***\n";
    }
    echo "\nUsage: php makeindex.php [-options] [<csv filename>]";
    echo "\n\nwhere options include:";
    echo "\n\n";
    echo "-h\t\tprint this information\n";
    echo "-f\t\tforce indexation\n";
    $indexer = new Indexer();
    echo "-d <dir>\tindex data files in directory <dir> (defaults to " . $indexer->get_data_root() . ")\n";
    echo "\n";
    echo "If <csv filename> is present, index only that file; otherwise index all csv files newer than main index.\n\n";
}
 static function _listOfMorphemes($ref_to_list_of_files)
 {
     $logger = Logger::getLogger('LinguisticObjects.listOfMorphemes');
     $logger->debug("ref fichiers= '{$ref_to_list_of_files}'");
     $indexer = new Indexer();
     $data_directory = $indexer->get_data_root();
     $reader = new CSV_DB_Reader($data_directory);
     $list_morphemes = array();
     foreach ($ref_to_list_of_files as $a_file) {
         $a_csv_file = $a_file . '.csv';
         $list = $reader->listOfElementsInCSVFile($a_csv_file);
         $list_morphemes = array_merge($list_morphemes, $list);
     }
     return $list_morphemes;
 }