$argv[4] = "\$"; } makeSuggestTrie($argv[2], $argv[3], $argv[4]); break; case "filter": array_shift($argv); array_shift($argv); makeNWordGramsFiles($argv); break; case "segment-filter": $file_path = PREP_DIR . "/"; if (!file_exists($file_path . $argv[2])) { echo $argv[2] . " does not exist in " . $file_path; exit; } NWordGrams::makeSegmentFilterFile($file_path . $argv[2], $argv[3]); break; default: echo $usage; exit; } if (!PROFILE) { echo "Please configure the search engine instance " . "by visiting its web interface on localhost.\n"; exit; } /** * Makes an n or all word gram Bloom filter based on the supplied arguments * Wikipedia files are assumed to have been place in the PREP_DIR before this * is run and writes it into the resources folder of the given locale * * @param array $args command line arguments with first two elements of $argv