@Test public void testToDictionary() throws Exception { NGramModel ngramModel = new NGramModel(); StringList tokens = new StringList("the", "brown", "fox", "jumped"); ngramModel.add(tokens, 1, 3); tokens = new StringList("the", "brown", "Fox", "jumped"); ngramModel.add(tokens, 1, 3); Dictionary dictionary = ngramModel.toDictionary(); Assert.assertNotNull(dictionary); Assert.assertEquals(9, dictionary.size()); Assert.assertEquals(1, dictionary.getMinTokenCount()); Assert.assertEquals(3, dictionary.getMaxTokenCount()); }
public Dictionary toDictionary() { return toDictionary(false); }
NGramModel implements Iterable<StringList> { public Dictionary toDictionary() { return toDictionary(false); } }
NGramModel implements Iterable<StringList> { public Dictionary toDictionary() { return toDictionary(false); } NGramModel();  NGramModel(InputStream in); }
NGramModel implements Iterable<StringList> { public Dictionary toDictionary() { return toDictionary(false); } NGramModel();  NGramModel(InputStream in); int getCount(StringList ngram); void setCount(StringList ngram, int count); void add(StringList ngram); void add(StringList ngram, int minLength, int maxLength); void add(CharSequence chars, int minLength, int maxLength); void remove(StringList tokens); boolean contains(StringList tokens); int size(); @Override Iterator<StringList> iterator(); int numberOfGrams(); void cutoff(int cutoffUnder, int cutoffOver); Dictionary toDictionary(); Dictionary toDictionary(boolean caseSensitive); void serialize(OutputStream out); @Override boolean equals(Object obj); @Override String toString(); @Override int hashCode(); }
NGramModel implements Iterable<StringList> { public Dictionary toDictionary() { return toDictionary(false); } NGramModel();  NGramModel(InputStream in); int getCount(StringList ngram); void setCount(StringList ngram, int count); void add(StringList ngram); void add(StringList ngram, int minLength, int maxLength); void add(CharSequence chars, int minLength, int maxLength); void remove(StringList tokens); boolean contains(StringList tokens); int size(); @Override Iterator<StringList> iterator(); int numberOfGrams(); void cutoff(int cutoffUnder, int cutoffOver); Dictionary toDictionary(); Dictionary toDictionary(boolean caseSensitive); void serialize(OutputStream out); @Override boolean equals(Object obj); @Override String toString(); @Override int hashCode();  }