|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uchsc.ccp.iaa.Annotation
public class Annotation
Field Summary | |
---|---|
static int |
IGNORE_SPANS_COMPARISON
|
static int |
SPANS_EXACT_COMPARISON
|
static int |
SPANS_OVERLAP_COMPARISON
|
Constructor Summary | |
---|---|
Annotation()
|
Method Summary | |
---|---|
static boolean |
classesMatch(Annotation annotation1,
Annotation annotation2)
returns true only if both annotations have the same non-null annotationClass. |
static int |
compareAnnotations(Annotation annotation1,
Annotation annotation2,
int spanComparison,
boolean compareClass,
Set<String> simpleFeatureNames)
This method compares two annotations with respect to their spans, annotation classes and simple features. |
static int |
compareComplexFeature(Annotation annotation1,
Annotation annotation2,
String complexFeatureName,
int complexFeatureSpanComparison,
boolean complexFeatureClassComparison,
Set<String> simpleFeatureNamesOfComplexFeature,
boolean trivialSimpleFeatureMatchesCauseTrivialMatch)
This method compares the complex features of two annotations. |
static boolean |
compareComplexFeatureNames(Annotation annotation1,
Annotation annotation2)
This method checks to see if two annotations have the same complex features but does not compare the values of the features. |
static boolean |
compareFeatureNames(Annotation annotation1,
Annotation annotation2)
|
static int |
compareSimpleFeature(Annotation annotation1,
Annotation annotation2,
String featureName)
|
static boolean |
compareSimpleFeatureNames(Annotation annotation1,
Annotation annotation2)
This method checks to see if two annotations have the same simple features but does not compare the values of the features. |
static int |
compareSimpleFeatures(Annotation annotation1,
Annotation annotation2)
Compares all of the simple features of two annotations |
static int |
compareSimpleFeatures(Annotation annotation1,
Annotation annotation2,
Set<String> featureNames)
Compares the simple features of two annotations named in featureNames |
String |
getAnnotationClass()
|
Set<String> |
getComplexFeatureNames()
|
Set<Annotation> |
getComplexFeatureValues(String featureName)
|
static String |
getCoveredText(Annotation annotation,
String annotationText,
String spanSeparator)
Returns the text covered by an annotation. |
String |
getDocID()
|
Set<String> |
getFeatureNames()
|
String |
getSetName()
|
static Annotation |
getShortestAnnotation(Collection<Annotation> annotations)
This method returns the shortest annotation - that is the annotation whose span is the shortest. |
Set<String> |
getSimpleFeatureNames()
|
Set<Object> |
getSimpleFeatureValues(String featureName)
|
int |
getSize()
|
List<Span> |
getSpans()
|
boolean |
isComplexFeature(String featureName)
|
boolean |
isSimpleFeature(String featureName)
|
void |
setAnnotationClass(String type)
|
void |
setComplexFeature(String featureName,
Annotation featureValue)
|
void |
setComplexFeature(String featureName,
Set<Annotation> featureValues)
|
void |
setDocID(String docID)
|
void |
setSetName(String setName)
|
void |
setSimpleFeature(String featureName,
Object featureValue)
|
void |
setSimpleFeature(String featureName,
Set<Object> featureValues)
|
void |
setSpan(Span span)
|
void |
setSpans(List<Span> spans)
|
static boolean |
spansMatch(Annotation annotation1,
Annotation annotation2)
|
static boolean |
spansMatch(List<Annotation> annotations)
|
static boolean |
spansOverlap(Annotation annotation1,
Annotation annotation2)
|
String |
toHTML()
this needs to be moved out of this class |
String |
toHTML(boolean printComplexFeatures)
|
static int |
trivialCompare(Set values1,
Set values2)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SPANS_OVERLAP_COMPARISON
public static final int SPANS_EXACT_COMPARISON
public static final int IGNORE_SPANS_COMPARISON
Constructor Detail |
---|
public Annotation()
Method Detail |
---|
public String getSetName()
public void setSetName(String setName)
public String getDocID()
public void setDocID(String docID)
public String getAnnotationClass()
public void setAnnotationClass(String type)
public List<Span> getSpans()
public void setSpans(List<Span> spans)
public void setSpan(Span span)
public Set<String> getSimpleFeatureNames()
public Set<Object> getSimpleFeatureValues(String featureName)
public boolean isSimpleFeature(String featureName)
public void setSimpleFeature(String featureName, Set<Object> featureValues)
public void setSimpleFeature(String featureName, Object featureValue)
public Set<String> getComplexFeatureNames()
public Set<Annotation> getComplexFeatureValues(String featureName)
public boolean isComplexFeature(String featureName)
public void setComplexFeature(String featureName, Set<Annotation> featureValues)
public void setComplexFeature(String featureName, Annotation featureValue)
public Set<String> getFeatureNames()
public static boolean spansMatch(Annotation annotation1, Annotation annotation2)
annotation1
- annotation2
-
public static boolean spansMatch(List<Annotation> annotations)
public static boolean classesMatch(Annotation annotation1, Annotation annotation2)
public static boolean spansOverlap(Annotation annotation1, Annotation annotation2)
public static boolean compareSimpleFeatureNames(Annotation annotation1, Annotation annotation2)
annotation1
- annotation2
-
public static boolean compareComplexFeatureNames(Annotation annotation1, Annotation annotation2)
annotation1
- annotation2
-
public static boolean compareFeatureNames(Annotation annotation1, Annotation annotation2)
public static int trivialCompare(Set values1, Set values2)
values1
- the value of a feature (simple or complex)values2
- the value of another feature (simple or complex)
MatchResult
public static int compareSimpleFeature(Annotation annotation1, Annotation annotation2, String featureName)
annotation1
- annotation2
- featureName
- the name of the feature that will be compared between the two
annotations
trivialCompare(Set, Set)
public static int compareSimpleFeatures(Annotation annotation1, Annotation annotation2)
annotation1
- annotation2
-
MatchResult.NONTRIVIAL_MATCH
,
MatchResult.NONTRIVIAL_NONMATCH
,
MatchResult.TRIVIAL_MATCH
,
MatchResult.TRIVIAL_NONMATCH
public static int compareSimpleFeatures(Annotation annotation1, Annotation annotation2, Set<String> featureNames)
annotation1
- annotation2
- featureNames
- the simple features to compare.
compareSimpleFeature(Annotation,
Annotation, String)
,
MatchResult.NONTRIVIAL_MATCH
,
MatchResult.NONTRIVIAL_NONMATCH
,
MatchResult.TRIVIAL_MATCH
,
MatchResult.TRIVIAL_NONMATCH
public static int compareComplexFeature(Annotation annotation1, Annotation annotation2, String complexFeatureName, int complexFeatureSpanComparison, boolean complexFeatureClassComparison, Set<String> simpleFeatureNamesOfComplexFeature, boolean trivialSimpleFeatureMatchesCauseTrivialMatch)
annotation1
- annotation2
- complexFeatureName
- the name of the feature that will be compared between the two
annotationscomplexFeatureSpanComparison
- specifies how the spans of the feature values should be
compared. The value of this parameter must be one of
SPANS_OVERLAP_COMPARISON, SPANS_EXACT_COMPARISON, or
IGNORE_SPANS_COMPARISON. If IGNORE_SPANS_COMPARISON is passed
in, then the spans will be considered as matching.complexFeatureClassComparison
- specifies how the classes of the feature values should be
compared. If true, then the classes will be compared and will
be considered matched if they are the same. If false, then the
classes will not be compared and will be considered as
matching.simpleFeatureNamesOfComplexFeature
- specifies which simple features of the feature values should
be compared. If null or an empty set is passed in, then the
next parameter should probably be set to 'false'.trivialSimpleFeatureMatchesCauseTrivialMatch
- this parameter determines how a TRIVIAL_MATCH between simple
features of the feature values should affect the return value
of this method. If true, then a trivial match between any of
the simple features of the feature values will cause
TRIVIAL_MATCH (if it not a non-match) to be returned. If
false, then a trivial match between any of the simple features
will not have an effect on whether the return value of this
method is TRIVIAL or NONTRIVIAL.
public static int compareAnnotations(Annotation annotation1, Annotation annotation2, int spanComparison, boolean compareClass, Set<String> simpleFeatureNames)
annotation1
- annotation2
- spanComparison
- must be one of SPANS_OVERLAP_COMPARISON,
SPANS_EXACT_COMPARISON, or IGNORE_SPANS_COMPARISON. If
IGNORE_SPANS_COMPARISON is passed in, then the spans will be
considered as matching.compareClass
- if true, then the classes will be compared and will be
considered matched if they are the same. If false, then the
classes will not be compared and will be considered as
matching.simpleFeatureNames
- the simple features that will be compared.
compareSimpleFeatures(Annotation,
Annotation, Set)
public static String getCoveredText(Annotation annotation, String annotationText, String spanSeparator)
annotation
- an annotation that has spans corresponding to extents of
annotationTextannotationText
- the text from which an annotation corresponds to.spanSeparator
- if more than one span exists, then this String will be
inserted between each segment of text.
public int getSize()
public static Annotation getShortestAnnotation(Collection<Annotation> annotations)
annotations
-
public String toHTML()
public String toHTML(boolean printComplexFeatures)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |