aspell-pipe-0.4: Pipe-based interface to the Aspell program

Safe HaskellSafe
LanguageHaskell2010

Text.Aspell

Description

A pipe-based interface to Aspell.

This interface is beneficial when dynamic linking against the Aspell library would be undesirable, e.g., for binary portability reasons.

This implementation is based on the description of the Aspell pipe protocol at

http://aspell.net/man-html/Through-A-Pipe.html

Synopsis

Documentation

data Aspell Source #

A handle to a running Aspell instance.

Instances
Show Aspell Source # 
Instance details

Defined in Text.Aspell

Methods

showsPrec :: Int -> Aspell -> ShowS

show :: Aspell -> String

showList :: [Aspell] -> ShowS

data AspellResponse Source #

The kind of responses we can get from Aspell.

Constructors

AllCorrect

The input had no spelling mistakes.

Mistakes [Mistake]

The input had the specified mistakes.

Instances
Eq AspellResponse Source # 
Instance details

Defined in Text.Aspell

Show AspellResponse Source # 
Instance details

Defined in Text.Aspell

Methods

showsPrec :: Int -> AspellResponse -> ShowS

show :: AspellResponse -> String

showList :: [AspellResponse] -> ShowS

data Mistake Source #

A spelling mistake.

Constructors

Mistake 

Fields

  • mistakeWord :: Text

    The original word in misspelled form.

  • mistakeNearMisses :: Int

    The number of alternative correct spellings that were counted.

  • mistakeOffset :: Int

    The offset, starting at zero, in the original input where this misspelling occurred.

  • mistakeAlternatives :: [Text]

    The correct spelling alternatives.

Instances
Eq Mistake Source # 
Instance details

Defined in Text.Aspell

Methods

(==) :: Mistake -> Mistake -> Bool

(/=) :: Mistake -> Mistake -> Bool

Show Mistake Source # 
Instance details

Defined in Text.Aspell

Methods

showsPrec :: Int -> Mistake -> ShowS

show :: Mistake -> String

showList :: [Mistake] -> ShowS

data AspellOption Source #

An Aspell option.

Constructors

UseDictionary Text

Use the specified dictionary (see aspell -d).

Instances
Eq AspellOption Source # 
Instance details

Defined in Text.Aspell

Methods

(==) :: AspellOption -> AspellOption -> Bool

(/=) :: AspellOption -> AspellOption -> Bool

Show AspellOption Source # 
Instance details

Defined in Text.Aspell

Methods

showsPrec :: Int -> AspellOption -> ShowS

show :: AspellOption -> String

showList :: [AspellOption] -> ShowS

startAspell :: [AspellOption] -> IO (Either String Aspell) Source #

Start Aspell with the specified options. Returns either an error message on failure or an Aspell handle on success.

stopAspell :: Aspell -> IO () Source #

Stop a running Aspell instance.

askAspell :: Aspell -> Text -> IO [AspellResponse] Source #

Submit user input to Aspell for spell-checking. Returns an AspellResponse for each line of user input.

aspellIdentification :: Aspell -> Text Source #

startup-reported version string

aspellDictionaries :: IO (Either String [Text]) Source #

Obtain the list of installed Aspell dictionaries.