Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #2424 > unrolled thread
| Started by | Yako <yako@11y11.com> |
|---|---|
| First post | 2011-05-17 11:47 +0000 |
| Last post | 2011-05-18 11:18 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Count Ouccrence of words in a long text Yako <yako@11y11.com> - 2011-05-17 11:47 +0000
Re: Count Ouccrence of words in a long text Albert Retey <awnl@gmx-topmail.de> - 2011-05-18 11:18 +0000
| From | Yako <yako@11y11.com> |
|---|---|
| Date | 2011-05-17 11:47 +0000 |
| Subject | Count Ouccrence of words in a long text |
| Message-ID | <iqtn8n$ilc$1@smc.vnet.net> |
Hello, First of all I am pretty new to Mathematica, so excuse me if this has a simple answer. What I need is to be able to count the occurrence of each word of a text and count the times each word appears on it. I know how to do this on other languages but I am trying to achieve it with mathematica. Can someone hint me the way to go? Thanks!
[toc] | [next] | [standalone]
| From | Albert Retey <awnl@gmx-topmail.de> |
|---|---|
| Date | 2011-05-18 11:18 +0000 |
| Message-ID | <ir09up$25b$1@smc.vnet.net> |
| In reply to | #2424 |
Hi, > First of all I am pretty new to Mathematica, so excuse me if this has > a simple answer. > > What I need is to be able to count the occurrence of each word of a > text and count the times each word appears on it. I know how to do > this on other languages but I am trying to achieve it with > mathematica. > > Can someone hint me the way to go? I think there might be languages that are better suited for this kind of tasks, especially if the text becomes _really_ long. Anyway, it is fairly easy in Mathematica and resonable fast, too: text = Import["ExampleData/USConstitution.txt"]; words = StringCases[text, WordCharacter ..]; Tally[words] hth, albert
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web