correct: correct

Description Usage Arguments Details Value Author(s) Examples

View source: R/spellcheckr.R

Description

Correct the spelling of a given word in the english language.

Usage

1
correct(wd = NULL, maxedit = 2, dictionary = NULL)

Arguments

wd

Character. The word to be spell corrected.

maxedit

Integer. The maximum number of edits allowed to reach the correct word. Max allowed is 3.

dictionary

Character Vector of eligible words to be considered. Repeated words will get more weightage.

Details

This is based on Peter Norvig's spell correct algorithm http://norvig.com/spell.py. But this one is modified to handle upto three edits.

Value

The corrected word.

Author(s)

Selva Prabhakaran selva86@gmail.com

Examples

1
2
3
4
data(dict)
correct("scaret")
correct("beliebe")
sapply(c("audiance", "charaktar"), correct)

selva86/spellcheckr documentation built on May 29, 2019, 5:55 p.m.