public abstract class NamedEntityContextAnalyzer extends java.lang.Object implements ContextAnalyzer
Modifier and Type | Field and Description |
---|---|
private java.util.Set<java.lang.String> |
_boundaryWordSet |
private Logger |
iv_logger |
Constructor and Description |
---|
NamedEntityContextAnalyzer() |
Modifier and Type | Method and Description |
---|---|
private void |
initBoundaryData() |
void |
initialize(UimaContext annotatorContext)
This will be called by the ContextAnnotator during its initialize method
|
boolean |
isBoundary(Annotation contextAnnotation,
int scopeOrientation)
This method is called by the ContextAnnotator.
|
protected java.util.List<TextToken> |
wrapAsFsmTokens(java.util.List<? extends Annotation> tokenList)
This method converts Token annotations to TextTokens required by the fsm library used by both subclasses of this class.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
analyzeContext
private Logger iv_logger
private java.util.Set<java.lang.String> _boundaryWordSet
public void initialize(UimaContext annotatorContext) throws ResourceInitializationException
ContextAnalyzer
initialize
in interface ContextAnalyzer
ResourceInitializationException
private void initBoundaryData()
public boolean isBoundary(Annotation contextAnnotation, int scopeOrientation) throws AnalysisEngineProcessException
ContextAnalyzer
For the left and right scopes, the context annotator will collect a number of annotations up to the maximum specified by the appropriate parameter unless it comes to the edge of the window annotation or a boundary condition is met as specified by this method. For example, you may specify that the scope is LEFT, the maximum left scope size is 10, the context annotation is a token of some sort, and the window annotation is a sentence. The context annotator will collect the annotations to the left of the focus annotation such that there will be no more than 10 context annotations, they will all be inside the sentence, and no context annotations will be collected to the left of a boundary condition as specified by this method.
isBoundary
in interface ContextAnalyzer
contextAnnotation
- the context annotation that may or may not satisfy a boundary
conditionscopeOrientation
- the scope of the context annotator. The value will be the left
or right scope.AnalysisEngineProcessException
ContextAnnotator.LEFT_SCOPE
,
ContextAnnotator.RIGHT_SCOPE
,
isBoundary(Annotation, int)
protected java.util.List<TextToken> wrapAsFsmTokens(java.util.List<? extends Annotation> tokenList)
tokenList
- a list of token annotations