Skip to content

Commit 0c3db2d

Browse files
author
khashab2
committed
adding an addView function to Annotator, with extra parameter.
1 parent 3f1878b commit 0c3db2d

File tree

1 file changed

+9
-1
lines changed
  • core-utilities/src/main/java/edu/illinois/cs/cogcomp/annotation

1 file changed

+9
-1
lines changed

core-utilities/src/main/java/edu/illinois/cs/cogcomp/annotation/Annotator.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,15 @@ public final View getView(TextAnnotation ta) throws AnnotatorException {
168168
return ta.getView(viewName);
169169
}
170170

171+
/**
172+
Add the content of the annotators to a given TextAnnotation object.
173+
@param runtimeAttributes the parameters that might change the behavior of the annotator while after initialization and while running.
174+
*/
175+
protected void addView(TextAnnotation ta, ResourceManager runtimeAttributes) throws AnnotatorException {
176+
logger.warn("This annotator does not accept run-time attributes. You have to run `addView() function without the attributes parameter. `");
177+
addView(ta);
178+
}
179+
171180
/**
172181
* First, checks whether model is initialized, and calls initialize() if not. Then, calls
173182
* addView(). IMPORTANT: clients should always call getView().
@@ -182,7 +191,6 @@ private void lazyAddView(TextAnnotation ta) throws AnnotatorException {
182191
addView(ta);
183192
}
184193

185-
186194
/**
187195
* Can be used internally by {@link BasicAnnotatorService} to check for pre-requisites before
188196
* calling any single (external) {@link Annotator}.

0 commit comments

Comments
 (0)