protected String formulateQuery(List<Keyterm> keyterms) { StringBuffer result = new StringBuffer(); for (Keyterm keyterm : keyterms) { result.append(keyterm.getText() + " "); } String query = result.toString(); System.out.println(" QUERY: " + query); return query; }
@Override protected List<Keyterm> updateKeyterms(String question, List<Keyterm> keyterms) { Chunking chunking = chunker.chunk(question); for (Chunk chunk : chunking.chunkSet()) { String word = question.substring(chunk.start(), chunk.end()); Keyterm keyterm = new Keyterm(word); keyterm.setComponentId("GENE"); keyterms.add(keyterm); } return keyterms; }