*/
@Test
public final void testParsing() {
final ExpressionMatcher matcher = new ExpressionMatcher();
Sentence sentence = matcher.parseSentence("", new ConversationContext());
assertFalse(sentence.hasError());
assertEquals("", sentence.toString());
String str = matcher.readMatchingFlags("Lazy dog");
assertEquals("Lazy dog", str);
assertTrue(matcher.isEmpty());
assertEquals("", matcher.toString());
sentence = matcher.parseSentence(str, new ConversationContext());
assertFalse(sentence.hasError());
assertEquals("lazy dog/SUB-ANI", sentence.toString());
str = matcher.readMatchingFlags("|TYPE|abcdef/OBJ");
assertEquals("abcdef/OBJ", str);
assertTrue(matcher.isAnyFlagSet());
assertFalse(matcher.getExactMatching());
assertTrue(matcher.getTypeMatching());
assertEquals("|TYPE", matcher.toString());
sentence = matcher.parseSentence(str, new ConversationContext());
assertFalse(sentence.hasError());
assertEquals("|TYPE|abcdef/OBJ", sentence.toString());
str = matcher.readMatchingFlags("|EXACT|Hello world!");
assertEquals("Hello world!", str);
assertTrue(matcher.isAnyFlagSet());
assertTrue(matcher.getExactMatching());
assertFalse(matcher.getTypeMatching());
assertEquals("|EXACT", matcher.toString());
sentence = matcher.parseSentence(str, new ConversationContext());
assertFalse(sentence.hasError());
assertEquals("|EXACT|Hello world!", sentence.toString());
}