A BK-tree implementation in Rust.
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"]
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.