Package org.ohnlp.ae.medxn
Class MedAttrAnnotator
- java.lang.Object
-
- org.apache.uima.analysis_component.AnalysisComponent_ImplBase
-
- org.apache.uima.analysis_component.Annotator_ImplBase
-
- org.apache.uima.analysis_component.JCasAnnotator_ImplBase
-
- org.ohnlp.ae.medxn.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
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringALLOW_MULT_ANNOstatic java.lang.StringREGEX_FILE
-
Constructor Summary
Constructors Constructor Description MedAttrAnnotator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddToJCas2(org.apache.uima.jcas.JCas jcas, java.util.List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute> annot)protected java.util.List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute>getAttribute2(java.lang.String text)Find and return medication attributes in textprotected java.util.Map<java.lang.String,java.util.List<java.lang.String>>getRegEx(java.io.InputStream input)Return regular expression patterns for med attributesvoidinitialize(org.apache.uima.UimaContext uimaContext)voidprocess(org.apache.uima.jcas.JCas jcas)protected java.util.List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute>removeOverlap(java.util.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
-
-
-
-
Field Detail
-
REGEX_FILE
public static final java.lang.String REGEX_FILE
- See Also:
- Constant Field Values
-
ALLOW_MULT_ANNO
public static final java.lang.String ALLOW_MULT_ANNO
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(org.apache.uima.UimaContext uimaContext) throws org.apache.uima.resource.ResourceInitializationException- Specified by:
initializein interfaceorg.apache.uima.analysis_component.AnalysisComponent- Overrides:
initializein classorg.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:
processin classorg.apache.uima.analysis_component.JCasAnnotator_ImplBase- Throws:
org.apache.uima.analysis_engine.AnalysisEngineProcessException
-
addToJCas2
protected void addToJCas2(org.apache.uima.jcas.JCas jcas, java.util.List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute> annot)
-
getAttribute2
protected java.util.List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute> getAttribute2(java.lang.String text)
Find and return medication attributes in text- Parameters:
text- String to extract attributes- Returns:
- List of Attribute classes
-
removeOverlap
protected java.util.List<org.ohnlp.ae.medxn.MedAttrAnnotator.Attribute> removeOverlap(java.util.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 java.util.Map<java.lang.String,java.util.List<java.lang.String>> getRegEx(java.io.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)
-
-