|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.minorthird.text.BasicSpan
public class BasicSpan
Implements the Span interface.
Field Summary | |
---|---|
int |
hiCharIndex
|
int |
loCharIndex
|
int |
loTextTokenIndex
|
Constructor Summary | |
---|---|
BasicSpan(java.lang.String documentId,
TextToken[] textTokens,
int loTextTokenIndex,
int spanLen,
java.lang.String documentGroupId)
Constructor assumes that the textTokens are all from the documentId. |
Method Summary | |
---|---|
java.lang.String |
asString()
Find the string contained in a Span. |
Span |
charIndexProperSubSpan(int lo,
int hi)
Create a the largest Span containing TextToken's which are contained in the character boundaries charLo, charHi of this span. |
Span |
charIndexSubSpan(int lo,
int hi)
Create a new Span containing TextToken's which are as close as possible to the character boundaries charLo, charHi of thisspan. |
int |
compareTo(Span other)
|
boolean |
contains(Span other)
Check containment |
Span |
documentSpan()
A larger span containing this span. |
int |
documentSpanStartIndex()
The index of this span in the home span. |
boolean |
equals(java.lang.Object o)
|
int |
getCharOffset()
|
java.lang.String |
getDocumentContents()
Return a string containing the entire content of the document that this span lives in. |
java.lang.String |
getDocumentGroupId()
Return the id of the group of documents this span belongs to |
java.lang.String |
getDocumentId()
Return the name of the document for these TextToken's. |
int |
getHiChar()
Returns how many characters there are up to and including the span |
Span |
getLeftBoundary()
A length-zero span for the left boundary |
int |
getLoChar()
Returns how many characters are before the span in the document |
int |
getLoTextToken()
Returns the low text token |
Span |
getRightBoundary()
A length-zero span for the left boundary |
TextToken |
getTextToken(int i)
Retrieves the ith TextToken in the span |
Token |
getToken(int i)
Retrieves the ith TextToken in the span |
int |
hashCode()
|
boolean |
overlaps(Span other)
Check overlap |
void |
setCharOffset(int charOffset)
|
int |
size()
Returns the number of tokens in the span. |
Span |
subSpan(int start,
int len)
Create a new BasicSpan, covering the indicated TextToken's. |
SubSpan |
subSpan(int startIndex,
int start,
int len)
Create a SubSpan of this span, covering the indicated TextToken's. |
Viewer |
toGUI()
Create a view of this object |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int loTextTokenIndex
public int loCharIndex
public int hiCharIndex
Constructor Detail |
---|
public BasicSpan(java.lang.String documentId, TextToken[] textTokens, int loTextTokenIndex, int spanLen, java.lang.String documentGroupId)
Method Detail |
---|
public java.lang.String getDocumentId()
Span
getDocumentId
in interface Span
public java.lang.String getDocumentGroupId()
Span
getDocumentGroupId
in interface Span
public java.lang.String getDocumentContents()
Span
Note: this differs subtly from documentSpan().asString(), which returns the string between the beginning of the first token and the end of the last token in the containing document.
getDocumentContents
in interface Span
public int size()
size
in interface Span
public TextToken getTextToken(int i)
getTextToken
in interface Span
public Token getToken(int i)
getToken
in interface Span
public Span subSpan(int start, int len)
subSpan
in interface Span
public SubSpan subSpan(int startIndex, int start, int len)
public Span documentSpan()
documentSpan
in interface Span
public int documentSpanStartIndex()
documentSpanStartIndex
in interface Span
public boolean contains(Span other)
Span
contains
in interface Span
public boolean overlaps(Span other)
Span
overlaps
in interface Span
public java.lang.String asString()
asString
in interface Span
public Span getLeftBoundary()
getLeftBoundary
in interface Span
public Span getRightBoundary()
getRightBoundary
in interface Span
public int compareTo(Span other)
compareTo
in interface java.lang.Comparable<Span>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public Span charIndexSubSpan(int lo, int hi)
Span
charIndexSubSpan
in interface Span
public Span charIndexProperSubSpan(int lo, int hi)
Span
charIndexProperSubSpan
in interface Span
public void setCharOffset(int charOffset)
setCharOffset
in interface Span
public int getCharOffset()
getCharOffset
in interface Span
public int getLoTextToken()
Span
getLoTextToken
in interface Span
public int getLoChar()
getLoChar
in interface Span
public int getHiChar()
getHiChar
in interface Span
public Viewer toGUI()
Visible
toGUI
in interface Visible
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |