enchant-0.1.0.0: Binding to the Enchant library

Safe HaskellNone
LanguageHaskell2010

Language.Enchant

Description

Binding to the Enchant library.

Synopsis

Documentation

type Broker = Ptr Broker' Source #

brokerDescribe :: Broker -> IO [Provider] Source #

Enumerates the Enchant providers and tells you some rudimentary information about them.

brokerDictExists :: Broker -> String -> IO Bool Source #

Tells if a dictionary exists or not, using a non-empty tags.

brokerFree :: Broker -> IO () Source #

Frees a broker resource with all its dictionaries.

brokerFreeDict :: Broker -> Dict -> IO () Source #

Frees a dictionary resource.

brokerGetError :: Broker -> IO String Source #

Returns the last error which occurred in this broker.

brokerInit :: IO Broker Source #

Creates a new broker object.

brokerListDicts :: Broker -> IO [Provider] Source #

Returns a list of available dictionaries with their details.

brokerRequestDict :: Broker -> String -> IO Dict Source #

Creates a new dictionary using tag, the non-empty language tag you wish to request a dictionary for ("en_US", "de_DE", ...)

brokerRequestPwlDict :: Broker -> String -> IO Dict Source #

Creates a dictionary using a PWL file. A PWL file is personal word file one word per line.

brokerSetOrdering :: Broker -> String -> String -> IO () Source #

brokerSetOrdering tag ordering declares a preference of dictionaries to use for the language described/referred to by tag. The ordering is a comma delimited list of provider names. As a special exception, the "*" tag can be used as a language tag to declare a default ordering for any language that does not explicitly declare an ordering.

type Dict = Ptr Dict' Source #

dictAdd :: Dict -> String -> IO () Source #

Adds a word to the given dictionary.

dictAddToSession :: Dict -> String -> IO () Source #

Adds a word to the given dictionary. It will be added only for the active spell-checking session.

dictCheck :: Dict -> String -> IO Bool Source #

Checks whether a word is correctly spelled or not.

dictDescribe :: Dict -> IO [Provider] Source #

Returns the details of the dictionary.

dictGetError :: Dict -> IO String Source #

Returns the last error of the current spelling-session.

dictIsAdded :: Dict -> String -> IO Bool Source #

Returns true if the word is added to the given dictionary.

dictIsRemoved :: Dict -> String -> IO Bool Source #

Returns true if the word is removed from the given dictionary.

dictRemove :: Dict -> String -> IO () Source #

Removes the word from the given dictionary.

dictRemoveFromSession :: Dict -> String -> IO () Source #

Removes the word from the given dictionary. It will be only removed from the active spell-checking session.

dictStoreReplacement :: Dict -> String -> String -> IO () Source #

dictStoreReplacement dict mis cor adds a correction for mis using cor.

Notes that you replaced mis with cor, so it's possibly more likely that future occurrences of mis will be replaced with cor. So it might bump cor up in the suggestion list.

dictSuggest :: Dict -> String -> IO [String] Source #

Return a list of suggestions if the word is bad spelled.

getVersion :: IO String Source #

Returns the Enchant version.

data Provider Source #

Information of the Enchant provider

Constructors

Provider 

Fields

withBroker :: (Broker -> IO a) -> IO a Source #

withBroker act opens a broker using brokerInit and passes the resulting broker to the computation act. The resource will be freed on exit from withBroker, whether by normal termination or by raising an exception.

withDict :: Broker -> String -> (Dict -> IO a) -> IO a Source #

withDict broker tag act opens a dict using brokerRequestDict and passes the resulting dict to the computation act. The resource will be freed on exit from withDict, whether by normal termination or by raising an exception.