public int getStartIdx () { return span.getStartIdx (); }
public int getStartIdx () { return span.getStartIdx (); }
public int getStartIdx () { return span.getStartIdx (); }
public int compare (Object o, Object o1) { int start1 = ((Span)o).getStartIdx (); int start2 = ((Span)o1).getStartIdx (); return Double.compare (start1, start2); } } );
public int compare (Object o, Object o1) { int start1 = ((Span)o).getStartIdx (); int start2 = ((Span)o1).getStartIdx (); return Double.compare (start1, start2); } } );
public int compare (Object o, Object o1) { int start1 = ((Span)o).getStartIdx (); int start2 = ((Span)o1).getStartIdx (); return Double.compare (start1, start2); } } );
public boolean isSubspan (Span r) { return (r.getDocument() == this.document && (this.start <= r.getStartIdx ()) && (r.getEndIdx () <= this.end)); }
public boolean isSubspan (Span r) { return (r.getDocument() == this.document && (this.start <= r.getStartIdx ()) && (r.getEndIdx () <= this.end)); }
public boolean isSubspan (Span r) { return (r.getDocument() == this.document && (this.start <= r.getStartIdx ()) && (r.getEndIdx () <= this.end)); }
/** Convert the indices of a LabeledSpan into indices for a Tokenization. * @return array of size two, where first index is start Token, * second is end Token, inclusive */ private int[] getSegmentBoundaries (Tokenization tokens, LabeledSpan labeledSpan) { int startCharIndex = labeledSpan.getStartIdx(); int endCharIndex = labeledSpan.getEndIdx()-1; int[] ret = new int[]{-1,-1}; for (int i=0; i < tokens.size(); i++) { int charIndex = tokens.getSpan(i).getStartIdx(); if (charIndex <= endCharIndex && charIndex >= startCharIndex) { if (ret[0] == -1) { ret[0] = i; ret[1] = i; } else ret[1] = i; } } if (ret[0] == -1 || ret[1] == -1) throw new IllegalArgumentException("Unable to find segment boundaries from span " + labeledSpan); return ret; } }
/** Convert the indices of a LabeledSpan into indices for a Tokenization. * @return array of size two, where first index is start Token, * second is end Token, inclusive */ private int[] getSegmentBoundaries (Tokenization tokens, LabeledSpan labeledSpan) { int startCharIndex = labeledSpan.getStartIdx(); int endCharIndex = labeledSpan.getEndIdx()-1; int[] ret = new int[]{-1,-1}; for (int i=0; i < tokens.size(); i++) { int charIndex = tokens.getSpan(i).getStartIdx(); if (charIndex <= endCharIndex && charIndex >= startCharIndex) { if (ret[0] == -1) { ret[0] = i; ret[1] = i; } else ret[1] = i; } } if (ret[0] == -1 || ret[1] == -1) throw new IllegalArgumentException("Unable to find segment boundaries from span " + labeledSpan); return ret; } }
} else { List childElts = new ArrayList (childSpans.size()); int start = span.getStartIdx (); int current = 0; for (int i = 0; i < childSpans.size(); i++) {
/** Convert the indices of a LabeledSpan into indices for a Tokenization. * @return array of size two, where first index is start Token, * second is end Token, inclusive */ private int[] getSegmentBoundaries (Tokenization tokens, LabeledSpan labeledSpan) { int startCharIndex = labeledSpan.getStartIdx(); int endCharIndex = labeledSpan.getEndIdx()-1; int[] ret = new int[]{-1,-1}; for (int i=0; i < tokens.size(); i++) { int charIndex = tokens.getSpan(i).getStartIdx(); if (charIndex <= endCharIndex && charIndex >= startCharIndex) { if (ret[0] == -1) { ret[0] = i; ret[1] = i; } else ret[1] = i; } } if (ret[0] == -1 || ret[1] == -1) throw new IllegalArgumentException("Unable to find segment boundaries from span " + labeledSpan); return ret; } }
} else { List childElts = new ArrayList (childSpans.size()); int start = span.getStartIdx (); int current = 0; for (int i = 0; i < childSpans.size(); i++) {
} else { List childElts = new ArrayList (childSpans.size()); int start = span.getStartIdx (); int current = 0; for (int i = 0; i < childSpans.size(); i++) {