* Performs name finding on the given cas object.
*/
public final void process(CAS cas) {
if (isRemoveExistingAnnotations) {
final AnnotationComboIterator sentenceNameCombo = new AnnotationComboIterator(cas,
mSentenceType, mNameType);
List<AnnotationFS> removeAnnotations = new LinkedList<AnnotationFS>();
for (AnnotationIteratorPair annotationIteratorPair : sentenceNameCombo) {
for (AnnotationFS nameAnnotation : annotationIteratorPair.getSubIterator()) {
removeAnnotations.add(nameAnnotation);
}
}
for (AnnotationFS annotation : removeAnnotations) {
cas.removeFsFromIndexes(annotation);
}
}
final AnnotationComboIterator sentenceTokenCombo = new AnnotationComboIterator(cas,
mSentenceType, mTokenType);
for (AnnotationIteratorPair annotationIteratorPair : sentenceTokenCombo) {
final List<AnnotationFS> sentenceTokenAnnotationList = new LinkedList<AnnotationFS>();