EssayTools - Maple Programming Help

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

EssayTools

 WordUse
 find occurrences of individual words in one or more essays

 Calling Sequence WordUse( essays, options )

Parameters

 essays - set, list, or array of strings showcount = truefalse - (optional) truefalse mincount = posint - (optional) positive integer maxcount = posint - (optional) positive integer

Description

 • The WordUse command breaks the given essays into unique instances of the words contained therein.  All words are reduced to their lower-case equivalent.
 When no *count option is specified the order of entries in the returned list is unspecified.
 • If the option showcount = true is specified then the words are returned in equation form indicating the lower-case word followed by the number of occurrences of that word.  The returned list is sorted in order of most occurrences first.
 • If the option mincount = N is specified then only the words that occur at least N times are returned. The returned list is sorted in order of most occurrences first.
 • If the option maxcount = N is specified then only the words that occur no more than N times are returned. The returned list is sorted in order of most occurrences first.
 • This function is part of the EssayTools package, so it can be used in the short form WordUse(..) only after executing the command with(EssayTools). However, it can always be accessed through the long form of the command by using EssayTools[WordUse](..).

Examples

Example 1

 > $\mathrm{with}\left(\mathrm{EssayTools}\right):$

Find the unique occurrences of words in a list of essays

 > $\mathrm{Essays}≔\left["I like to use i and j.","And x and y too.","But I don\text{'}t like k and z."\right]:$
 > $\mathrm{sort}\left(\mathrm{WordUse}\left(\mathrm{Essays}\right)\right)$
 $\left[{"and"}{,}{"but"}{,}{"don\text{'}t"}{,}{"i"}{,}{"j"}{,}{"k"}{,}{"like"}{,}{"to"}{,}{"too"}{,}{"use"}{,}{"x"}{,}{"y"}{,}{"z"}\right]$ (1)

Find all words used at least 2 times

 > $\mathrm{WordUse}\left(\mathrm{Essays},'\mathrm{mincount}'=2\right)$
 $\left[{"and"}{,}{"i"}{,}{"like"}\right]$ (2)

Find all words used at least 2 times and show how many times each was used

 > $\mathrm{WordUse}\left(\mathrm{Essays},'\mathrm{mincount}'=2,'\mathrm{showcount}'\right)$
 $\left[{"and"}{=}{4}{,}{"i"}{=}{3}{,}{"like"}{=}{2}\right]$ (3)

Example 2

 > $\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{WordUse}\left(\mathrm{Hemingway},'\mathrm{showcount}'=\mathrm{true},\mathrm{mincount}=3\right)$
 $\left[{"the"}{=}{7}{,}{"it"}{=}{5}{,}{"and"}{=}{5}{,}{"against"}{=}{3}\right]$ (4)

Compatibility

 • The EssayTools[WordUse] command was introduced in Maple 17.