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 StringALLOW_MULT_ANNOstatic 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, 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 textprotected Map<String,List<String>>getRegEx(InputStream input)Return regular expression patterns for med attributesvoidinitialize(org.apache.uima.UimaContext uimaContext)voidprocess(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
-
-
-
-
Field Detail
-
REGEX_FILE
public static final String REGEX_FILE
- See Also:
- Constant Field Values
-
ALLOW_MULT_ANNO
public static final 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, 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)
-
-