EssayTools - Maple Programming Help

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

EssayTools

 CountUseOfEachWord
 count the occurrences of individual words in an essay
 CountUseOfAllWords
 count the occurrences of a group of words in an essay

 Calling Sequence CountUseOfEachWord( essays, words ) CountUseOfAllWords( essays, words )

Parameters

 essays - set, list, or array of strings words - set, list, or array of strings

Description

 • The CountUseOfEachWord command looks for occurrences of words in essays.  The returned result will be a N x M array, where N is the number of essays, and M is the number of words.  The count at Result[i,j] will be the number of occurrences of word j in essay i.
 • The CountUseOfAllWords command looks for occurrences of words in essays.  The returned result will an array with N entries, where N matches the number of essays. The count at Result[i] will be the total number of occurrences of all the words found in the list specified by words.
 • Changes in capitalization are considered equal in the count. Changes of word form such as pluralization are not considered in the count.
 • This function is part of the EssayTools package, so it can be used in the short form SimilarityScore(..) only after executing the command with(EssayTools). However, it can always be accessed through the long form of the command by using EssayTools[SimilarityScore](..).

Examples

 > $\mathrm{with}\left(\mathrm{EssayTools}\right)$
 $\left[{\mathrm{AppendToWordList}}{,}{\mathrm{BinaryCosineCoefficient}}{,}{\mathrm{BinaryDiceCoefficient}}{,}{\mathrm{BinaryJaccardCoefficient}}{,}{\mathrm{BuildScoreModel}}{,}{\mathrm{CosineCoefficient}}{,}{\mathrm{CountMisspellings}}{,}{\mathrm{CountUseOfAllWords}}{,}{\mathrm{CountUseOfEachWord}}{,}{\mathrm{DetectPlagiarism}}{,}{\mathrm{DiceCoefficient}}{,}{\mathrm{GetWordList}}{,}{\mathrm{GetWordTable}}{,}{\mathrm{IsAdjective}}{,}{\mathrm{IsAdverb}}{,}{\mathrm{IsConjunction}}{,}{\mathrm{IsDefiniteArticle}}{,}{\mathrm{IsIndefiniteArticle}}{,}{\mathrm{IsInterjection}}{,}{\mathrm{IsIntransitiveVerb}}{,}{\mathrm{IsNominative}}{,}{\mathrm{IsNoun}}{,}{\mathrm{IsNounPhrase}}{,}{\mathrm{IsPlural}}{,}{\mathrm{IsPreposition}}{,}{\mathrm{IsPronoun}}{,}{\mathrm{IsTransitiveVerb}}{,}{\mathrm{IsUsuallyParticipleVerb}}{,}{\mathrm{IsVerb}}{,}{\mathrm{JaccardCoefficient}}{,}{\mathrm{Lemma}}{,}{\mathrm{Misspellings}}{,}{\mathrm{PartOfSpeech}}{,}{\mathrm{QuadraticWeightedKappa}}{,}{\mathrm{Reduce}}{,}{\mathrm{Score}}{,}{\mathrm{SetWordList}}{,}{\mathrm{SimilarityScore}}{,}{\mathrm{SpellCorrectWord}}{,}{\mathrm{WordUse}}\right]$ (1)
 > $\mathrm{CountUseOfEachWord}\left(\left["a a b b c c","a a a c"\right],\left["a","b","c"\right]\right)$
 $\left[\begin{array}{rrr}{2}& {2}& {2}\\ {3}& {0}& {1}\end{array}\right]$ (2)
 > $\mathrm{CountUseOfAllWords}\left(\left["a a b b c c","a a a c"\right],\left["a","b","c"\right]\right)$
 $\left[\begin{array}{cc}{3}& {2}\end{array}\right]$ (3)
 > $\mathrm{Hemingway}≔"Nothing happened. The fish just moved away slowly and the old man could not raise him an inch. His line was strong and made for heavy fish and he held it against his hack until it was so taut that beads of water were jumping from it. Then it began to make a slow hissing sound in the water and he still held it, bracing himself against the thwart and leaning back against the pull. The boat began to move slowly off toward the north-west.":$
 > $\mathrm{CountUseOfEachWord}\left(\left[\mathrm{Hemingway}\right],\left["fish","the","old","brace"\right]\right)$
 $\left[\begin{array}{rrrr}{2}& {7}& {1}& {0}\end{array}\right]$ (4)
 > $\mathrm{CountUseOfEachWord}\left(\mathrm{map}\left(\mathrm{StringTools}:-\mathrm{LowerCase},\left[\mathrm{Hemingway}\right]\right),\left["fish","the","old","brace"\right]\right)$
 $\left[\begin{array}{rrrr}{2}& {7}& {1}& {0}\end{array}\right]$ (5)