@Test public void testAdd() throws Exception { NGramModel ngramModel = new NGramModel(); ngramModel.add(new StringList("the", "bro", "wn")); int count = ngramModel.getCount(new StringList("the")); Assert.assertEquals(0, count); Assert.assertEquals(1, ngramModel.size()); }
public void add(StringList ngram) { if (contains(ngram)) { setCount(ngram, getCount(ngram) + 1); } else { mNGrams.put(ngram, 1); } }
NGramModel implements Iterable<StringList> { public void add(StringList ngram) { if (contains(ngram)) { setCount(ngram, getCount(ngram) + 1); } else { mNGrams.put(ngram, 1); } } }
NGramModel implements Iterable<StringList> { public void add(StringList ngram) { if (contains(ngram)) { setCount(ngram, getCount(ngram) + 1); } else { mNGrams.put(ngram, 1); } } NGramModel();  NGramModel(InputStream in); }
NGramModel implements Iterable<StringList> { public void add(StringList ngram) { if (contains(ngram)) { setCount(ngram, getCount(ngram) + 1); } else { mNGrams.put(ngram, 1); } } 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 void add(StringList ngram) { if (contains(ngram)) { setCount(ngram, getCount(ngram) + 1); } else { mNGrams.put(ngram, 1); } } 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();  }