use of edu.illinois.cs.cogcomp.annotation.Annotator in project cogcomp-nlp by CogComp.
the class CuratorAnnotatorService method addView.
@Override
public boolean addView(TextAnnotation ta, String viewName) throws AnnotatorException {
if (ViewNames.SENTENCE.equals(viewName) || ViewNames.TOKENS.equals(viewName))
return false;
if (!viewProviders.containsKey(viewName))
throw new AnnotatorException("View " + viewName + " is not supported.");
boolean isUpdated = false;
// AnnotatorService will not support caching
if (ta.hasView(viewName))
return false;
Annotator annotator = viewProviders.get(viewName);
for (String prereqView : annotator.getRequiredViews()) isUpdated = addView(ta, prereqView);
ta.addView(annotator);
// AnnotatorService will not support caching
return isUpdated;
}
Aggregations