public abstract class AbstractMentionChain extends Object implements MentionChain
matchers() and killers(). This class manages the
fixed identifier, fixed entity type, variable maximum sentence
offset, and variable collection of mentions. When mentions are
added through add(Mention,int), the maximum sentence
offset and set of mentions are maintained. Subclasses may override
add, but should always call it.| Constructor and Description |
|---|
AbstractMentionChain(Mention mention,
int offset,
int identifier) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
add(Mention mention)
Adds the specified mention appearing at the specified sentence
offset to this mention chain.
|
void |
add(Mention mention,
int sentenceOffset)
Adds the specified mention appearing at the specified
sentence offset to this mention chain, and calls the
method
add(Mention), which may be overridden
by subclasses to carry out additional bookkeeping when
new mentions are added. |
void |
addHonorific(String honorific)
Add the specified honorific to the set of honorifics for
this chain.
|
String |
entityType()
Returns the entity type associated with this mention chain.
|
boolean |
equals(MentionChain that)
Returns
true if the specified mention chain is
equal to this mention chain. |
boolean |
equals(Object that)
Returns
true if the specified object is a mention
chain that is equal to this mention chain. |
String |
gender()
Returns the gender of this mention chain.
|
int |
hashCode()
Returns the hash code for this mention chain.
|
Set<String> |
honorifics()
Returns the set of honorifics for this mention chain.
|
int |
identifier()
Returns the unique identifier for this mention chain.
|
boolean |
killed(Mention mention)
Returns
true if there is a killing function that
defeats the match of the mention against the mention chain. |
abstract Killer[] |
killers()
The killing functions defined for this mention chain.
|
abstract Matcher[] |
matchers()
The matching functions defined for this mention chain.
|
int |
matchScore(Mention mention)
Returns the best match score of the mention versus the mention
chain according to the matching functions determined by the
antecedent.
|
int |
maxSentenceOffset()
Offset of the last sentence in which a mention belonging to
this mention chain appears.
|
Set<Mention> |
mentions()
Returns the set of mentions underlying this mention chain.
|
void |
setEntityType(String entityType)
Set the entity type of this mention chain to the specified value.
|
void |
setGender(String gender)
Set this chain's gender to the specified value.
|
String |
toString()
Returns a string representation of this mention chain.
|
public AbstractMentionChain(Mention mention, int offset, int identifier)
public void setGender(String gender)
gender - Value of gender.public void addHonorific(String honorific)
honorific - Honorific to add.public final Set<Mention> mentions()
mentions in interface MentionChainpublic final Set<String> honorifics()
honorifics in interface MentionChainpublic final String gender()
gender in interface MentionChainpublic final int maxSentenceOffset()
maxSentenceOffset in interface MentionChainpublic String entityType()
entityType in interface MentionChainpublic void setEntityType(String entityType)
entityType - New type for this mention chain.public final void add(Mention mention, int sentenceOffset)
add(Mention), which may be overridden
by subclasses to carry out additional bookkeeping when
new mentions are added.add in interface MentionChainmention - Mention to add to this chain.sentenceOffset - Offset of mention added.protected void add(Mention mention)
add(Mention,int) when a mention is added.
The implementation provided here does nothing, but subclasses may override it to carry out additional bookkeeping when new mentions are added.
mention - Mention to add to this chain.public final int identifier()
identifier in interface MentionChainpublic final boolean killed(Mention mention)
true if there is a killing function that
defeats the match of the mention against the mention chain. A
true return means that the mention will not
be allowed to match against the antecedent no matter what other
matching functions return.killed in interface MentionChainmention - Mention to test against antecedent.true if there is a killing function that
defeats the match of the mention against the mention chain.public final int matchScore(Mention mention)
Matcher.NO_MATCH_SCORE
indicates that all matching functions failed. Otherwise, the
score will fall in the range 0 to Matcher.MAX_SCORE, with a lower score being better.matchScore in interface MentionChainmention - Mention to score against antecedent.public boolean equals(Object that)
true if the specified object is a mention
chain that is equal to this mention chain.public boolean equals(MentionChain that)
true if the specified mention chain is
equal to this mention chain.that - Mention chain to test for equality with this
mention chain.true if the mention chains are equal.public int hashCode()
public String toString()
public abstract Matcher[] matchers()
public abstract Killer[] killers()
Copyright © 2019 Alias-i, Inc.. All rights reserved.