@Test
public final void testGrammar() {
final ConversationContext ctx = new ConversationContext();
SentenceImplementation sentence = new SentenceImplementation(ctx, "The quick brown fox jumps over the lazy dog.");
ConversationParser parser = new ConversationParser(sentence);
sentence.parse(parser);
sentence.classifyWords(parser);
assertFalse(sentence.hasError());
assertEquals("quick/ADJ brown/ADJ-COL fox/SUB-ANI jump/VER over/PRE lazy/ADJ dog/SUB-ANI.",
sentence.toString());
sentence.mergeWords();
assertEquals("quick brown fox/SUB-ANI-COL jump/VER over/PRE lazy dog/SUB-ANI.", sentence.toString());
assertEquals(Sentence.SentenceType.STATEMENT, sentence.getType());
sentence = new SentenceImplementation(ctx, "does it fit");
parser = new ConversationParser(sentence);
sentence.parse(parser);
sentence.classifyWords(parser);
assertFalse(sentence.hasError());
assertEquals("do/VER it/OBJ-PRO fit/VER", sentence.toString());
assertEquals(Sentence.SentenceType.QUESTION, sentence.evaluateSentenceType());