Class MedAttrAnnotator

  • All Implemented Interfaces:
    org.apache.uima.analysis_component.AnalysisComponent

    public class MedAttrAnnotator
    extends org.apache.uima.analysis_component.JCasAnnotator_ImplBase
    Author:
    Sunghwan Sohn Extract medication attributes defined in regExPatterns
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addToJCas2​(org.apache.uima.jcas.JCas jcas, List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute> annot)  
      protected List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute> getAttribute2​(String text)
      Find and return medication attributes in text
      protected Map<String,​List<String>> getRegEx​(InputStream input)
      Return regular expression patterns for med attributes
      void initialize​(org.apache.uima.UimaContext uimaContext)  
      void process​(org.apache.uima.jcas.JCas jcas)  
      protected List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute> removeOverlap​(List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute> attr)
      Remove duplicates or take a longer attribute if subsumed and return the updated list of Attribute
      • Methods inherited from class org.apache.uima.analysis_component.JCasAnnotator_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, getResultSpecification, reconfigure, setResultSpecification
    • Constructor Detail

      • MedAttrAnnotator

        public MedAttrAnnotator()
    • Method Detail

      • initialize

        public void initialize​(org.apache.uima.UimaContext uimaContext)
                        throws org.apache.uima.resource.ResourceInitializationException
        Specified by:
        initialize in interface org.apache.uima.analysis_component.AnalysisComponent
        Overrides:
        initialize in class org.apache.uima.analysis_component.AnalysisComponent_ImplBase
        Throws:
        org.apache.uima.resource.ResourceInitializationException
      • process

        public void process​(org.apache.uima.jcas.JCas jcas)
                     throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
        Specified by:
        process in class org.apache.uima.analysis_component.JCasAnnotator_ImplBase
        Throws:
        org.apache.uima.analysis_engine.AnalysisEngineProcessException
      • addToJCas2

        protected void addToJCas2​(org.apache.uima.jcas.JCas jcas,
                                  List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute> annot)
      • getAttribute2

        protected List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute> getAttribute2​(String text)
        Find and return medication attributes in text
        Parameters:
        text - String to extract attributes
        Returns:
        List of Attribute classes
      • removeOverlap

        protected List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute> removeOverlap​(List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute> attr)
        Remove duplicates or take a longer attribute if subsumed and return the updated list of Attribute
        Parameters:
        attr - List of Attribute class
        Returns:
        List of Attribute class without duplicates/overlaps
      • getRegEx

        protected Map<String,​List<String>> getRegEx​(InputStream input)
        Return regular expression patterns for med attributes
        Parameters:
        input - file name of the regEx file
        Returns:
        Map of attribute regular expression (key:tag, val:List of regular expression patterns)