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

Text.SpellingSuggest

Description

Simplified interface for spelling suggestion.

Synopsis

Documentation

data PhoneticCoder Source

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

data SpellingDictionary Source

The spelling dictionary.

Constructors

WordList [String] 
FlatFile String 

data SearchParams Source

Parameters controlling the suggestion search.

Constructors

SearchParams 

Fields

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.