Re: Count Ouccrence of words in a long text
- To: mathgroup at smc.vnet.net
- Subject: [mg119081] Re: Count Ouccrence of words in a long text
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Sat, 21 May 2011 06:48:28 -0400 (EDT)
On 5/20/11 at 6:34 AM, readhpr at 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.