int numBuiltInTerminals = 4;
@Test
public void basicVocabTest() {
Vocabulary vocab1 = new Vocabulary();
Vocabulary vocab2 = new Vocabulary(new HashSet<String>());
Assert.assertEquals(vocab1, vocab2);
Assert.assertFalse(vocab1.intToString.isEmpty());
// Assert.assertTrue(vocab1.intToString.get(0)==Vocabulary.UNKNOWN_WORD_STRING);
Assert.assertFalse(vocab1.getWords().isEmpty());
Assert.assertTrue(vocab1.getWord(0)==Vocabulary.UNKNOWN_WORD_STRING);
Assert.assertEquals(vocab1.getWords(), vocab1.intToString.values());
Assert.assertEquals(vocab1.size(), numBuiltInSymbols);
Assert.assertEquals(vocab1.getWord(Vocabulary.UNKNOWN_WORD), Vocabulary.UNKNOWN_WORD_STRING);
//Assert.assertEquals(vocab1.getID("sample"), Vocabulary.UNKNOWN_WORD);
//Assert.assertEquals(vocab1.getID(null), Vocabulary.UNKNOWN_WORD);
Assert.assertFalse(vocab1.terminalToInt.isEmpty());
Assert.assertEquals(vocab1.terminalToInt.size(), this.numBuiltInTerminals);
// Assert.assertFalse(vocab1.isFixed);
//
// vocab1.fixVocabulary();
// Assert.assertTrue(vocab1.isFixed);
Assert.assertEquals(vocab1.getID(SymbolTable.X_STRING), -1);
Assert.assertEquals(vocab1.getID(SymbolTable.X1_STRING), -2);
Assert.assertEquals(vocab1.getID(SymbolTable.X2_STRING), -3);
Assert.assertEquals(vocab1.getWord(-1), SymbolTable.X_STRING);
Assert.assertEquals(vocab1.getWord(-2), SymbolTable.X1_STRING);
Assert.assertEquals(vocab1.getWord(-3), SymbolTable.X2_STRING);
Assert.assertFalse(vocab2.intToString.isEmpty());
// Assert.assertTrue(vocab2.intToString.get(0)==Vocabulary.UNKNOWN_WORD_STRING);
Assert.assertFalse(vocab2.getWords().isEmpty());
// Assert.assertTrue(vocab2.getWord(0)==Vocabulary.UNKNOWN_WORD_STRING);
Assert.assertEquals(vocab2.getWords(), vocab2.intToString.values());
Assert.assertEquals(vocab2.size(), numBuiltInSymbols);
Assert.assertEquals(vocab2.getWord(Vocabulary.UNKNOWN_WORD), Vocabulary.UNKNOWN_WORD_STRING);
// Assert.assertEquals(vocab2.getID("sample"), Vocabulary.UNKNOWN_WORD);
// Assert.assertEquals(vocab2.getID(null), Vocabulary.UNKNOWN_WORD);
Assert.assertFalse(vocab2.terminalToInt.isEmpty());