addCorrection {Aspell}R Documentation

Add words to spelling dictionary

Description

These functions provide facilities to add words to the speller's dictionary. addCorrection specifies the corrected version of a “word” so that it can be used as a possible suggestion in the future.

addToList allows the caller to augment the existing dictionary, either for this session or in the personal dictionary.

Usage

addCorrection(speller, ..., .words, .pairs)
addToList(words, speller, session = TRUE)

Arguments

... a named collection of words. The names are the mistakes and the associated values are the desired corrections.
.words a named character vector of words. This is provided for programmatic access to this function and mirrors the values specified in ....
words a character vector whose elements are to be added to the list of acceptable (correctly spelled) words.
.pairs a character vector that allows the caller to specify the mis-spelled/correct word pairs directly as a character vector without having to arrange them into a named character vector of correct words. This should have even length or an error will be generated. The elements are incorrect followed by correct pairs of words.
speller the AspellSpeller-class object which represents the speller and it state.
session a logical value. TRUE indicates that the words should be added to the session dictionary. Alternatively, FALSE means that they should be stored in the personal dictionary. These will not be saved for future sessions unless a command is explicitly given. See saveWordLists.

Details

These call aspell_add_to_personal aspell_add_to_session and aspell_speller_store_replacement.

Value

An integer vector with as many elements as there are words.

Author(s)

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

References

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

See Also

getSpeller aspell

Examples


 sp = getSpeller()

  # The 3 calls are equivalent, but provide different
  # interfaces.
 addCorrection(sp, "duncn" = "duncan")
 addCorrection(sp, .words = c(duncn = "duncan"))
 addCorrection(sp, .pairs = c("duncn", "duncan"))

[Package Aspell version 0.2-0 Index]