DictionaryBasedSentenceTypeDetector implements Analyzer { @Override public Interpretation analyze(Interpretation interpretation) { List<String> tokens = interpretation.getTokens(); String[] posTags = interpretation.getPosTags(); if(interpretation.getSentenceType().equals(SentenceType.STATEMENT)){ SentenceType sentenceType = determineSentenceType(tokens, posTags); interpretation.setSentenceType(sentenceType); } return interpretation; }  @Override Interpretation analyze(Interpretation interpretation);  }
@Test public void testWhatIs() { Interpretation interpretation = new Interpretation("What is area code of Germany?"); interpretation = tokenizer.analyze(interpretation); interpretation = detector.analyze(interpretation); assertTrue(interpretation.getSentenceType() == SentenceType.WHAT); }