public class SEUtil extends Object
Constructor and Description |
---|
SEUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
contains(int b1,
int e1,
int b2,
int e2)
Returns 1 if 1 contains 2
Returns 2 if 2 contains 1
Returns 0 otherwise
|
static List |
getDrugsInSpan(org.apache.uima.jcas.JCas jcas,
int begin,
int end)
Return the List of drug IdentifiedAnnotation within the span
|
static org.apache.uima.jcas.JCas |
getJCasViewWithDefault(org.apache.uima.cas.CAS cas,
String name)
helper to look for plain text view for CDA processing or else use the default view.
|
static int |
getNumOfWordTokensInSpan(org.apache.uima.jcas.JCas jcas,
int begin,
int end)
return the number of words except for "and" "or" in span
|
static int |
getNumOfWordTokensInSpanExceptGivenNE(org.apache.uima.jcas.JCas jcas,
int begin,
int end,
int neType)
return the number of words in span except for "and" "or" and given NE
|
static String |
getSegmentID(org.apache.uima.jcas.JCas jcas,
int begin,
int end)
Return segmentID contain the given span
|
static String |
getSegmentIDOfSpan(org.apache.uima.jcas.JCas jcas,
int begin,
int end)
Return segmentID of the sentence containing the given span
|
static int |
getSentenceNumContainingGivenSpan(org.apache.uima.jcas.JCas jcas,
int begin,
int end)
Return sentenceNumber of the sentence containing the given span
|
static int[] |
getSentenceSpanContainingGivenSpan(org.apache.uima.jcas.JCas jcas,
int begin,
int end)
Return sentence span containing the span (begin & end)
|
static int[] |
getSentenceSpanOfGivenSentenceNum(org.apache.uima.jcas.JCas jcas,
int senNum)
Return sentence span of the given sentence number
|
static String |
getSentenceTextContainingGivenSpan(org.apache.uima.jcas.JCas jcas,
int begin,
int end)
Return sentence text containing the span (begin & end)
|
static boolean |
intersects(int b1,
int e1,
int b2,
int e2)
Returns true if one span intersects with the other
|
static boolean |
isDrugBetween(org.apache.uima.jcas.JCas jcas,
int begin,
int end)
Return true if a drug is between begin and end
|
static boolean |
isInUpperCaseStringLine(org.apache.uima.jcas.JCas jcas,
IdentifiedAnnotation nea)
Return true if the given NE belongs to the line consisting of a upper-cased string without " - "
|
static boolean |
isPSEBetween(org.apache.uima.jcas.JCas jcas,
int begin,
int end)
Return true if a sign/symptom or disease/disorder is between begin and end
|
static boolean |
isSpanInSameLine(org.apache.uima.jcas.JCas jcas,
int begin,
int end)
Return true if the given offsets are in the same line
|
static boolean |
isUpperCaseString(String str) |
public static int[] getSentenceSpanContainingGivenSpan(org.apache.uima.jcas.JCas jcas, int begin, int end)
jcas
- begin
- end
- public static String getSentenceTextContainingGivenSpan(org.apache.uima.jcas.JCas jcas, int begin, int end)
jcas
- begin
- end
- public static int[] getSentenceSpanOfGivenSentenceNum(org.apache.uima.jcas.JCas jcas, int senNum)
jcas
- senNum
- public static String getSegmentIDOfSpan(org.apache.uima.jcas.JCas jcas, int begin, int end)
jcas
- begin
- - begin offsetend
- - end offsetpublic static String getSegmentID(org.apache.uima.jcas.JCas jcas, int begin, int end)
jcas
- begin
- end
- public static int contains(int b1, int e1, int b2, int e2)
public static boolean intersects(int b1, int e1, int b2, int e2)
public static List getDrugsInSpan(org.apache.uima.jcas.JCas jcas, int begin, int end)
jcas
- begin
- end
- public static int getSentenceNumContainingGivenSpan(org.apache.uima.jcas.JCas jcas, int begin, int end)
jcas
- begin
- end
- public static int getNumOfWordTokensInSpan(org.apache.uima.jcas.JCas jcas, int begin, int end)
jcas
- begin
- end
- public static int getNumOfWordTokensInSpanExceptGivenNE(org.apache.uima.jcas.JCas jcas, int begin, int end, int neType)
jcas
- begin
- end
- public static boolean isUpperCaseString(String str)
public static boolean isInUpperCaseStringLine(org.apache.uima.jcas.JCas jcas, IdentifiedAnnotation nea)
jcas
- nea
- public static boolean isSpanInSameLine(org.apache.uima.jcas.JCas jcas, int begin, int end)
jcas
- begin
- end
- public static boolean isDrugBetween(org.apache.uima.jcas.JCas jcas, int begin, int end)
jcas
- begin
- end
- public static boolean isPSEBetween(org.apache.uima.jcas.JCas jcas, int begin, int end)
jcas
- begin
- end
- public static org.apache.uima.jcas.JCas getJCasViewWithDefault(org.apache.uima.cas.CAS cas, String name) throws org.apache.uima.cas.CASException
cas
- name
- org.apache.uima.cas.CASException
Copyright © 2012-2017 The Apache Software Foundation. All Rights Reserved.