public class Rules
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.util.regex.Pattern |
WHITESPACE_PATTERN |
Constructor and Description |
---|
Rules() |
Modifier and Type | Method and Description |
---|---|
static boolean |
antecedentIsMentionSpeaker(Document document,
Mention mention,
Mention ant,
Dictionaries dict)
Is the speaker for mention the same entity as the ant entity?
|
static boolean |
antecedentMatchesMentionSpeakerAnnotation(Mention mention,
Mention ant)
Is the speaker for mention the same entity as the ant entity?
|
static boolean |
antecedentMatchesMentionSpeakerAnnotation(Mention mention,
Mention ant,
Document document)
The antecedent matches the speaker annotation found in the mention
|
static boolean |
contextIncompatible(Mention men,
Mention ant,
Dictionaries dict) |
static boolean |
entityAlias(CorefCluster mentionCluster,
CorefCluster potentialAntecedent,
Semantics semantics,
Dictionaries dict) |
static boolean |
entityAttributesAgree(CorefCluster mentionCluster,
CorefCluster potentialAntecedent) |
static boolean |
entityAttributesAgree(CorefCluster mentionCluster,
CorefCluster potentialAntecedent,
boolean ignoreGender) |
static boolean |
entityBothHaveProper(CorefCluster mentionCluster,
CorefCluster potentialAntecedent) |
static boolean |
entityClusterAllCorefDictionary(CorefCluster menCluster,
CorefCluster antCluster,
Dictionaries dict,
int dictColumn,
int freq) |
static boolean |
entityCorefDictionary(Mention men,
Mention ant,
Dictionaries dict,
int dictVersion,
int freq) |
static boolean |
entityExactStringMatch(CorefCluster mentionCluster,
CorefCluster potentialAntecedent,
Dictionaries dict,
java.util.Set<Mention> roleSet) |
static boolean |
entityHaveDifferentLocation(Mention m,
Mention a,
Dictionaries dict) |
static boolean |
entityHaveExtraProperNoun(Mention m,
Mention a,
java.util.Set<java.lang.String> exceptWords)
Have extra proper noun except strings involved in semantic match
|
static boolean |
entityHaveIncompatibleModifier(CorefCluster mentionCluster,
CorefCluster potentialAntecedent)
Compatible modifier only
|
static boolean |
entityHaveIncompatibleModifier(Mention m,
Mention ant)
Check whether later mention has incompatible modifier
|
static boolean |
entityHeadsAgree(CorefCluster mentionCluster,
CorefCluster potentialAntecedent,
Mention m,
Mention ant,
Dictionaries dict) |
static boolean |
entityIsAcronym(Document document,
CorefCluster mentionCluster,
CorefCluster potentialAntecedent) |
static boolean |
entityIsApposition(CorefCluster mentionCluster,
CorefCluster potentialAntecedent,
Mention m1,
Mention m2) |
static boolean |
entityIsPredicateNominatives(CorefCluster mentionCluster,
CorefCluster potentialAntecedent,
Mention m1,
Mention m2) |
static boolean |
entityIsRelativePronoun(Mention m1,
Mention m2) |
static boolean |
entityIsRoleAppositive(CorefCluster mentionCluster,
CorefCluster potentialAntecedent,
Mention m1,
Mention m2,
Dictionaries dict) |
static boolean |
entityIWithinI(CorefCluster mentionCluster,
CorefCluster potentialAntecedent,
Dictionaries dict) |
static boolean |
entityIWithinI(Mention m1,
Mention m2,
Dictionaries dict)
Check whether two mentions are in i-within-i relation (Chomsky, 1981)
|
static boolean |
entityNumberInLaterMention(Mention mention,
Mention ant)
Check whether there is a new number in later mention
|
static boolean |
entityPersonDisagree(Document document,
CorefCluster mentionCluster,
CorefCluster potentialAntecedent,
Dictionaries dict) |
static boolean |
entityPersonDisagree(Document document,
Mention m,
Mention ant,
Dictionaries dict) |
static boolean |
entityRelaxedExactStringMatch(CorefCluster mentionCluster,
CorefCluster potentialAntecedent,
Mention mention,
Mention ant,
Dictionaries dict,
java.util.Set<Mention> roleSet)
Exact string match except phrase after head (only for proper noun):
For dealing with a error like {@literal "[Mr.
|
static boolean |
entityRelaxedHeadsAgreeBetweenMentions(CorefCluster mentionCluster,
CorefCluster potentialAntecedent,
Mention m,
Mention ant) |
static boolean |
entitySameProperHeadLastWord(CorefCluster mentionCluster,
CorefCluster potentialAntecedent,
Mention mention,
Mention ant) |
static boolean |
entitySameProperHeadLastWord(Mention m,
Mention a)
Check whether two mentions have the same proper head words
|
static boolean |
entitySameSpeaker(Document document,
Mention m,
Mention ant)
Do the mentions share the same speaker?
|
static boolean |
entitySubjectObject(Mention m1,
Mention m2) |
static boolean |
entityTokenDistance(Mention m1,
Mention m2) |
static boolean |
entityWordsIncluded(CorefCluster mentionCluster,
CorefCluster potentialAntecedent,
Mention mention,
Mention ant)
Word inclusion except stop words
|
static int |
getSpeakerClusterId(Document document,
java.lang.String speakerString)
Given the name of a speaker, returns the coref cluster id it belongs to (-1 if no cluster)
|
static boolean |
isAcronym(java.util.List<CoreLabel> first,
java.util.List<CoreLabel> second) |
static boolean |
mentionMatchesSpeaker(Mention mention,
SpeakerInfo speakerInfo,
boolean strictMatch) |
static boolean |
sentenceContextIncompatible(Mention men,
Mention ant,
Dictionaries dict) |
public static boolean entityBothHaveProper(CorefCluster mentionCluster, CorefCluster potentialAntecedent)
public static boolean entitySameProperHeadLastWord(CorefCluster mentionCluster, CorefCluster potentialAntecedent, Mention mention, Mention ant)
public static boolean entityAlias(CorefCluster mentionCluster, CorefCluster potentialAntecedent, Semantics semantics, Dictionaries dict) throws java.lang.Exception
java.lang.Exception
public static boolean entityIWithinI(CorefCluster mentionCluster, CorefCluster potentialAntecedent, Dictionaries dict)
public static boolean entityPersonDisagree(Document document, CorefCluster mentionCluster, CorefCluster potentialAntecedent, Dictionaries dict)
public static boolean entityWordsIncluded(CorefCluster mentionCluster, CorefCluster potentialAntecedent, Mention mention, Mention ant)
public static boolean entityHaveIncompatibleModifier(CorefCluster mentionCluster, CorefCluster potentialAntecedent)
public static boolean entityIsRoleAppositive(CorefCluster mentionCluster, CorefCluster potentialAntecedent, Mention m1, Mention m2, Dictionaries dict)
public static boolean entityIsAcronym(Document document, CorefCluster mentionCluster, CorefCluster potentialAntecedent)
public static boolean isAcronym(java.util.List<CoreLabel> first, java.util.List<CoreLabel> second)
public static boolean entityIsPredicateNominatives(CorefCluster mentionCluster, CorefCluster potentialAntecedent, Mention m1, Mention m2)
public static boolean entityIsApposition(CorefCluster mentionCluster, CorefCluster potentialAntecedent, Mention m1, Mention m2)
public static boolean entityAttributesAgree(CorefCluster mentionCluster, CorefCluster potentialAntecedent)
public static boolean entityAttributesAgree(CorefCluster mentionCluster, CorefCluster potentialAntecedent, boolean ignoreGender)
public static boolean entityRelaxedHeadsAgreeBetweenMentions(CorefCluster mentionCluster, CorefCluster potentialAntecedent, Mention m, Mention ant)
public static boolean entityHeadsAgree(CorefCluster mentionCluster, CorefCluster potentialAntecedent, Mention m, Mention ant, Dictionaries dict)
public static boolean entityExactStringMatch(CorefCluster mentionCluster, CorefCluster potentialAntecedent, Dictionaries dict, java.util.Set<Mention> roleSet)
public static boolean entityRelaxedExactStringMatch(CorefCluster mentionCluster, CorefCluster potentialAntecedent, Mention mention, Mention ant, Dictionaries dict, java.util.Set<Mention> roleSet)
public static boolean entityIWithinI(Mention m1, Mention m2, Dictionaries dict)
public static boolean entityHaveIncompatibleModifier(Mention m, Mention ant)
public static boolean entityHaveDifferentLocation(Mention m, Mention a, Dictionaries dict)
public static boolean entitySameProperHeadLastWord(Mention m, Mention a)
public static boolean entityNumberInLaterMention(Mention mention, Mention ant)
public static boolean entityHaveExtraProperNoun(Mention m, Mention a, java.util.Set<java.lang.String> exceptWords)
public static boolean antecedentIsMentionSpeaker(Document document, Mention mention, Mention ant, Dictionaries dict)
public static boolean antecedentMatchesMentionSpeakerAnnotation(Mention mention, Mention ant)
public static boolean antecedentMatchesMentionSpeakerAnnotation(Mention mention, Mention ant, Document document)
public static boolean mentionMatchesSpeaker(Mention mention, SpeakerInfo speakerInfo, boolean strictMatch)
public static boolean entityPersonDisagree(Document document, Mention m, Mention ant, Dictionaries dict)
public static boolean entitySameSpeaker(Document document, Mention m, Mention ant)
public static int getSpeakerClusterId(Document document, java.lang.String speakerString)
document
- The document to search inspeakerString
- The name to search forpublic static boolean entityClusterAllCorefDictionary(CorefCluster menCluster, CorefCluster antCluster, Dictionaries dict, int dictColumn, int freq)
public static boolean entityCorefDictionary(Mention men, Mention ant, Dictionaries dict, int dictVersion, int freq)
public static boolean contextIncompatible(Mention men, Mention ant, Dictionaries dict)
public static boolean sentenceContextIncompatible(Mention men, Mention ant, Dictionaries dict)