• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Treemap and Hashmap

 
Peter Burke
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How would you go about removing all punctuation besides ones like this "my-o-my" and then count up all occurances of the every word and print it out.
Doin all this while reading in a file that has text it in from a speech.
Thanks!
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should look at classes like String, StringBuffer, StringTokenizer, InputStream, and FileReader. These should provide many of the methods you need to accomplish this task.

Let us know what you come up with. There will be plenty of people here that will help answer specific questions when you run into any problems. Please be sure to illustrate what you have tried so we can help you from there.

Keep Coding!

Layne
 
Peter Burke
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah yeah yeah, I know how to bring in the file and print it out, my problem is that I don't know how to edit the file once I have it stored away!
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Peter Burke:
I don't know how to edit the file once I have it stored away!


Hence Layne's recommendation to look at String, StringBuffer, and StringTokenizer.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and of course the regexp package...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic