Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2565

Re: Count Ouccrence of words in a long text

From Bill Rowe <readnews@sbcglobal.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Count Ouccrence of words in a long text
Date 2011-05-21 10:48 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <ir859f$bfr$1@smc.vnet.net> (permalink)

Show all headers | View raw


On 5/20/11 at 6:34 AM, readhpr@gmail.com (Helen Read) wrote:

>On 5/19/2011 7:43 AM, Matthias Bode wrote:

>>How could I take apart the words ("alice" should become
>>"a,l,i,c,e") to get a tally of the letters in a text?
>(Interesting when comparing languages.)

>Characters[text]

>where text is a string.

For arbitrary text, this probably isn't what is wanted since it
would return all characters not just letters. Better might be:

StringCases[ToLowerCase[text], CharacterRange["a", "z"]]

which would only return letters.

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Count Ouccrence of words in a long text Bill Rowe <readnews@sbcglobal.net> - 2011-05-21 10:48 +0000

csiph-web