List of usage examples for opennlp.tools.ngram NGramModel contains
public boolean contains(StringList tokens)
From source file:opennlp.tools.ngram.NGramModelTest.java
@Test public void testContains() throws Exception { NGramModel ngramModel = new NGramModel(); StringList tokens = new StringList("the", "bro", "wn"); ngramModel.add(tokens);/*from w w w. j av a 2 s . c om*/ Assert.assertFalse(ngramModel.contains(new StringList("the"))); }
From source file:opennlp.tools.ngram.NGramModelTest.java
@Test public void testContains2() throws Exception { NGramModel ngramModel = new NGramModel(); StringList tokens = new StringList("the", "bro", "wn"); ngramModel.add(tokens, 1, 3);//from www .j a v a 2 s. c o m Assert.assertTrue(ngramModel.contains(new StringList("the"))); }