if (!initialized || reloadScript || typeSystemChanged) {
initializeTypes(script, cas);
initialized = true;
lastTypeSystem = cas.getTypeSystem();
}
InferenceCrowd crowd = initializeCrowd();
RutaStream stream = initializeStream(cas, crowd);
stream.setDynamicAnchoring(dynamicAnchoring);
stream.setGreedyRuleElement(greedyRuleElement);
stream.setGreedyRule(greedyRule);
try {
script.apply(stream, crowd);
} catch (Throwable e) {
throw new AnalysisEngineProcessException(AnalysisEngineProcessException.ANNOTATOR_EXCEPTION,
new Object[] {}, e);
}
crowd.finished(stream);
if (removeBasics) {
List<AnnotationFS> toRemove = new ArrayList<AnnotationFS>();
Type basicType = cas.getTypeSystem().getType(BASIC_TYPE);
AnnotationIndex<AnnotationFS> basicIndex = cas.getAnnotationIndex(basicType);