Package org.ohnlp.ae.medxn
Class MedExtAnnotator
- 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.MedExtAnnotator
-
- All Implemented Interfaces:
org.apache.uima.analysis_component.AnalysisComponent
public class MedExtAnnotator extends org.apache.uima.analysis_component.JCasAnnotator_ImplBaseAssociate medication with attributes.- Author:
- Sunghwan Sohn
-
-
Field Summary
Fields Modifier and Type Field Description static intSENT_WINDOW_SPANstatic intSENT_WINDOW_SPAN_DUR
-
Constructor Summary
Constructors Constructor Description MedExtAnnotator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcontains(int b1, int e1, int b2, int e2)Returns 1 if 1 contains or equal to 2 Returns 2 if 2 contains or equal to 1 Returns 0 otherwisevoidinitialize(org.apache.uima.UimaContext uimaContext)protected booleanisFalseMed1(java.lang.String med)Check if the given drug is true or notvoidprocess(org.apache.uima.jcas.JCas jcas)protected int[]setWindow(org.apache.uima.jcas.JCas jcas, de.julielab.jcore.types.medical.Medication drug, int nextDrugBegin, int prevDrugEnd, int windowSpan)NOTE THAT THIS IS SPECIFIC FOR MAYO DATA return the offsets: begin of the given drug and the smaller of 1) the end of +2 sentences or 2) begin of the next drug Mayo specific: "BUT if there is newline and it does not start with Instruction or Indication, the end becomes newline"-
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
-
SENT_WINDOW_SPAN
public static final int SENT_WINDOW_SPAN
- See Also:
- Constant Field Values
-
SENT_WINDOW_SPAN_DUR
public static final int SENT_WINDOW_SPAN_DUR
- 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
-
setWindow
protected int[] setWindow(org.apache.uima.jcas.JCas jcas, de.julielab.jcore.types.medical.Medication drug, int nextDrugBegin, int prevDrugEnd, int windowSpan)NOTE THAT THIS IS SPECIFIC FOR MAYO DATA return the offsets: begin of the given drug and the smaller of 1) the end of +2 sentences or 2) begin of the next drug Mayo specific: "BUT if there is newline and it does not start with Instruction or Indication, the end becomes newline"- Parameters:
jcas-drug-nextDrugBegin-- Returns:
-
isFalseMed1
protected boolean isFalseMed1(java.lang.String med)
Check if the given drug is true or not- Parameters:
md-- Returns:
- true if potentially false medication
-
contains
protected int contains(int b1, int e1, int b2, int e2)Returns 1 if 1 contains or equal to 2 Returns 2 if 2 contains or equal to 1 Returns 0 otherwise
-
-