Name

Tree::VP - Vantage-Point Tree builder and searcher.

Synopsis

A spellchecker.

my @words = read_file("/usr/share/dict/words", { chomp => 1, binmode => ":utf8" });
my $vptree = Tree::VP->new( distance => \&Text::Levenshtein::XS::distance );
$vptree->build(\@words);

my $r = $vptree->search(query => "amstedam", size => 5);
say "suggestion: " . join " ", map { $_ . " (" . distance($_, $q) . ")" } @{$r->{values}};

Methods

See Also

http://en.wikipedia.org/wiki/Vantage-point_tree

Author

Kang-min Liu gugod@gugod.org

License

The MIT License.