aspell {Aspell}R Documentation

Check the spelling of one or more words

Description

This is a function that checks the spelling of one or more words using the aspell library. The simple form merely returns a logical value for each of the words indicating whether it is considered to be spelled correctly. If suggests is TRUE, a collection of possible alternative correct words are returned for each word that is potentially misspelled.

The methods for this generic function provide facilities for processing an entire document.

Usage

aspell(words, suggests = FALSE, speller = getSpeller())

Arguments

words a character vector giving the words as elements
suggests a logical value indicating whether to return alternative spellings for each word, or if FALSE, merely a logical vector indicating whether each word was misspelled or not.
speller the speller object of class AspellSpeller-class

Value

If suggests is true, a list whose elements parallel that of the initial collection of words being spelled. Each element in the list is a character vector containing suggested alternative spellings for the given word. A list is returned regardless of whether the word was actually spelled correctly. If it is correctly spelled, it will be the first word in the list (?).
If suggets is FALSE, a logical vector indicating whether the corresponding element of words was spelled correctly (TRUE) or not (FALSE).

Author(s)

Duncan Temple Lang <duncan@wald.ucdavis.edu>

References

http://aspell.sourceforge.net http://www.omegahat.org/Aspell

See Also

getSpeller

Examples


  aspell("foo", FALSE)

  aspell(c("coloer", "foo"), FALSE)

  # Get alternatives back.
  aspell(c("coloer", "foo"))


[Package Aspell version 0.2-0 Index]