List of usage examples for opennlp.tools.ngram NGramModel toDictionary
public Dictionary toDictionary(boolean caseSensitive)
From source file:opennlp.tools.ngram.NGramModelTest.java
@Test public void testToDictionary1() throws Exception { NGramModel ngramModel = new NGramModel(); StringList tokens = new StringList("the", "brown", "fox", "jumped"); ngramModel.add(tokens, 1, 3);//from ww w .j a v a 2s . c om tokens = new StringList("the", "brown", "Fox", "jumped"); ngramModel.add(tokens, 1, 3); Dictionary dictionary = ngramModel.toDictionary(true); Assert.assertNotNull(dictionary); Assert.assertEquals(14, dictionary.size()); Assert.assertEquals(1, dictionary.getMinTokenCount()); Assert.assertEquals(3, dictionary.getMaxTokenCount()); }