Interface to GNU Aspell
(require aspell) | package: aspell |
Provides an interface to GNU ASpell for spell-checking text from your programs. The aspell program must be present in your path, or a path to it explicitly provided.
1 Using aspell
1.1 Controlling aspell
procedure
(open-aspell [ #:aspell-path aspell-path #:dict dict #:personal-dict personal-dict #:dict-dir dict-dir #:lang lang #:mode mode #:ignore-case ignore-case]) β aspell? aspell-path : path-string? = (aspell-executable-path) dict : (or/c string? #f) = #f personal-dict : (or/c path-string? #f) = #f dict-dir : (or/c path-string? #f) = #f lang : (or/c string? #f) = #f mode : (or/c symbol? #f) = #f ignore-case : boolean? = #f
aspell dump modes from a command line will give the possible values for the #:mode option.
procedure
(close-aspell speller) β void?
speller : aspell?
value
1.2 Spell checking
procedure
(aspell-check speller text) β list?
speller : aspell? text : string?
Care must be taken that any single line isnβt larger than your systemβs pipe buffer space.
1.3 Dictionaries
In addition to the master dictionary, aspell supports personal dictionaries and a temporary session dictionary of accepted words. The personal dictionary can include suggested replacment words for given misspellings, or just words to accept as correctly spelled.
procedure
(aspell-add-word speller word [dict]) β void?
speller : aspell? word : string? dict : (or/c string? 'personal 'session) = 'session
procedure
(aspell-get-dictionary speller dict) β (listof string?)
speller : aspell? dict : (or/c 'personal 'session)
procedure
(aspell-save-dictionary speller) β void?
speller : aspell?
1.4 Other functions
procedure
(aspell-active? speller) β boolean?
speller : aspell?
procedure
(aspell-language speller) β string?
speller : aspell?
2 Using other spell checkers
While this module is intended primarly for use with aspell, it can work with other spell checkers that have a compatible command line interface - the traditional ispell and hunspell are also supported, albeit with reduced functionality. To use them, set the aspell-compatibility-mode parameter and pass the appropriate :aspell-path argument to open-aspell or set aspell-executable-path.
parameter
(aspell-executable-path) β (or/c path-string? #f)
(aspell-executable-path aspell-path) β void? aspell-path : (or/c path-string? #f)
= (find-executable-path "aspell")
parameter
(aspell-compatibility-mode) β (or/c 'aspell 'ispell 'hunspell)
(aspell-compatibility-mode mode) β void? mode : (or/c 'aspell 'ispell 'hunspell)
= 'aspell