|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectopennlp.tools.util.Span
public class Span
Class for storing start and end integer offsets.
| Constructor Summary | |
|---|---|
Span(int s,
int e)
Initializes a new Span Object. |
|
| Method Summary | |
|---|---|
int |
compareTo(java.lang.Object o)
Compares the specified span to the current span. |
boolean |
contains(int index)
|
boolean |
contains(Span s)
Returns true if the specified span is contained by this span. |
boolean |
crosses(Span s)
Returns true is the specified span crosses this span. |
boolean |
equals(java.lang.Object o)
Checks if the specified span is equal to the current span. |
java.lang.String |
getCoveredText(java.lang.String text)
Retrieves the string covered by the current span of the specified text. |
int |
getEnd()
Return the end of a span. |
int |
getStart()
Return the start of a span. |
int |
hashCode()
Generates a hash code of the current span. |
boolean |
intersects(Span s)
Returns true if the specified span intersects with this span. |
int |
length()
Returns the length of this span. |
static java.lang.String[] |
spansToStrings(Span[] spans,
java.lang.String s)
Converts an array of Spans to an array of Strings. |
static java.lang.String[] |
spansToStrings(Span[] spans,
java.lang.String[] tokens)
|
boolean |
startsWith(Span s)
Returns true if the specified span is the begin of this span and the specified span is contained in this span. |
java.lang.String |
toString()
Generates a human readable string. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Span(int s,
int e)
s - start of span.e - end of span.| Method Detail |
|---|
public int getStart()
public int getEnd()
public int length()
public boolean contains(Span s)
s - The span to compare with this span.
public boolean contains(int index)
public boolean startsWith(Span s)
s - The span to compare with this span.
public boolean intersects(Span s)
s - The span to compare with this span.
public boolean crosses(Span s)
s - The span to compare with this span.
public java.lang.String getCoveredText(java.lang.String text)
text -
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
public static java.lang.String[] spansToStrings(Span[] spans,
java.lang.String s)
Spans to an array of Strings.
spans - s -
public static java.lang.String[] spansToStrings(Span[] spans,
java.lang.String[] tokens)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||