package uniqifierorig; import java.util.HashSet; import java.util.Set; public class WordCollection { private Set words; public WordCollection() { words = new HashSet(); } // Breaks up the passed-in file into words, normalizes them using // WordNormalizer, then inserts the normalized word into its word map. public void BuildFromFile(String filename) { String contents = FileOpener.ReadFileToString(filename); WordNormalizer normalizer = new WordNormalizer(); for (String s : contents.split("\\s+")) { s = normalizer.Normalize(s); words.add(s); } } public Set GetWords() { return words; } }