public void addDoc(Document doc) { Hashtable<String, Boolean> alreadyAppreared = new Hashtable<>(); Vector<String> words = doc.words; for (int j = 0; j < words.size(); j++) { if (countRepsWithinDocs || (!alreadyAppreared.containsKey(words.elementAt(j)))) { addWord(words.elementAt(j)); alreadyAppreared.put(words.elementAt(j), true); } } }
public void addDoc(Document doc) { Hashtable<String, Boolean> alreadyAppreared = new Hashtable<>(); Vector<String> words = doc.words; for (int j = 0; j < words.size(); j++) { if (countRepsWithinDocs || (!alreadyAppreared.containsKey(words.elementAt(j)))) { addWord(words.elementAt(j)); alreadyAppreared.put(words.elementAt(j), true); } } }
public void addDoc(Document doc) { Hashtable<String, Boolean> alreadyAppreared = new Hashtable<>(); Vector<String> words = doc.words; for (int j = 0; j < words.size(); j++) { if (countRepsWithinDocs || (!alreadyAppreared.containsKey(words.elementAt(j)))) { addWord(words.elementAt(j)); alreadyAppreared.put(words.elementAt(j), true); } } }
public UnigramStatistics(String filename, FeatureMap map) { InFile in = new InFile(filename); Vector<String> tokens = in.readLineTokens("\n\t "); while (tokens != null) { for (int i = 0; i < tokens.size(); i++) if (map.wordToFid.containsKey(tokens.elementAt(i))) addWord(tokens.elementAt(i)); tokens = in.readLineTokens("\n\t "); } in.close(); }
public UnigramStatistics(String filename, FeatureMap map) { InFile in = new InFile(filename); Vector<String> tokens = in.readLineTokens("\n\t "); while (tokens != null) { for (int i = 0; i < tokens.size(); i++) if (map.wordToFid.containsKey(tokens.elementAt(i))) addWord(tokens.elementAt(i)); tokens = in.readLineTokens("\n\t "); } in.close(); }
public UnigramStatistics(String filename, FeatureMap map) { InFile in = new InFile(filename); Vector<String> tokens = in.readLineTokens("\n\t "); while (tokens != null) { for (int i = 0; i < tokens.size(); i++) if (map.wordToFid.containsKey(tokens.elementAt(i))) addWord(tokens.elementAt(i)); tokens = in.readLineTokens("\n\t "); } in.close(); }