Verbalizer { public Action verbalize(Interpretation interpretation){ interpretation = verbalizeDates(interpretation); switch(interpretation.getSentenceType()){ case GREETING: return greet(interpretation); case SEGUE: return segue(interpretation); case ANECDOTE: return anecdote(interpretation); default: return literalSentence(interpretation); } }  Action verbalize(Interpretation interpretation); static final RandomList<String> roboyNames; static final RandomList<String> consent; static final RandomList<String> denial; static final RandomList<String> triggers; static final RandomList<String> greetings; static final RandomList<String> farewells; static final RandomList<String> startSomething; static final RandomList<String> userIsSure; static final RandomList<String> userProbablyYes; static final RandomList<String> userIsUncertain; static final RandomList<String> userProbablyNo; static final RandomList<String> userSaysNo; static final RandomList<String> roboyNotUnderstand; static final RandomList<String> rosDisconnect; }
@Test public void testDates() { Verbalizer verbalizer = new Verbalizer(); SpeechAction action = (SpeechAction) verbalizer.verbalize(new Interpretation("0666-01-01")); assertEquals("January first six hundred sixty six",action.getText()); action = (SpeechAction) verbalizer.verbalize(new Interpretation("2010-12-31")); assertEquals("December thirty first two thousand ten",action.getText()); action = (SpeechAction) verbalizer.verbalize(new Interpretation("1040-09-13")); assertEquals("September thirteenth one thousand forty",action.getText()); action = (SpeechAction) verbalizer.verbalize(new Interpretation("2300-07-28")); assertEquals("July twenty eighth two thousand three hundred",action.getText()); action = (SpeechAction) verbalizer.verbalize(new Interpretation("1604-04-04")); assertEquals("April fourth sixteen hundred four",action.getText()); }