Skip to content

Bioruebe/hx-bktree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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/

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
	}
}

About

A basic BK tree implementation in Haxe

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages