EssayTools
SpellCorrectWord
correct the spelling of a given word
Calling Sequence
Parameters
Description
Examples
Compatibility
SpellCorrectWord( word )
SpellCorrectWord( word, wordlist )
word
-
string
wordlist
(optional) ordered list or array of strings
The SpellCorrectWord command will try to return a word that closely matches the spelling of the given word. If it cannot find a close match it will return the given word; otherwise, the word returned will be from the internal word list or from the wordlist provided.
In many cases there are many candidates for a misspelled word that are equally good. This command picks the first of these candidates to be returned. Priority will be given to the first equal candidate found in the wordlist when provided.
The optional wordlist is a group of words that either extends the dictionary or provides context as to which words are likely to appear. For example, "snak" will normally be corrected to "sank", but if the context is a group of essays on wild animals in which the word "snake" frequently appears, an ordered list generated from those essays will lead to a more appropriate correction.
A near match is found if a single character deletion, character replacement, character insertion, or transposition of characters results in a word found in the internal word list. Matching when an optional short-list of words is provided is done by computing the Levenshtein distance between the given word to each word in the short-list, and returning the best match provided it is a sufficiently close match.
This function is part of the EssayTools package, so it can be used in the short form SpellCorrectWord(..) only after executing the command with(EssayTools). However, it can always be accessed through the long form of the command by using EssayTools[SpellCorrectWord](..).
with⁡EssayTools
AppendToWordList,BinaryCosineCoefficient,BinaryDiceCoefficient,BinaryJaccardCoefficient,BuildScoreModel,CosineCoefficient,CountMisspellings,CountUseOfAllWords,CountUseOfEachWord,DetectPlagiarism,DiceCoefficient,GetWordList,GetWordTable,IsAdjective,IsAdverb,IsConjunction,IsDefiniteArticle,IsIndefiniteArticle,IsInterjection,IsIntransitiveVerb,IsNominative,IsNoun,IsNounPhrase,IsPlural,IsPreposition,IsPronoun,IsTransitiveVerb,IsUsuallyParticipleVerb,IsVerb,JaccardCoefficient,Lemma,Misspellings,PartOfSpeech,QuadraticWeightedKappa,Reduce,Score,SetWordList,SimilarityScore,SpellCorrectWord,WordUse
SpellCorrectWord⁡snak
sank
SpellCorrectWord⁡snak,animal,river,snake
snake
SpellCorrectWord⁡nothingclose
nothingclose
sentence≔It is rahter dangeros to automagically appli corections
mwords≔Misspellings⁡sentence
mwords≔rahter,dangeros,automagically,appli,corections
corrections≔seq⁡w=SpellCorrectWord⁡w,winmwords
corrections≔rahter=rafter,dangeros=dangers,automagically=automatically,appli=apple,corections=corrections
forcincorrectionsdosentence≔StringTools:-SubstituteAll⁡sentence,lhs⁡c,rhs⁡c;print⁡sentenceenddo:
It is rafter dangeros to automagically appli corections
It is rafter dangers to automagically appli corections
It is rafter dangers to automatically appli corections
It is rafter dangers to automatically apple corections
It is rafter dangers to automatically apple corrections
sentence
The EssayTools[SpellCorrectWord] command was introduced in Maple 17.
For more information on Maple 17 changes, see Updates in Maple 17.
See Also
EssayTools[AppendToWordList]
EssayTools[Lemma]
StringTools
Download Help Document