本文整理匯總了PHP中Indexer::get_data_root方法的典型用法代碼示例。如果您正苦於以下問題:PHP Indexer::get_data_root方法的具體用法?PHP Indexer::get_data_root怎麽用?PHP Indexer::get_data_root使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Indexer
的用法示例。
在下文中一共展示了Indexer::get_data_root方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: usage
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";
}
示例2: Indexer
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;
}