spelling-suggest-0.5.1: Spelling suggestion tool with library and command-line interfaces.

Safe HaskellSafe-Infered



Simplified interface for spelling suggestion.



data PhoneticCoder Source

We need to know the name and coding function of each phonetic coder.

data SpellingDictionary Source

The spelling dictionary.


WordList [String] 
FlatFile String 

data SearchParams Source

Parameters controlling the suggestion search.




searchParamsFilter :: SpellingWordFilter

Prefilter to use to limit search.

searchParamsCoder :: PhoneticCoder

Phonetic coder to use for matches.

searchParamsChoices :: Int

Maximum number of choices returned.

defaultSearchParams :: SearchParamsSource

These params work OK in practice.

findPhoneticCoder :: String -> Maybe PhoneticCoderSource

Return the coding system with the given name.

defaultPhoneticCoder :: PhoneticCoderSource

A default phonetic coder.

dictionaryIsDB :: SpellingDictionary -> BoolSource

For performance reasons, it may sometimes be desirable to know what's sitting under the dictionary.

openDictionary :: Maybe String -> Maybe String -> IO SpellingDictionarySource

Make a connection to the given or default database. If this fails, open the given or default dictionary and cache the words. XXX Will leak a file handle if readDictionary does.

suggest :: SearchParams -> SpellingDictionary -> String -> IO [String]Source

Suggest candidates in order using the given information. Requires a valid spelling dictionary.

suggestFromList :: SearchParams -> [String] -> String -> [String]Source

Suggest candidates from the given list in order using the given information.

nearbyWordFilter :: String -> String -> BoolSource

Return True if the editDistance from the target word to the given word is small enough.

anyWordFilter :: String -> String -> BoolSource

Always returns True.

defaultDB :: IO StringSource

File path for default cache database.

defaultDictionary :: StringSource

File path for default dictionary.