List of usage examples for opennlp.tools.ngram NGramModel cutoff
public void cutoff(int cutoffUnder, int cutoffOver)
From source file:opennlp.tools.ngram.NGramModelTest.java
@Test public void testCutoff1() throws Exception { NGramModel ngramModel = new NGramModel(); StringList tokens = new StringList("the", "brown", "fox", "jumped"); ngramModel.add(tokens, 1, 3);// w w w .j a v a 2 s . co m ngramModel.cutoff(2, 4); Assert.assertEquals(0, ngramModel.size()); }
From source file:opennlp.tools.ngram.NGramModelTest.java
@Test public void testCutoff2() throws Exception { NGramModel ngramModel = new NGramModel(); StringList tokens = new StringList("the", "brown", "fox", "jumped"); ngramModel.add(tokens, 1, 3);/* w w w. j a va2 s. co m*/ ngramModel.cutoff(1, 3); Assert.assertEquals(9, ngramModel.size()); }