public void recognize() throws NamedEntityRecognizerException { if (null==sentence) throw new NamedEntityRecognizerException("null sentence or sentence not set."); this.listOfEntities = new ArrayList<NamedEntityWord>(sentence.size()); this.mapOfEntities = new HashMap<Integer, NamedEntityPhrase>(); for (String word : sentence) { listOfEntities.add(new NamedEntityWord(word, null)); } }
newNamedEntityType = StanfordAnswerToNamedEntityMapper.convert(strNamedEntity); listOfEntities.add(new NamedEntityWord(strWord, newNamedEntityType));