|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.languagecomputer.api.text.DefaultText com.languagecomputer.api.text.DefaultMentionChain
public class DefaultMentionChain
Default implementation of an MentionChain
.
DefaultText
Field Summary |
---|
Fields inherited from interface com.languagecomputer.api.text.MentionChain |
---|
TYPE |
Constructor Summary | |
---|---|
DefaultMentionChain()
Creates a new DefaultMentionChain . |
Method Summary | |
---|---|
void |
addMention(Text text)
Adds a new mention to the DefaultMentionChain . |
int |
getEndCharOffset()
Returns the (exclusive) end character offset for this Text
object within the (processed) Document . This offset does not
necessarily line up with the start character offset from the unprocessed
document/file. |
List<Text> |
getMentions()
Returns the mentions in this chain. |
int |
getStartCharOffset()
Returns the start character offset for this Text object within
the (processed) Document . This offset does not necessarily line up
with the start character offset from the unprocessed document/file. |
void |
setAnnotationType(AnnotationType annType)
Not necessary: defaults to MentionChain.TYPE . |
void |
setEndCharOffset(int endOffset)
Not allowed: getEndCharOffset() can only return
Text.getEndCharOffset() |
void |
setStartCharOffset(int startOffset)
Not allowed: getStartCharOffset() can only return
0 . |
String |
toString()
Returns a String representation of a
DefaultMentionChain . |
Methods inherited from class com.languagecomputer.api.text.DefaultText |
---|
getAnnotationType, getCongruentAnnotations, getDocument, getDocumentID, getIntersectingAnnotations, getRawString, getSubAnnotations, getSuperAnnotations, setDocument, setRawString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.languagecomputer.api.text.Text |
---|
getAnnotationType, getCongruentAnnotations, getDocument, getDocumentID, getIntersectingAnnotations, getRawString, getSubAnnotations, getSuperAnnotations |
Constructor Detail |
---|
public DefaultMentionChain()
DefaultMentionChain
.
Method Detail |
---|
public void setAnnotationType(AnnotationType annType)
MentionChain.TYPE
.
setAnnotationType
in class DefaultText
annType
- AnnotationType
to use for this
DefaultMentionChain
.Text.getAnnotationType()
,
AnnotationType
public final void setStartCharOffset(int startOffset)
getStartCharOffset()
can only return
0
.
setStartCharOffset
in class DefaultText
startOffset
- (ignored)
UnsupportedOperationException
- Cannot be called.Text.getStartCharOffset()
public int getStartCharOffset()
Text
object within
the (processed) Document
. This offset does not necessarily line up
with the start character offset from the unprocessed document/file.
getStartCharOffset
in interface Text
getStartCharOffset
in class DefaultText
public final void setEndCharOffset(int endOffset)
getEndCharOffset()
can only return
Text.getEndCharOffset()
setEndCharOffset
in class DefaultText
endOffset
- (ignored)
UnsupportedOperationException
- Cannot be called.Text.getEndCharOffset()
public int getEndCharOffset()
Text
object within the (processed) Document
. This offset does not
necessarily line up with the start character offset from the unprocessed
document/file.
getEndCharOffset
in interface Text
getEndCharOffset
in class DefaultText
public void addMention(Text text)
DefaultMentionChain
.
text
- The mention Text
to add to this
DefaultMentionChain
.getMentions()
public List<Text> getMentions()
Document
. In future
revisions, there might be a getBestMention
method that
identifies the most explicit mention, but for now a good heuristic is just
to take the first item (or the biggest item) in the returned list.
getMentions
in interface MentionChain
List
of mentions that all refer to the same thing.public String toString()
String
representation of a
DefaultMentionChain
.
toString
in class DefaultText
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |