SpellCorrectWord - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Education : EssayTools : SpellCorrectWord

EssayTools

  

SpellCorrectWord

  

correct the spelling of a given word

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

SpellCorrectWord( word )

SpellCorrectWord( word, wordlist )

Parameters

word

-

string

wordlist

-

(optional) ordered list or array of strings

Description

• 

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](..).

Examples

withEssayTools

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

(1)

SpellCorrectWordsnak

sank

(2)

SpellCorrectWordsnak,animal,river,snake

snake

(3)

SpellCorrectWordnothingclose

nothingclose

(4)

sentenceIt is rahter dangeros to automagically appli corections

sentenceIt is rahter dangeros to automagically appli corections

(5)

mwordsMisspellingssentence

mwordsrahter,dangeros,automagically,appli,corections

(6)

correctionsseqw=SpellCorrectWordw,winmwords

correctionsrahter=rafter,dangeros=dangers,automagically=automatically,appli=apple,corections=corrections

(7)

forcincorrectionsdosentenceStringTools:-SubstituteAllsentence,lhsc,rhsc;printsentenceenddo:

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

(8)

sentence

It is rafter dangers to automatically apple corrections

(9)

Compatibility

• 

The EssayTools[SpellCorrectWord] command was introduced in Maple 17.

• 

For more information on Maple 17 changes, see Updates in Maple 17.

See Also

EssayTools

EssayTools[AppendToWordList]

EssayTools[Lemma]

StringTools