@PipeBitInfo(name="Context Annotator", description="Collects context for focus annotations for use by context consuming annotators.", dependencies={SENTENCE,BASE_TOKEN}) public class ContextAnnotator extends org.apache.uima.fit.component.JCasAnnotator_ImplBase
Modifier and Type | Field and Description |
---|---|
static int |
ALL_SCOPE
The ALL_SCOPE scope provides the context annotation that are found in all three of the other scopes (LEFT, MIDDLE, and RIGHT).
|
static String |
CONTEXT_ANALYZER_CLASS_PARAM
"ContextAnalyzerClass" is a required, single, string parameter that
specifies the context analyzer class that determines if a "hit" is found
within a processed scope.
|
static String |
CONTEXT_ANNOTATION_CLASS_PARAM
"ContextAnnotationClass" is a required, single, string parameter that
specifies the annotation type of the context annotations (often "tokens")
that make up the context relative to a focus annotation within a scope
that is being examined.
|
static String |
CONTEXT_HIT_CONSUMER_CLASS_PARAM
"ContextHitConsumerClass" is a required, single, string parameter that
specifies the context hit consumer class that will process context hits
that are found.
|
protected ContextAnalyzer |
contextAnalyzer |
protected ContextHitConsumer |
contextConsumer |
static String |
FOCUS_ANNOTATION_CLASS_PARAM
"FocusAnnotationClass" is a required, single, string parameter that
specifies the annotation type of the focus annotations that are going to
be examined by this annotator.
|
static int |
LEFT_SCOPE |
protected int |
leftScopeSize |
static String |
MAX_LEFT_SCOPE_SIZE_PARAM
"MaxLeftScopeSize" is a required, single, integer parameter that
specifies the maximum size of the left scope.
|
static String |
MAX_RIGHT_SCOPE_SIZE_PARAM
"MaxRightScopeSize" is a required, single, integer parameter that
specifies the maximum size of the right scope.
|
static int |
MIDDLE_SCOPE
Provides context annotations that are "inside" the focus annotation.
|
static int |
RIGHT_SCOPE |
protected int |
rightScopeSize |
static String |
SCOPE_ORDER_PARAM
"ScopeOrder" is a required, multiple, string parameter that specifies the
order that the scopes should be processed in.
|
protected List<Integer> |
scopes |
static String |
WINDOW_ANNOTATION_CLASS_PARAM
"WindowAnnotationClass" is a required, single, string parameter that
specifies the annotation type of the windows that specify the hard
boundaries of scopes.
|
Constructor and Description |
---|
ContextAnnotator() |
Modifier and Type | Method and Description |
---|---|
static org.apache.uima.analysis_engine.AnalysisEngineDescription |
createAnnotatorDescription() |
protected List<org.apache.uima.jcas.tcas.Annotation> |
getLeftScopeContextAnnotations(org.apache.uima.jcas.JCas jCas,
org.apache.uima.jcas.tcas.Annotation focus,
org.apache.uima.jcas.tcas.Annotation window) |
protected List<org.apache.uima.jcas.tcas.Annotation> |
getMiddleScopeContextAnnotations(org.apache.uima.jcas.JCas jCas,
org.apache.uima.jcas.tcas.Annotation focus) |
protected List<org.apache.uima.jcas.tcas.Annotation> |
getRightScopeContextAnnotations(org.apache.uima.jcas.JCas jCas,
org.apache.uima.jcas.tcas.Annotation focus,
org.apache.uima.jcas.tcas.Annotation window) |
protected List<org.apache.uima.jcas.tcas.Annotation> |
getScopeContextAnnotations(org.apache.uima.jcas.JCas jCas,
org.apache.uima.jcas.tcas.Annotation focus,
org.apache.uima.jcas.tcas.Annotation window,
int scope) |
void |
initialize(org.apache.uima.UimaContext uimaContext) |
void |
process(org.apache.uima.jcas.JCas jCas) |
getRequiredCasInterface, process
getCasInstancesRequired, hasNext, next
public static final String MAX_LEFT_SCOPE_SIZE_PARAM
public static final String MAX_RIGHT_SCOPE_SIZE_PARAM
public static final String SCOPE_ORDER_PARAM
public static final String WINDOW_ANNOTATION_CLASS_PARAM
// * @see edu.mayo.bmi.common.type.Sentence
// * @see edu.mayo.bmi.common.type.Segment
,
Constant Field Valuespublic static final String FOCUS_ANNOTATION_CLASS_PARAM
public static final String CONTEXT_ANNOTATION_CLASS_PARAM
public static final String CONTEXT_ANALYZER_CLASS_PARAM
ContextAnalyzer
,
Constant Field Valuespublic static final String CONTEXT_HIT_CONSUMER_CLASS_PARAM
ContextHitConsumer
,
Constant Field Valuespublic static final int LEFT_SCOPE
public static final int MIDDLE_SCOPE
public static final int RIGHT_SCOPE
public static final int ALL_SCOPE
protected int leftScopeSize
protected int rightScopeSize
protected ContextAnalyzer contextAnalyzer
protected ContextHitConsumer contextConsumer
public void initialize(org.apache.uima.UimaContext uimaContext) throws org.apache.uima.resource.ResourceInitializationException
initialize
in interface org.apache.uima.analysis_component.AnalysisComponent
initialize
in class org.apache.uima.fit.component.JCasAnnotator_ImplBase
org.apache.uima.resource.ResourceInitializationException
public void process(org.apache.uima.jcas.JCas jCas) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
process
in class org.apache.uima.analysis_component.JCasAnnotator_ImplBase
org.apache.uima.analysis_engine.AnalysisEngineProcessException
protected List<org.apache.uima.jcas.tcas.Annotation> getScopeContextAnnotations(org.apache.uima.jcas.JCas jCas, org.apache.uima.jcas.tcas.Annotation focus, org.apache.uima.jcas.tcas.Annotation window, int scope) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
org.apache.uima.analysis_engine.AnalysisEngineProcessException
protected List<org.apache.uima.jcas.tcas.Annotation> getLeftScopeContextAnnotations(org.apache.uima.jcas.JCas jCas, org.apache.uima.jcas.tcas.Annotation focus, org.apache.uima.jcas.tcas.Annotation window) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
org.apache.uima.analysis_engine.AnalysisEngineProcessException
protected List<org.apache.uima.jcas.tcas.Annotation> getRightScopeContextAnnotations(org.apache.uima.jcas.JCas jCas, org.apache.uima.jcas.tcas.Annotation focus, org.apache.uima.jcas.tcas.Annotation window) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
org.apache.uima.analysis_engine.AnalysisEngineProcessException
protected List<org.apache.uima.jcas.tcas.Annotation> getMiddleScopeContextAnnotations(org.apache.uima.jcas.JCas jCas, org.apache.uima.jcas.tcas.Annotation focus) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
org.apache.uima.analysis_engine.AnalysisEngineProcessException
public static org.apache.uima.analysis_engine.AnalysisEngineDescription createAnnotatorDescription() throws org.apache.uima.resource.ResourceInitializationException
org.apache.uima.resource.ResourceInitializationException
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.