Safe Haskell | Safe-Infered |
---|
Simplified interface for spelling suggestion.
- data PhoneticCoder
- data SpellingDictionary
- data SearchParams = SearchParams {}
- defaultSearchParams :: SearchParams
- findPhoneticCoder :: String -> Maybe PhoneticCoder
- defaultPhoneticCoder :: PhoneticCoder
- defaultWordFilter :: SpellingWordFilter
- dictionaryIsDB :: SpellingDictionary -> Bool
- openDictionary :: Maybe String -> Maybe String -> IO SpellingDictionary
- closeDictionary :: SpellingDictionary -> IO ()
- suggest :: SearchParams -> SpellingDictionary -> String -> IO [String]
- suggestFromList :: SearchParams -> [String] -> String -> [String]
- nearbyWordFilter :: String -> String -> Bool
- anyWordFilter :: String -> String -> Bool
- defaultDB :: IO String
- defaultDictionary :: String
Documentation
data PhoneticCoder Source
We need to know the name and coding function of each phonetic coder.
data SearchParams Source
Parameters controlling the suggestion search.
SearchParams | |
|
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.
defaultWordFilter :: SpellingWordFilterSource
A default word filter.
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.
defaultDictionary :: StringSource
File path for default dictionary.