Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import chn.util.*;
- import java.util.*;
- /**
- * Write a description of class CountDriver here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class CountDriver
- {
- /**
- * Constructor for objects of class CountDriver
- */
- public CountDriver()
- {
- }
- /**
- * main() method to start running code
- *
- *
- */
- public static void main(String[] args)
- {
- int totalWords = 0;
- Word uniqueWord;
- String temp = "";
- FileInput inFile = new FileInput("dream.txt", " !~@#$%^&*()_+=|\\{}\"[]<>.,?/;:\t\n\r\f0123456789");
- ArrayList words = new (Word)ArrayList();
- while(inFile.hasMoreTokens())
- {
- temp = inFile.readToken();
- }
- }
- }
- public class Word
- {
- private int occurence=1;
- private String myWord = "";
- /**
- * Constructor
- */
- public Word(String word)
- {
- myWord = word;
- }
- public int getOccur()
- {
- return occurence;
- }
- public String getWord()
- {
- return myWord;
- }
- public void increment()
- {
- occurence++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment