This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes java exercise help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java exercise help" Watch "java exercise help" New topic
Author

java exercise help

henry dias
Greenhorn

Joined: Mar 22, 2011
Posts: 2
Find the 10 most common and 10 least common words in the textfile.
Find the 10 most common and 10 least common bigrams in the file. (A bigram is two words following each other in the text. (F.ex. "The red fox" contains 2 bigrams: "The red" and "red fox". - See http://en.wikipedia.org/wiki/Bigram) )
Find the longest phrase that also appears at least twice.
("longest phrase" here means the number of words, NOT letters)



Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18508
    
  40


Please tell us what you have done so far. Please tell us *exactly* what issue you are running into. We can't help you if we don't know where you are stuck.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
henry dias
Greenhorn

Joined: Mar 22, 2011
Posts: 2
The issue i am facing is for correct regexp

i am getting words as citizen. citzen, and citizen; i want to remove the , . ; after words and then check for thier repetition in file .


Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19651
    
  18

Please UseCodeTags next time. I've added them for you this time.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37937
    
  22
Welcome to the Ranch

I do not think a regular expression will help you at all. Go through the Java™ Tutorials Collections section and you will find a counting application example.
 
Don't get me started about those stupid light bulbs.
 
subject: java exercise help
 
Similar Threads
Comparing two Strings
The story behind "Foo" and "Bar"..
longest word
A good way to count a specifed word?
Query does not work