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

#883 in Text processing

Download history 5690/week @ 2024-02-26 4915/week @ 2024-03-04 4079/week @ 2024-03-11 4918/week @ 2024-03-18 4845/week @ 2024-03-25 4398/week @ 2024-04-01 4134/week @ 2024-04-08 4555/week @ 2024-04-15 3994/week @ 2024-04-22 2054/week @ 2024-04-29 3672/week @ 2024-05-06 2947/week @ 2024-05-13 2743/week @ 2024-05-20 1560/week @ 2024-05-27 1294/week @ 2024-06-03 1055/week @ 2024-06-10

6,770 downloads per month
Used in 6 crates (2 directly)

MIT license

22KB
351 lines

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.

Dependencies

~225–405KB