/**
* Tests for compound names.
*/
@Test
public final void testCompoundNames() {
final WordList wl = WordList.getInstance();
Sentence sentence = ConversationParser.parse("call Sherlock Holmes");
assertFalse(sentence.hasError());
assertEquals("call/VER sherlock/ holmes/SUB-NAM", sentence.toString());
assertEquals(3, sentence.getExpressions().size());
assertEquals("Holmes", sentence.getSubject(0).getOriginal());
sentence = ConversationParser.parse("listen Elvis Presley");
assertFalse(sentence.hasError());
assertEquals("listen/VER elvis presley/", sentence.toString());
assertEquals(2, sentence.getExpressions().size());
assertNull("There should be no recognized subject.", sentence.getSubject(0));
wl.registerSubjectName("Sherlock Holmes");
wl.registerSubjectName("John Watson");
wl.registerSubjectName("Professor Moriarty");
wl.registerSubjectName("Baby Herman");
wl.registerSubjectName("Lady Gaga");
wl.registerSubjectName("Elvis Presley");
sentence = ConversationParser.parse("call Sherlock Holmes");
assertFalse(sentence.hasError());
assertEquals("call/VER sherlock holmes/SUB-NAM-DYN", sentence.toString());
assertEquals(2, sentence.getExpressions().size());
assertEquals("Sherlock Holmes", sentence.getSubject(0).getOriginal());
sentence = ConversationParser.parse("call John Watson");
assertFalse(sentence.hasError());
assertEquals("call/VER john watson/SUB-NAM-DYN", sentence.toString());
assertEquals(2, sentence.getExpressions().size());
assertEquals("John Watson", sentence.getSubject(0).getOriginal());
sentence = ConversationParser.parse("call professor moriarty");
assertFalse(sentence.hasError());
assertEquals("call/VER professor moriarty/SUB-NAM-DYN", sentence.toString());
assertEquals(2, sentence.getExpressions().size());
assertEquals("professor moriarty", sentence.getSubject(0).getOriginal());
sentence = ConversationParser.parse("look for baby Herman");
assertFalse(sentence.hasError());
assertEquals("look/VER for/PRE baby herman/SUB-NAM-DYN", sentence.toString());
assertEquals(3, sentence.getExpressions().size());
assertEquals("baby herman", sentence.getSubject(0).getNormalized());
sentence = ConversationParser.parse("look for Lady Gaga");
assertFalse(sentence.hasError());
assertEquals("look/VER for/PRE lady gaga/SUB-NAM-DYN", sentence.toString());
assertEquals(3, sentence.getExpressions().size());
assertEquals("lady gaga", sentence.getSubject(0).getNormalized());
sentence = ConversationParser.parse("listen Elvis Presley");
assertFalse(sentence.hasError());
assertEquals("listen/VER elvis presley/SUB-NAM-DYN", sentence.toString());
assertEquals(2, sentence.getExpressions().size());
assertEquals("elvis presley", sentence.getSubject(0).getNormalized());
wl.unregisterSubjectName("Sherlock Holmes");
wl.unregisterSubjectName("John Watson");
wl.unregisterSubjectName("Professor Moriarty");
wl.unregisterSubjectName("Baby Herman");
wl.unregisterSubjectName("Lady Gaga");
wl.unregisterSubjectName("Elvis Presley");
}