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