Home | History | Annotate | Download | only in tools

Lines Matching refs:Trie

50       "  -P, --patricia-trie  build patricia tries (default)\n"
51 " -p, --prefix-trie build prefix tries\n"
71 std::cout << "trie: patricia" << std::endl;
75 std::cout << "trie: prefix" << std::endl;
174 marisa::Trie *trie, std::vector<marisa::UInt32> *key_ids) {
176 trie->build(keys, key_ids, num_tries
178 std::printf(" %9lu", (unsigned long)trie->num_nodes());
179 std::printf(" %9lu", (unsigned long)trie->total_size());
183 void benchmark_restore(const marisa::Trie &trie,
190 trie.restore(key_ids[i], &key);
199 void benchmark_lookup(const marisa::Trie &trie,
204 const marisa::UInt32 key_id = trie.lookup(keys[i].first);
213 void benchmark_find(const marisa::Trie &trie,
220 const std::size_t num_keys = trie.find(keys[i].first, &found_key_ids);
229 void benchmark_predict_breadth_first(const marisa::Trie &trie,
240 const std::size_t num_keys = trie.predict_breadth_first(
250 void benchmark_predict_depth_first(const marisa::Trie &trie,
261 const std::size_t num_keys = trie.predict_depth_first(
273 marisa::Trie trie;
275 benchmark_build(keys, num_tries, &trie, &key_ids);
276 if (!trie.empty()) {
277 benchmark_restore(trie, keys, key_ids);
278 benchmark_lookup(trie, keys, key_ids);
279 benchmark_find(trie, keys, key_ids);
280 benchmark_predict_breadth_first(trie, keys, key_ids);
281 benchmark_predict_depth_first(trie, keys, key_ids);
329 { "patricia-trie", 0, NULL, 'P' },
330 { "prefix-trie", 0, NULL, 'p' },