test_class.declarator: tokenizer = new SimpleTokenizer()
test_class.modifier: private static final
test_class.original_string: private static final SimpleTokenizer tokenizer = new SimpleTokenizer();
test_class.type: SimpleTokenizer
test_class.var_name: tokenizer
test_class.declarator: pos = new OpenNLPPPOSTagger()
test_class.modifier: private static final
test_class.original_string: private static final OpenNLPPPOSTagger pos = new OpenNLPPPOSTagger();
test_class.type: OpenNLPPPOSTagger
test_class.var_name: pos
test_class.declarator: parser = new OpenNLPParser()
test_class.modifier: private static final
test_class.original_string: private static final OpenNLPParser parser = new OpenNLPParser();
test_class.type: OpenNLPParser
test_class.var_name: parser
test_class.declarator: answer = new AnswerAnalyzer()
test_class.modifier: private static final
test_class.original_string: private static final AnswerAnalyzer answer = new AnswerAnalyzer();
test_class.type: AnswerAnalyzer
test_class.var_name: answer
test_class.file: dialog/src/test/java/roboy/linguistics/sentenceanalysis/AnswerAnalyzerTest.java
test_class.identifier: AnswerAnalyzerTest
test_case.body: @Test
  	public void testOrigin() {
  		assertEquals("netherlands", analyze("Netherlands"));
  		assertEquals("india", analyze("I am from India"));
  		assertEquals("germany", analyze("I live in Germany"));
  		assertEquals("sweden", analyze("My home country is Sweden"));
  		assertEquals("garching", analyze("My home town is Garching"));
  		assertEquals("austria", analyze("I was born in Austria"));
  	}
test_case.class_method_signature: AnswerAnalyzerTest.testOrigin()
test_case.full_signature: @Test public void testOrigin()
test_case.identifier: testOrigin
test_case.invocations: assertEquals analyze assertEquals analyze assertEquals analyze assertEquals analyze assertEquals analyze assertEquals analyze
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testOrigin()
focal_class.declarator: logger = LogManager.getLogger()
focal_class.modifier: private final static
focal_class.original_string: private final static Logger logger = LogManager.getLogger();
focal_class.type: Logger
focal_class.var_name: logger
focal_class.file: dialog/src/main/java/roboy/linguistics/sentenceanalysis/AnswerAnalyzer.java
focal_class.identifier: AnswerAnalyzer
focal_class.interfaces: implements Analyzer
focal_class.class_method_signature: AnswerAnalyzer.analyze(Interpretation interpretation)
focal_class.full_signature: @Override public Interpretation analyze(Interpretation interpretation)
focal_class.identifier: analyze
focal_class.modifiers: @Override public
focal_class.parameters: (Interpretation interpretation)
focal_class.return: Interpretation
focal_class.signature: Interpretation analyze(Interpretation interpretation)
focal_method.body: @Override
  	public Interpretation analyze(Interpretation interpretation) {
  		
  		// case pas object answer
  		Map<SemanticRole, String> pas = interpretation.getPas();
  		if(pas.containsKey(SemanticRole.PREDICATE)
  				&& pas.containsKey(SemanticRole.LOCATION)){
  			String pp = pas.get(SemanticRole.LOCATION);
  			String pred = pas.get(SemanticRole.PREDICATE);
  			if(Linguistics.tobe.contains(pred)){
  				pred = "";
  			} else {
  				pred = pred + " ";
  			}
  			if(pp.contains(" ")){
  				pp = pp.substring(pp.indexOf(" ") + 1);
  			}
  			interpretation.setObjAnswer(pp.toLowerCase());
  			interpretation.setPredAnswer(pred + pp.toLowerCase());
  			return interpretation;
  
  		} else if(pas.containsKey(SemanticRole.PREDICATE)
  				&& pas.containsKey(SemanticRole.PATIENT)){
  			String pred = pas.get(SemanticRole.PREDICATE).toLowerCase();
  			if(Linguistics.tobe.contains(pred)){
  				pred = "";
  			} else {
  				pred = pred + " ";
  			}
  			String pat = pas.get(SemanticRole.PATIENT).toLowerCase();
  			interpretation.setObjAnswer(pat);
  			interpretation.setPredAnswer(pred + pat);
  			return interpretation;
  		}
  		
  		// check for last verb
  		int verbIndex = -1;
  		List<String> tokens = interpretation.getTokens();
  		String[] pos = interpretation.getPosTags();
  
  		if (pos != null) {
  			for(int i=0; i < pos.length; i++) {
  				if(pos[i] != null && pos[i].startsWith("V")) {
  					verbIndex = i;
  				}
  			}
  		} else {
  			logger.warn("POSTAGS missing but AnswerAnalyzer is used!");
  		}
  
  //		System.out.println("Verbindex="+verbIndex);
  		
  		// case one term answer
          if (tokens != null && !tokens.isEmpty()) {
              if(verbIndex == -1){
                  if (tokens.size() == 1) {
                      interpretation.setObjAnswer(tokens.get(0));
                      interpretation.setPredAnswer(tokens.get(0));
                      return interpretation;
                  }
              }
  		
              // case pas failed object answer
              StringBuilder answer = new StringBuilder("");
              StringBuilder answerPred = new StringBuilder("");
              for(int i = verbIndex; i < tokens.size(); i++){
                  if(i != verbIndex){
                      if(tokens.get(i) != null && !"me".equals(tokens.get(i).toLowerCase())){
                          if(answer.length() > 0) answer.append(' ');
                          if(Character.isLetterOrDigit(tokens.get(i).charAt(0))) answer.append(tokens.get(i).toLowerCase());
                          if(answerPred.length()>0) answerPred.append(' ');
                          if(Character.isLetterOrDigit(tokens.get(i).charAt(0))) answerPred.append(tokens.get(i).toLowerCase());
                      }
                  } else if(verbIndex != -1 && !Linguistics.tobe.contains(tokens.get(i))){
                      answerPred.append(tokens.get(i).toLowerCase());
                  }
              }
              interpretation.setObjAnswer(answer.toString());
              interpretation.setPredAnswer(answerPred.toString());
          } else {
  		    logger.warn("TOKENS missing but AnswerAnalyzer is used!");
  		}
  
  		return interpretation;
  	}
focal_method.class_method_signature: AnswerAnalyzer.analyze(Interpretation interpretation)
focal_method.full_signature: @Override public Interpretation analyze(Interpretation interpretation)
focal_method.identifier: analyze
focal_method.invocations: getPas containsKey containsKey get get contains contains substring indexOf setObjAnswer toLowerCase setPredAnswer toLowerCase containsKey containsKey toLowerCase get contains toLowerCase get setObjAnswer setPredAnswer getTokens getPosTags startsWith warn isEmpty size setObjAnswer get setPredAnswer get size get equals toLowerCase get length append isLetterOrDigit charAt get append toLowerCase get length append isLetterOrDigit charAt get append toLowerCase get contains get append toLowerCase get setObjAnswer toString setPredAnswer toString warn
focal_method.modifiers: @Override public
focal_method.parameters: (Interpretation interpretation)
focal_method.return: Interpretation
focal_method.signature: Interpretation analyze(Interpretation interpretation)