@Test public void testScanNgramSet() { voc.scanNgramSet(ngc.getNgrams()); assertEquals(12, voc.getSize()); assertTrue(voc.contains("amour")); assertTrue(voc.contains("AmOuR")); assertFalse(voc.contains("enfant")); }
@Test public void testWriteVocabularyFile() { voc.scanNgramSet(ngc.getNgrams()); voc.writeVocabularyFile("voc/fr-sample.vocab"); }
@Before public void init() { ngc = new MyNgramCounts(); ngc.readNgramCountsFile("lm/trigram-sample-train-fr.lm"); voc = new MyVocabulary(); }