getSpeller {Aspell} | R Documentation |
To check the spelling of a word, one needs a speller instance. A speller instance has information about which dictionaries to use, what filters to apply to eliminate words, what suggestsions to make for misspelled words, etc. Each speller instance is independent of the others and this allows one to use separate spellers for each document or reuse an existing speller for multiple documents. This function returns an opaque reference to the C-level speller instance.
getSpeller(conf = createSpellConfig(), class = "AspellSpeller")
conf |
the configuration object to use for this speller. As with spellers, one might create a single configuration and reuse it to create multiple spellers. |
class |
the name of the class that is instantiated with the
external pointer inserted into its ref slot.
This allows the caller to create different classes of objects
easily rather than by coercion after the creation. |
An object of class AspellSpeller-class
.
Duncan Temple Lang <duncan@wald.ucdavis.edu>
aspell
getSpellConfig
createSpellConfig
speller = getSpeller() words = unlist(strsplit(as.character(packageDescription("Aspell")), "[[:space:][:punct:]]")) words = unique(words[words != ""]) check = aspell(words, FALSE, speller = speller) # proportion of words spelled correctly sum(check)/length(check) words[!check]