11 releases
Uses old Rust 2015
0.5.0 | Mar 17, 2023 |
---|---|
0.4.0 | May 28, 2021 |
0.3.0 | Jan 11, 2018 |
0.2.0 | Jan 31, 2017 |
0.1.4 | Feb 20, 2016 |
#859 in Text processing
8,102 downloads per month
Used in 6 crates
(2 directly)
22KB
351 lines
rust-bk-tree
A BK-tree implementation in Rust.
Examples
Here's some example usages:
use bk_tree::{BKTree, metrics};
// A BK-tree using the Levenshtein distance metric.
let mut tree: BKTree<&str> = BKTree::new(metrics::levenshtein);
tree.add("foo");
tree.add("bar");
tree.add("baz");
tree.add("bup");
tree.find("bar", 0); // returns vec!["bar"]
tree.find("bar", 1); // returns vec!["bar", "baz"]
tree.find("bup", 2); // returns vec!["bar", "baz", "bup"]
Benchmarks
To run benchmarks, you need to have the nightly version of Rust installed. If you do (and use multirust, for example), then you can run
rustup run nightly cargo bench
to run benchmarks.
Dependencies
~225–390KB