Safe Haskell | Safe-Inferred |
---|
"A phonetic algorithm is an algorithm for indexing of words by their pronunciation": https://en.wikipedia.org/wiki/Phonetic_algorithm.
Right now only a very rudimental one is provided, Soundex
; plus
Encoder
, a generic interface.
Types
Type class for algorithms that encode words based on their pronunciation.
Minimal definition: alphabet
, encodeUnsafe
.
alphabet :: Alphabet encSource
The range of characters that the algorithm will accept
encodeUnsafe :: ListLike full Char => full -> Code encSource
Unchecked encoding: if characters not in alphabet
are in the word the
behaviour is undefined. You should use encode
.
encode :: ListLike full Char => full -> Maybe (Code enc)Source
Safe encodeUnsafe
: checks that all the characters are in alphabet
first.