Message Boards Message Boards

0
|
3673 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

Stringcount

Posted 10 years ago

Hello guy, For ex. I use this code for find some word and code said me , how many time this word is in the text......but I want Know the most used word in the text...ok?

StringCount[Import["http://news.rice.edu/2014/08/07/rice-u-study-stock-prices-of-companies-that-use-the-same-underwriter-tend-to-move-together/"], "price", IgnoreCase -> True]

AM

Posted 10 years ago

Hi Antonio

Does this help?

file = Import[
  "http://news.rice.edu/2014/08/07/rice-u-study-stock-prices-of-
companies-that-use-the-same-underwriter-tend-to-move-together/"];
file1 = StringReplace[file, Whitespace -> " "];
nf = StringSplit[file1, WhitespaceCharacter]; tf = Tally[nf]; tff = 
 SortBy[tf, -#[[2]] &]

Paul.

POSTED BY: Paul Cleary
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract