Skip to content

terasum/js-bktree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Burkhard-Keller Tree (BK-Tree) JavaScript implements

The BK-tree is a simillar words fuzzy search algorithm, you can use this package search the simillar words from a long terms list.

The edit distance calc algorithm is Damerau–Levenshtein distance

USAGE

import BKTree from "../lib/bktree";

const words = [
"Aani", "aardvark", "aardwolf", "Aaron", "Aaronic",
"Aaronical", "Aaronite", "Aaronitic", "Aaru", "Ab",  "aba", "Ababdeh", "Ababua", "abac",
"abaca", "abacate", "abacay", "abacinate", "abacination", "abaciscus", "abacist", "aback",
"abactinal", "abactinally", "abaction", "abactor","abaculus", "abacus", "Abadite", "abaff",
"abaft", "abaisance", "abaiser", "abaissed", "abalienate", "abalienation", "abalone",
"Abama", "abampere", "abandon", "abandonable","abandoned", "abandonedly", "abandonee",
"abandoner", "abandonment","Abanic", "Abantes","abaptiston", "Abarambo", "Abaris",
"abarthrosis", "abarticular","abarticulation", "abas", "abase", "abased", "abasedly",
"abasedness", "abasement","abaser", "Abasgi", "abash", "abashed", "abashedly", "abashedness",
"abashless","abashlessly", "abashment", "abasia", "abasic", "abask", "Abassin",
"abastardize","abatable", "abate", "abatement", "abater", "abatis", "abatised", "abaton",
"abator","abattoir", "Abatua", "abature", "abave", "abaxial", "abaxile", "abaze", "abb",
"Abba","abbacomes", "abbacy", "Abbadide" ] ;


const bktree = new BKTree(words.length);
bktree.add(words);
console.log(bktree.simWords("anic", 2));
// [ 'Aani', 'Abanic' ]

About

Burkhard-Keller Tree (BK-Tree) js implements

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published