|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.illinois.cs.cogcomp.lbj.coref.ir.Chunk
public class Chunk
Represents a chunk of text in the context of a document. Contains start and end characters and a mechanism for determining the start and end word numbers, and the words, contained in the chunk. Capable of being sorted.
| Field Summary | |
|---|---|
private Doc |
m_doc
|
private int |
m_end
In count characters |
private int |
m_start
|
private java.lang.String |
m_text
In count characters |
private static long |
serialVersionUID
This ID should change if the serialization changes. |
| Constructor Summary | |
|---|---|
Chunk(Doc d,
int start,
int end,
java.lang.String text)
Constructs a chunk given a range of characters, some text, and a document for context. |
|
| Method Summary | |
|---|---|
int |
compareTo(Chunk c)
Compare the chunk in a way that Sorts ascending, first by start positions, or if starts are equal, by end positions. |
boolean |
equals(java.lang.Object o)
Determines whether this chunk is equal to a specified object. |
java.lang.String |
getCleanText()
Gets a cleaned text that has newlines replaced with spaces. |
int |
getEnd()
Gets the end character number of the chunk. |
int |
getEndWN()
Gets the word number of the last word of the chunk. |
int |
getStart()
Gets the start character number of the chunk. |
int |
getStartWN()
Gets the word number of the first word of the chunk. |
java.lang.String |
getText()
Gets the text of the chunk. |
java.util.List<java.lang.String> |
getWords()
Gets the words of the chunk. |
int |
hashCode()
Gets the hash code of this chunk. |
java.lang.String |
toString()
Gets a string representation of the chunk |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private Doc m_doc
private int m_start
private int m_end
private java.lang.String m_text
| Constructor Detail |
|---|
public Chunk(Doc d,
int start,
int end,
java.lang.String text)
d - The document containing the chunk.
(Only a reference is kept; the document is not copied).start - The position of the character that starts this Chunk.end - The position of the character that ends this Chunk.text - A convenience access to the text between start and end.
This text should match the text in the character range in the document.
WARNING: text is not used for comparison or hashing.| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic int getStart()
public int getEnd()
public int getStartWN()
public int getEndWN()
public java.util.List<java.lang.String> getWords()
public java.lang.String getText()
public java.lang.String getCleanText()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - Any object.
public int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(Chunk c)
compareTo in interface java.lang.Comparable<Chunk>c - Another chunk.
c.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||