correct the spelling of a given word - Maple Help

Online Help

All Products    Maple    MapleSim


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

EssayTools[SpellCorrectWord] - correct the spelling of a given word

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 can't find a close match it will return the given word, otherwise the word returned will be from the internal WordList or from the word-list 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 WordList.  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,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)

sentence:=It is rahter dangeros to automagically appli corections

sentence:=It is rahter dangeros to automagically appli corections

(5)

mwords:=Misspellingssentence

mwords:=rahter,dangeros,automagically,appli,corections

(6)

corrections:=seqw=SpellCorrectWordw,w∈mwords

corrections:=rahter=rafter,dangeros=dangers,automagically=automatically,appli=apple,corections=corrections

(7)

forcincorrectionsdosentence:=StringTools:-SubstituteAllsentence,lhsc,rhsc;printsentenceend do:

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)

See Also

EssayTools, EssayTools[Lemma], StringTools


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam