wordList.clear();
// iterate over Tokens
FSIterator tokenIterator = tokenIndex.subiterator(sentence);
while (tokenIterator.hasNext()) {
Token token = (Token) tokenIterator.next();
tokenList.add(token);
wordList.add(token.getCoveredText());
}
for (int i = 0; i < numNefs; i++) {
Constructor annotationMaker = neAnnotationMakers[i];
finderTags = nameFinders[i].find(wordList, Collections.EMPTY_MAP);
boolean inTag = false;
int tagStart = 0;
int tagEnd = 0;
for (int j = 0; j < finderTags.size(); j++) {
String tag = (String) finderTags.get(j);
if (inTag) {
// check for end tags
if (tag.equals(NameFinderME.START) || tag.equals(NameFinderME.OTHER)) {
// make annotation
tagEnd = j - 1;
Token startToken = (Token) tokenList.get(tagStart);
Token endToken = (Token) tokenList.get(tagEnd);
makeEntityAnnotation(annotationMaker, aJCas, startToken.getBegin(), endToken.getEnd());
inTag = false;
}
}
if (!inTag) {
// check for start tags