/* author: Christopher O'Neill date: Feb 2001 comments: removes duplicates of words in a file*/ import java.io.*; import java.lang.*; import java.util.*; public class Deduplicate { /**************************************************************** *Method: Deduplicate * *Returns: String * *Recievs: String str * *Purpose: remove all duplicates of words then write to * * new file * ****************************************************************/ public static void main(String args[] ) { Vector words = new Vector(); boolean newword; String text; String word; StringTokenizer line = new StringTokenizer(""); try { FileReader fr = new FileReader(args[0]); BufferedReader br = new BufferedReader(fr); while ((text=br.readLine())!= null) { line= new StringTokenizer(text); while (line.hasMoreTokens()) { word = new String(); word = line.nextToken(); newword=true; for (int i=0; i