|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object opennlp.tools.coref.mention.Mention opennlp.tools.coref.sim.Context opennlp.tools.coref.mention.MentionContext
public class MentionContext
Data structure representation of a mention with additional contextual information. The contextual information is used in performing coreference resolution.
Field Summary |
---|
Fields inherited from class opennlp.tools.coref.sim.Context |
---|
headTokenIndex, headTokenTag, headTokenText, synsets, tokens |
Fields inherited from class opennlp.tools.coref.mention.Mention |
---|
nameType, parse, type |
Constructor Summary | |
---|---|
MentionContext(Mention mention,
int mentionIndexInSentence,
int mentionsInSentence,
int mentionIndexInDocument,
int sentenceIndex,
HeadFinder headFinder)
Constructs context information for the specified mention. |
|
MentionContext(Span span,
Span headSpan,
int entityId,
Parse parse,
String extentType,
String nameType,
int mentionIndex,
int mentionsInSentence,
int mentionIndexInDocument,
int sentenceIndex,
HeadFinder headFinder)
|
Method Summary | |
---|---|
Parse |
getFirstToken()
Returns the parse for the first token in this mention. |
String |
getFirstTokenTag()
Returns the pos-tag of the first token of this mention. |
String |
getFirstTokenText()
Returns the text for the first token of the mention. |
GenderEnum |
getGender()
Returns the gender of this mention. |
double |
getGenderProb()
Returns the probability associated with the gender assignment. |
Parse |
getHead()
|
String |
getHeadText()
|
Parse |
getHeadTokenParse()
Returns the parse of the head token for this mention. |
Span |
getIndexSpan()
Returns a sentence-based token span for this mention. |
int |
getMaxNounPhraseSentenceIndex()
Returns the index of the last noun phrase in the sentence containing this mention. |
Parse |
getNextToken()
|
Parse |
getNextTokenBasal()
|
int |
getNonDescriptorStart()
|
int |
getNounPhraseDocumentIndex()
Returns the index of the noun phrase for this mention in a document. |
int |
getNounPhraseSentenceIndex()
Returns the index of the noun phrase for this mention in a sentence. |
NumberEnum |
getNumber()
Returns the number of this mention. |
double |
getNumberProb()
Returns the probability associated with the number assignment. |
Parse |
getPreviousToken()
|
int |
getSentenceNumber()
Returns the index of the sentence which contains this mention. |
Parse[] |
getTokenParses()
Returns the parses for the tokens which are contained in this mention. |
void |
setGender(GenderEnum gender,
double probability)
Assigns the specified gender with the specified probability to this mention. |
void |
setNumber(NumberEnum number,
double probability)
Assigns the specified number with the specified probability to this mention. |
String |
toText()
Returns the text of this mention. |
Methods inherited from class opennlp.tools.coref.sim.Context |
---|
constructContexts, getHeadTokenIndex, getHeadTokenTag, getHeadTokenText, getSynsets, getTokens, parseContext, toString |
Methods inherited from class opennlp.tools.coref.mention.Mention |
---|
compareTo, getHeadSpan, getId, getNameType, getParse, getSpan, setId, setNameType, setParse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MentionContext(Span span, Span headSpan, int entityId, Parse parse, String extentType, String nameType, int mentionIndex, int mentionsInSentence, int mentionIndexInDocument, int sentenceIndex, HeadFinder headFinder)
public MentionContext(Mention mention, int mentionIndexInSentence, int mentionsInSentence, int mentionIndexInDocument, int sentenceIndex, HeadFinder headFinder)
mention
- The mention object on which this object is based.mentionIndexInSentence
- The mention's position in the sentence.mentionsInSentence
- The number of mentions in the sentence.mentionIndexInDocument
- The index of this mention with respect to the document.sentenceIndex
- The index of the sentence which contains this mention.headFinder
- An object which provides head information.Method Detail |
---|
public Parse getHeadTokenParse()
public String getHeadText()
public Parse getHead()
public int getNonDescriptorStart()
public Span getIndexSpan()
public int getNounPhraseSentenceIndex()
public int getNounPhraseDocumentIndex()
public int getMaxNounPhraseSentenceIndex()
public Parse getNextTokenBasal()
public Parse getPreviousToken()
public Parse getNextToken()
public int getSentenceNumber()
public Parse getFirstToken()
public String getFirstTokenText()
public String getFirstTokenTag()
public Parse[] getTokenParses()
public String toText()
public void setGender(GenderEnum gender, double probability)
gender
- The gender to be given to this mention.probability
- The probability associated with the gender assignment.public GenderEnum getGender()
public double getGenderProb()
public void setNumber(NumberEnum number, double probability)
number
- The number to be given to this mention.probability
- The probability associated with the number assignment.public NumberEnum getNumber()
public double getNumberProb()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |