|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eml.MMAX2.annotation.markables.MarkableHelper
public class MarkableHelper
Field Summary | |
---|---|
static java.lang.String |
legacyDefaultValue
|
static int |
LONGER_BEFORE_SHORTER
|
static int |
SHORTER_BEFORE_LONGER
|
Constructor Summary | |
---|---|
MarkableHelper()
Creates a new instance of MarkableHelper |
Method Summary | |
---|---|
static boolean |
before(int e1End,
int e2Start)
|
static boolean |
before(Markable m1,
Markable m2)
|
static boolean |
before(MMAX2QueryResultTuple t1,
MMAX2QueryResultTuple t2,
int list1ColSpec,
int list2ColSpec)
This returns true if t1 appears before t2, false otherwise. |
static boolean |
beforeStrict(int e1End,
int e2Start)
|
static boolean |
beforeStrict(Markable m1,
Markable m2)
|
static boolean |
beforeStrict(MMAX2QueryResultTuple t1,
MMAX2QueryResultTuple t2,
int list1ColSpec,
int list2ColSpec)
This returns true if t1 appears before t2, false otherwise. |
static boolean |
during(int t1Start,
int t1End,
int t2Start,
int t2End)
|
static boolean |
during(Markable m1,
Markable m2)
|
static boolean |
during(MMAX2QueryResultTuple t1,
MMAX2QueryResultTuple t2,
int list1ColSpec,
int list2ColSpec)
This returns true if t1 starts at the same time as or after t2 starts, and t1 ends at the same time as or before t2 ends, false otherwise. |
static boolean |
duringFragments(java.lang.String[][] m1Frags,
java.lang.String[][] m2Frags)
|
static boolean |
duringStrict(Markable m1,
Markable m2)
|
static boolean |
duringStrict(MMAX2QueryResultTuple t1,
MMAX2QueryResultTuple t2,
int list1ColSpec,
int list2ColSpec)
This returns true if t1 starts at the same time as or after t2 starts, and t1 ends at the same time as or before t2 ends, and if t1 and t2 are not identical,false otherwise. |
static java.lang.String |
encodeXML(java.lang.String inString)
|
static boolean |
equalFragments(java.lang.String[][] m1Frags,
java.lang.String[][] m2Frags)
|
static boolean |
equals(int t1Start,
int t1End,
int t2Start,
int t2End)
|
static boolean |
equals(Markable m1,
Markable m2)
|
static boolean |
equals(MMAX2QueryResultTuple t1,
MMAX2QueryResultTuple t2,
int list1ColSpec,
int list2ColSpec)
This returns true if t1 and t2 span the same sequence of discourse elements, false otherwise. |
static boolean |
finishes(int t1End,
int t2End)
|
static boolean |
finishes(Markable m1,
Markable m2)
|
static boolean |
finishes(MMAX2QueryResultTuple t1,
MMAX2QueryResultTuple t2,
int list1ColSpec,
int list2ColSpec)
This returns true if t1 ends at the same time as t2 ends, and starts at the same time as or after t2 starts, false otherwise. |
static boolean |
finishesStrict(int t1Start,
int t1End,
int t2Start,
int t2End)
|
static boolean |
finishesStrict(Markable m1,
Markable m2)
|
static boolean |
finishesStrict(MMAX2QueryResultTuple t1,
MMAX2QueryResultTuple t2,
int list1ColSpec,
int list2ColSpec)
This returns true if t1 ends at the same time as t2 ends, and t1 starts after t2 starts, false otherwise. |
static int |
getDistanceInDiscoursePositions(Markable m1,
Markable m2)
|
static int |
getDistanceInDiscoursePositions(MMAX2QueryResultTupleElement e1,
MMAX2QueryResultTupleElement e2)
|
static int |
getFollowingValidDiscourseElementPosition(Markable markable,
java.lang.String[] currentFragment,
int currentPos)
Needed if Markables contain suppressed Discourse elements. |
static java.lang.String |
getFormattedAttributeString(Markable markable)
|
static int |
getPreceedingValidDiscourseElementPosition(Markable markable,
java.lang.String[] currentFragment,
int currentPos)
This method returns the discourse position of the next valid (i.e. |
static java.lang.String |
getSpan(Markable markable)
|
static java.lang.String |
getSpan(java.lang.String[][] fragments)
|
static java.lang.String |
getTransposedSpan(java.lang.String oldSpan,
java.lang.String oldLang,
java.util.ArrayList absoluteWords)
|
static boolean |
matches(Markable markable,
java.lang.String _attribute,
java.lang.String _value,
int type,
boolean _negated)
This method is used for matching queries that are NOT RegExps . |
static boolean |
matches(MMAX2DiscourseElement de,
java.lang.String _attribute,
java.lang.String _value,
int type,
boolean _negated)
This method is used for matching queries that are NOT RegExps . |
static boolean |
matchesAll(Markable markable,
MMAX2MatchingCriterion criterion)
Used by MMAX query. |
static boolean |
matchesAll(MMAX2DiscourseElement de,
MMAX2MatchingCriterion criterion)
Used by MMAX query. |
static boolean |
matchesAny(Markable markable,
MMAX2MatchingCriterion criterion)
Used by MMAX query. |
static boolean |
matchesAny(MMAX2DiscourseElement de,
MMAX2MatchingCriterion criterion)
Used by MMAX query. |
static boolean |
matchesRegExp(Markable markable,
java.lang.String _attribute,
java.lang.String _value,
int type,
boolean _negated)
This is used for matching queries with RegExp values. |
static boolean |
matchesRegExp(MMAX2DiscourseElement de,
java.lang.String _attribute,
java.lang.String _value,
int type,
boolean _negated)
This is used for matching queries with RegExp values. |
static boolean |
meets(int e1End,
int e2Start)
|
static boolean |
meets(Markable m1,
Markable m2)
|
static boolean |
meets(MMAX2QueryResultTuple t1,
MMAX2QueryResultTuple t2,
int list1ColSpec,
int list2ColSpec)
This returns true if t1 ends directly before t2 begins (no overlap), false otherwise. |
static boolean |
overlaps_left(int e1Start,
int e1End,
int e2Start,
int e2End)
|
static boolean |
overlaps_left(Markable m1,
Markable m2)
|
static boolean |
overlaps_left(MMAX2QueryResultTuple t1,
MMAX2QueryResultTuple t2,
int list1ColSpec,
int list2ColSpec)
|
static boolean |
overlaps_right(int e1Start,
int e1End,
int e2Start,
int e2End)
|
static boolean |
overlaps_right(Markable m1,
Markable m2)
|
static boolean |
overlaps_right(MMAX2QueryResultTuple t1,
MMAX2QueryResultTuple t2,
int list1ColSpec,
int list2ColSpec)
This returns true if t1 starts before t2 starts and t1 ends after t2 starts but before t2 ends, false otherwise. |
static java.util.HashMap |
parseAttributesToHashMap(java.lang.String attribs)
|
static java.util.ArrayList[] |
parseAttributesToLists(java.lang.String attribs)
|
static java.util.ArrayList |
parseCompleteSpan(java.lang.String span)
This method parses the value of a span attribute and returns all elements in an ArrayList. |
static java.lang.String[][] |
parseSpan(java.lang.String span)
This method parses the value of a span attribute and returns an Array with one Array per fragment. |
static java.util.ArrayList |
parseSpanFragment(java.lang.String span)
This method parses the value of a DE's span attribute and returns all elements in an ArrayList. |
static java.lang.String[] |
parseSpanFragmentToArray(java.lang.String span)
This method parses the value of a span fragment (either word_1..word_4 or word_3) and returns an array of all elements. |
static void |
register(Markable markable,
boolean updateHash)
This method |
static void |
removeDuplicateDiscoursePositions(java.util.ArrayList DEs)
|
static void |
setDisplayPositions(Markable markable)
For each fragment this Markable contains, this method sets the associated display positions in displayStart- and displayEndPosition, by setting displayStartPositions, displayEndPositions, discourseElementStartPositions, leftmostDisplayPosition, rightmostDisplayPosition. |
static void |
sort(java.util.ArrayList markables,
java.util.Comparator comp)
|
static boolean |
spans(MMAX2QueryResultTuple t1,
MMAX2QueryResultTuple t2,
int list1ColSpec,
int list2ColSpec)
This returns true if t1 and t2 start and end at the same positions regardless of discontinuity false otherwise. |
static boolean |
starts(int e1Start,
int e1End,
int e2Start,
int e2End)
|
static boolean |
starts(Markable m1,
Markable m2)
|
static boolean |
starts(MMAX2QueryResultTuple t1,
MMAX2QueryResultTuple t2,
int list1ColSpec,
int list2ColSpec)
This returns true if t1 starts at the same time as t2 starts, and t1 ends at the same time as or before t2 ends, false otherwise. |
static boolean |
startsStrict(int e1Start,
int e1End,
int e2Start,
int e2End)
|
static boolean |
startsStrict(Markable m1,
Markable m2)
|
static boolean |
startsStrict(MMAX2QueryResultTuple t1,
MMAX2QueryResultTuple t2,
int list1ColSpec,
int list2ColSpec)
This returns true if t1 starts at the same time as t2 starts, and t1 ends before t2 ends, false otherwise. |
static java.lang.String[][] |
toFragments(java.util.ArrayList DEs)
This class receives an ArrayList of MMAX2DiscourseElement objects representing one markable, and returns an array of arrays of Strings to be used as a markables fragment field. |
static java.lang.String[][] |
toFragments(java.util.ArrayList IDs,
MMAX2Discourse discourse)
This class receives an ArrayList of MMAX2DiscourseElement IDs representing one markable, and returns an array of arrays of Strings to be used as a markables fragment field. |
static java.lang.String |
toKWICString(Markable markable)
This returns a string representation of the current markable as a 'Key Word In Context'. |
static java.lang.String |
toKWICString(Markable markable,
int maxWidth)
This returns a string representation of the current markable as a 'Key Word In Context'. |
static java.lang.String |
toKWICString(java.lang.String wordID,
MMAX2Discourse discourse)
This returns a string representation of the current markable as a 'Key Word In Context'. |
static java.lang.String |
toXMLElement(Markable markable)
This method converts this Markable into an XML String representation for file storage. |
static java.lang.String |
transposeMarkable(Markable toTranspose,
java.lang.String oldLang,
java.util.ArrayList absoluteWords)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LONGER_BEFORE_SHORTER
public static final int SHORTER_BEFORE_LONGER
public static final java.lang.String legacyDefaultValue
Constructor Detail |
---|
public MarkableHelper()
Method Detail |
---|
public static void sort(java.util.ArrayList markables, java.util.Comparator comp)
public static java.lang.String getFormattedAttributeString(Markable markable)
public static java.lang.String[][] toFragments(java.util.ArrayList DEs)
public static java.lang.String[][] toFragments(java.util.ArrayList IDs, MMAX2Discourse discourse)
public static void removeDuplicateDiscoursePositions(java.util.ArrayList DEs)
public static boolean beforeStrict(MMAX2QueryResultTuple t1, MMAX2QueryResultTuple t2, int list1ColSpec, int list2ColSpec)
public static boolean beforeStrict(Markable m1, Markable m2)
public static boolean beforeStrict(int e1End, int e2Start)
public static boolean before(MMAX2QueryResultTuple t1, MMAX2QueryResultTuple t2, int list1ColSpec, int list2ColSpec)
public static boolean before(Markable m1, Markable m2)
public static boolean before(int e1End, int e2Start)
public static boolean meets(MMAX2QueryResultTuple t1, MMAX2QueryResultTuple t2, int list1ColSpec, int list2ColSpec)
public static boolean meets(Markable m1, Markable m2)
public static boolean meets(int e1End, int e2Start)
public static boolean starts(Markable m1, Markable m2)
public static boolean starts(int e1Start, int e1End, int e2Start, int e2End)
public static boolean startsStrict(Markable m1, Markable m2)
public static boolean startsStrict(int e1Start, int e1End, int e2Start, int e2End)
public static boolean overlaps_right(MMAX2QueryResultTuple t1, MMAX2QueryResultTuple t2, int list1ColSpec, int list2ColSpec)
public static boolean overlaps_left(MMAX2QueryResultTuple t1, MMAX2QueryResultTuple t2, int list1ColSpec, int list2ColSpec)
public static boolean overlaps_right(Markable m1, Markable m2)
public static boolean overlaps_left(Markable m1, Markable m2)
public static boolean overlaps_right(int e1Start, int e1End, int e2Start, int e2End)
public static boolean overlaps_left(int e1Start, int e1End, int e2Start, int e2End)
public static boolean finishes(Markable m1, Markable m2)
public static boolean finishes(int t1End, int t2End)
public static boolean finishesStrict(Markable m1, Markable m2)
public static boolean finishesStrict(int t1Start, int t1End, int t2Start, int t2End)
public static boolean during(MMAX2QueryResultTuple t1, MMAX2QueryResultTuple t2, int list1ColSpec, int list2ColSpec)
public static boolean starts(MMAX2QueryResultTuple t1, MMAX2QueryResultTuple t2, int list1ColSpec, int list2ColSpec)
public static boolean finishes(MMAX2QueryResultTuple t1, MMAX2QueryResultTuple t2, int list1ColSpec, int list2ColSpec)
public static boolean startsStrict(MMAX2QueryResultTuple t1, MMAX2QueryResultTuple t2, int list1ColSpec, int list2ColSpec)
public static boolean finishesStrict(MMAX2QueryResultTuple t1, MMAX2QueryResultTuple t2, int list1ColSpec, int list2ColSpec)
public static boolean during(Markable m1, Markable m2)
public static boolean during(int t1Start, int t1End, int t2Start, int t2End)
public static boolean duringFragments(java.lang.String[][] m1Frags, java.lang.String[][] m2Frags)
public static boolean duringStrict(MMAX2QueryResultTuple t1, MMAX2QueryResultTuple t2, int list1ColSpec, int list2ColSpec)
public static boolean duringStrict(Markable m1, Markable m2)
public static boolean equals(MMAX2QueryResultTuple t1, MMAX2QueryResultTuple t2, int list1ColSpec, int list2ColSpec)
public static boolean spans(MMAX2QueryResultTuple t1, MMAX2QueryResultTuple t2, int list1ColSpec, int list2ColSpec)
public static boolean equalFragments(java.lang.String[][] m1Frags, java.lang.String[][] m2Frags)
public static boolean equals(Markable m1, Markable m2)
public static boolean equals(int t1Start, int t1End, int t2Start, int t2End)
public static final java.lang.String toKWICString(java.lang.String wordID, MMAX2Discourse discourse)
public static final java.lang.String toKWICString(Markable markable)
public static final java.lang.String toKWICString(Markable markable, int maxWidth)
public static final void register(Markable markable, boolean updateHash)
public static final int getFollowingValidDiscourseElementPosition(Markable markable, java.lang.String[] currentFragment, int currentPos)
public static final int getPreceedingValidDiscourseElementPosition(Markable markable, java.lang.String[] currentFragment, int currentPos)
public static final void setDisplayPositions(Markable markable)
public static final java.lang.String transposeMarkable(Markable toTranspose, java.lang.String oldLang, java.util.ArrayList absoluteWords)
public static final java.lang.String getTransposedSpan(java.lang.String oldSpan, java.lang.String oldLang, java.util.ArrayList absoluteWords)
public static final java.lang.String toXMLElement(Markable markable)
public static final java.lang.String encodeXML(java.lang.String inString)
public static final boolean matchesRegExp(Markable markable, java.lang.String _attribute, java.lang.String _value, int type, boolean _negated)
public static final boolean matchesRegExp(MMAX2DiscourseElement de, java.lang.String _attribute, java.lang.String _value, int type, boolean _negated)
public static final boolean matches(Markable markable, java.lang.String _attribute, java.lang.String _value, int type, boolean _negated)
public static final boolean matches(MMAX2DiscourseElement de, java.lang.String _attribute, java.lang.String _value, int type, boolean _negated)
public static final java.lang.String getSpan(java.lang.String[][] fragments)
public static final java.lang.String getSpan(Markable markable)
public static final boolean matchesAny(Markable markable, MMAX2MatchingCriterion criterion)
public static final boolean matchesAny(MMAX2DiscourseElement de, MMAX2MatchingCriterion criterion)
public static final boolean matchesAll(Markable markable, MMAX2MatchingCriterion criterion)
public static final boolean matchesAll(MMAX2DiscourseElement de, MMAX2MatchingCriterion criterion)
public static final int getDistanceInDiscoursePositions(Markable m1, Markable m2)
public static final int getDistanceInDiscoursePositions(MMAX2QueryResultTupleElement e1, MMAX2QueryResultTupleElement e2)
public static final java.util.HashMap parseAttributesToHashMap(java.lang.String attribs)
public static final java.util.ArrayList[] parseAttributesToLists(java.lang.String attribs)
public static final java.lang.String[][] parseSpan(java.lang.String span)
public static final java.lang.String[] parseSpanFragmentToArray(java.lang.String span)
public static final java.util.ArrayList parseCompleteSpan(java.lang.String span)
public static final java.util.ArrayList parseSpanFragment(java.lang.String span)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |