Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void computeWordFrequencies() throws IOException{
- FileWriter fw = new FileWriter("alfaSorted.txt");
- String word = getWord();
- while(word!=null){
- if(alfaSort.containsKey(word)){
- alfaSort.put(word, alfaSort.get(word)+1);
- }else{
- alfaSort.put(word, 1);
- }
- word = getWord();
- }
- for(String w : alfaSort.keySet()){
- fw.write(w+"\t"+alfaSort.get(w)+"\n");
- }
- fw.flush();
- fw.close();
- // define!
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement