language-spelling-0.2: Various tools to detect/correct mistakes in words

Safe HaskellNone

Language.Distance.Search.BK

Contents

Description

An implementation of Search based on a BK-tree: https://en.wikipedia.org/wiki/Bk-tree. It performs reasonably, and it scales decently as the query distance increases. Moreover the data structure can work on any instance of EditDistance, or in fact any metric space - a generic interface is provided in BKTree.

However, for very short distances (less than 3), TST is faster.

Synopsis

Data type

data BKTree full algo Source

Operations

empty :: forall full sym algo. (EditDistance sym algo, ListLike full sym) => BKTree full algoSource

insert :: (EditDistance sym algo, ListLike full sym) => full -> BKTree full algo -> BKTree full algoSource

query :: (ListLike full sym, EditDistance sym algo) => Int -> full -> BKTree full algo -> [(full, Distance algo)]Source

levenshtein :: (ListLike full sym, EditDistance sym Levenshtein) => Int -> full -> BKTree full Levenshtein -> [(full, Distance Levenshtein)]Source