Class Normalizer

java.lang.Object
org.apache.uima.analysis_component.AnalysisComponent_ImplBase
org.apache.uima.analysis_component.Annotator_ImplBase
org.apache.uima.analysis_component.CasAnnotator_ImplBase
opennlp.uima.normalizer.Normalizer
All Implemented Interfaces:
org.apache.uima.analysis_component.AnalysisComponent

public class Normalizer extends org.apache.uima.analysis_component.CasAnnotator_ImplBase
The Normalizer tries the structure annotations. The structured value is then assigned to a field of the annotation.

The process depends on the

string Tokens must be (fuzzy) mapped to categories eg. a month, a day or a year (use dictionary) integer, float tokens must be parsed eg. for percentage or period boolean tokens must be parsed eg is there any ???

Restricted set of outcomes throw an error if not matched or silently fail unrestricted set of outcomes.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private org.apache.uima.UimaContext
     
    private org.apache.uima.util.Logger
     
     
    private org.apache.uima.cas.Type
    The annotation marks the text to structure.
    private org.apache.uima.cas.Feature
    The target type which the text should have.
    private static final Set<String>
    This set contains all supported range types.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Initializes a Normalizer instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    initialize(org.apache.uima.UimaContext context)
    Initializes the current instance with the given context.
    void
    process(org.apache.uima.cas.CAS tcas)
     
    void
    typeSystemInit(org.apache.uima.cas.TypeSystem typeSystem)
    Initializes the type system.

    Methods inherited from class org.apache.uima.analysis_component.CasAnnotator_ImplBase

    getRequiredCasInterface, process

    Methods inherited from class org.apache.uima.analysis_component.Annotator_ImplBase

    getCasInstancesRequired, hasNext, next

    Methods inherited from class org.apache.uima.analysis_component.AnalysisComponent_ImplBase

    batchProcessComplete, collectionProcessComplete, destroy, getContext, getLogger, getResultSpecification, reconfigure, setResultSpecification

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SUPPORTED_TYPES

      private static final Set<String> SUPPORTED_TYPES
      This set contains all supported range types.
    • context

      private org.apache.uima.UimaContext context
    • mLogger

      private org.apache.uima.util.Logger mLogger
    • mNameType

      private org.apache.uima.cas.Type mNameType
      The annotation marks the text to structure.
    • mStructureFeature

      private org.apache.uima.cas.Feature mStructureFeature
      The target type which the text should have. This type must be primitive.

      It should not be possible to assign something to this feature with is not structured. The feature should define allowed values.

    • mLookupDictionary

      private StringDictionary mLookupDictionary
  • Constructor Details

    • Normalizer

      private Normalizer()
      Initializes a Normalizer instance.
  • Method Details

    • initialize

      public void initialize(org.apache.uima.UimaContext context) throws org.apache.uima.resource.ResourceInitializationException
      Initializes the current instance with the given context.

      Specified by:
      initialize in interface org.apache.uima.analysis_component.AnalysisComponent
      Overrides:
      initialize in class org.apache.uima.analysis_component.AnalysisComponent_ImplBase
      Parameters:
      context - context to initialize
      Throws:
      org.apache.uima.resource.ResourceInitializationException - Thrown if errors occurred during initialization of resources.
    • typeSystemInit

      public void typeSystemInit(org.apache.uima.cas.TypeSystem typeSystem) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
      Initializes the type system.
      Overrides:
      typeSystemInit in class org.apache.uima.analysis_component.CasAnnotator_ImplBase
      Parameters:
      typeSystem - type system to initialize
      Throws:
      org.apache.uima.analysis_engine.AnalysisEngineProcessException
    • process

      public void process(org.apache.uima.cas.CAS tcas)
      Specified by:
      process in class org.apache.uima.analysis_component.CasAnnotator_ImplBase