bk-tree

Crates.iobk-tree
lib.rsbk-tree
version0.5.0
sourcesrc
created_at2016-02-14 07:13:30.894821
updated_at2023-03-17 14:50:05.716774
descriptionA Rust BK-tree implementation
homepage
repositoryhttps://github.com/eugene-bulkin/rust-bk-tree
max_upload_size
id4173
size30,100
Eugene Bulkin (eugene-bulkin)

documentation

http://eugene-bulkin.github.io/rust-docs/rust-bk-tree/bk_tree/index.html

README

rust-bk-tree

A BK-tree implementation in Rust.

Build Status Crates.io Clippy Linting Result

Documentation

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.

Commit count: 67

cargo fmt