bktree 1.0.0

A basic BK tree implementation in Haxe.

Released 2016-09-12.

To install, run:

haxelib install bktree 1.0.0

See using Haxelib in Haxelib documentation for more information.

MaintainerBioruebe
Websitehttps://github.com/bioruebe/hx-bktree
Current version1.0.0
StatisticsInstalled 7 times
LicenseMIT
Tags cross, datastructure, levenshtein, tree

README.md

bktree (Haxe Library)

A basic BK tree implementation in Haxe, based on the C# version from [https://nullwords.wordpress.com/2013/03/13/the-bk-tree-a-data-structure-for-spell-checking/](https://nullwords.wordpress.com/2013/03/13/the-bk-tree-a-data-structure-for-spell-checking/)

Installation

haxelib install bktree

Usage

class Main {
	static function main() {
		var bk = new BKTree();
		
		for (i in ["boot", "goat", "wolf", "cabbage"]) {
			bk.set(i);
		}
		
		trace(bk.search("toad", 2));
		// > [goat]
		
		trace(bk.search("toad", 3));
		// > [boot, wolf, goat]
		
		trace(BKTree.LevenshteinDistance("toad", "cabbage"));
		// > 6
	}
}