efxtools.filtering
Class EfXScopeHandler

java.lang.Object
  extended by efxtools.filtering.EfXScopeHandler
All Implemented Interfaces:
IScopeHandler

public class EfXScopeHandler
extends java.lang.Object
implements IScopeHandler

Reference implementation of the abstract class IScopeHandler. The methods of the scope handler are implemented as follows:

Author:
Author of EfXTools

Constructor Summary
EfXScopeHandler()
           
 
Method Summary
 Scope filter(org.apache.uima.jcas.JCas jcas, Scope scope, java.util.Set<org.apache.uima.analysis_engine.TypeOrFeature> outputTypesAndFeatures)
          Filters the text units (annotations) of the given scope in the given JCas object that are relevant with respect to the given output annotation types and features.
 Scope intersect(org.apache.uima.jcas.JCas jcas, Scope scope1, Scope scope2)
          Retains all text units (annotations) of the first given scope that intersect with one of the text units of the second given scope in the text of the given JCas object.
 Scope unify(org.apache.uima.jcas.JCas jcas, java.util.Set<Scope> scopes)
          Creates a unified scope from the given scopes, i.e., a scope that consists of all text spans of the given JCas object that belong to at least one of the single scopes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EfXScopeHandler

public EfXScopeHandler()
Method Detail

filter

public Scope filter(org.apache.uima.jcas.JCas jcas,
                    Scope scope,
                    java.util.Set<org.apache.uima.analysis_engine.TypeOrFeature> outputTypesAndFeatures)
Description copied from interface: IScopeHandler
Filters the text units (annotations) of the given scope in the given JCas object that are relevant with respect to the given output annotation types and features. Returns the remaining scope.

Specified by:
filter in interface IScopeHandler
Parameters:
jcas - The JCas object
scope - The scope
outputTypesAndFeatures - The output annotation types

intersect

public Scope intersect(org.apache.uima.jcas.JCas jcas,
                       Scope scope1,
                       Scope scope2)
Description copied from interface: IScopeHandler
Retains all text units (annotations) of the first given scope that intersect with one of the text units of the second given scope in the text of the given JCas object. This method is called in order to determine which parts of the first scope are relevant knowing the extent of the second scope, which is either the root scope or a descendant scope of the first scope.

Specified by:
intersect in interface IScopeHandler
Parameters:
jcas - The JCas object
scope1 - The first scope
scope2 - The second scope
Returns:
The part of the first scope that intersects with the second scope

unify

public Scope unify(org.apache.uima.jcas.JCas jcas,
                   java.util.Set<Scope> scopes)
Description copied from interface: IScopeHandler
Creates a unified scope from the given scopes, i.e., a scope that consists of all text spans of the given JCas object that belong to at least one of the single scopes. This method is called in order to determine one single scope that defines the relevant portion of text and thus shall be processed by a particular analysis engine.

Specified by:
unify in interface IScopeHandler
Parameters:
jcas - The JCas object
scopes - The scopes
Returns:
The unified scope