|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object opennlp.tools.coref.resolver.ResolverUtils
public class ResolverUtils
This class provides a set of utilities for turning mentions into normalized strings and features.
Field Summary | |
---|---|
static Pattern |
designatorsPattern
Regular expression for English corporate designators. |
static Pattern |
femalePronounPattern
Regular expression for English female pronouns. |
static Pattern |
firstPersonPronounPattern
Regular expression for English first person pronouns. |
static Pattern |
honorificsPattern
Regular expression for English honorifics. |
static Pattern |
malePronounPattern
Regular expression for English male pronouns. |
static Pattern |
neuterPronounPattern
Regular expression for English neuter pronouns. |
static Pattern |
pluralPronounPattern
Regular expression for English plural pronouns. |
static Pattern |
pluralThirdPersonPronounPattern
Regular expression for English plural third person pronouns. |
static Pattern |
secondPersonPronounPattern
Regular expression for English singular second person pronouns. |
static Pattern |
singularPronounPattern
Regular expression for English singular pronouns. |
static Pattern |
singularThirdPersonPronounPattern
Regular expression for English singular third person pronouns. |
static Pattern |
speechPronounPattern
Regular expression for English speech pronouns. |
static Pattern |
thirdPersonPronounPattern
Regular expression for English third person pronouns. |
Constructor Summary | |
---|---|
ResolverUtils()
|
Method Summary | |
---|---|
static Set<String> |
constructModifierSet(Parse[] tokens,
int headIndex)
|
static boolean |
definiteArticle(String tok,
String tag)
Returns whether the specified token is a definite article. |
static String |
excludedDeterminerMentionString(MentionContext ec)
|
static String |
excludedHonorificMentionString(MentionContext ec)
|
static String |
excludedTheMentionString(MentionContext ec)
|
static List<String> |
getCompatibilityFeatures(MentionContext mention,
DiscourseEntity entity,
TestSimilarityModel simModel)
Returns features indicating whether the specified mention and the specified entity are compatible. |
static List<String> |
getContextFeatures(MentionContext mention)
Returns a list of features based on the surrounding context of the specified mention. |
static List<String> |
getDistanceFeatures(MentionContext mention,
DiscourseEntity entity)
Returns distance features for the specified mention and entity. |
static String |
getExactMatchFeature(MentionContext ec,
MentionContext xec)
|
static String |
getGenderCompatibilityFeature(MentionContext ec,
DiscourseEntity de)
|
static String |
getMentionCountFeature(DiscourseEntity de)
|
static String |
getNumberCompatibilityFeature(MentionContext ec,
DiscourseEntity de)
|
static String |
getPronounGender(String pronoun)
Returns a string representing the gender of the specified pronoun. |
static List<String> |
getPronounMatchFeatures(MentionContext mention,
DiscourseEntity entity)
Returns features indicating whether the specified mention is compatible with the pronouns of the specified entity. |
static MentionContext |
getProperNounExtent(DiscourseEntity de)
|
static String |
getSemanticCompatibilityFeature(MentionContext ec,
DiscourseEntity de,
TestSimilarityModel simModel)
|
static List<String> |
getStringMatchFeatures(MentionContext mention,
DiscourseEntity entity)
Returns string-match features for the the specified mention and entity. |
static List<String> |
getWordFeatures(Parse token)
Returns a list of word features for the specified tokens. |
static boolean |
isSubstring(String ecStrip,
String xecStrip)
|
static String |
mentionString(MentionContext ec)
|
static String |
stripNp(MentionContext mention)
Returns a string for the specified mention with punctuation, honorifics, designators, and determiners removed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Pattern singularThirdPersonPronounPattern
public static final Pattern pluralThirdPersonPronounPattern
public static final Pattern speechPronounPattern
public static final Pattern femalePronounPattern
public static final Pattern neuterPronounPattern
public static final Pattern firstPersonPronounPattern
public static final Pattern secondPersonPronounPattern
public static final Pattern thirdPersonPronounPattern
public static final Pattern singularPronounPattern
public static final Pattern pluralPronounPattern
public static final Pattern malePronounPattern
public static final Pattern honorificsPattern
public static final Pattern designatorsPattern
Constructor Detail |
---|
public ResolverUtils()
Method Detail |
---|
public static List<String> getContextFeatures(MentionContext mention)
mention
- he mention whose surround context the features model.
public static List<String> getWordFeatures(Parse token)
token
- The token for which features are to be computed.
public static Set<String> constructModifierSet(Parse[] tokens, int headIndex)
public static String excludedDeterminerMentionString(MentionContext ec)
public static String excludedHonorificMentionString(MentionContext ec)
public static String excludedTheMentionString(MentionContext ec)
public static String getExactMatchFeature(MentionContext ec, MentionContext xec)
public static List<String> getStringMatchFeatures(MentionContext mention, DiscourseEntity entity)
mention
- The mention.entity
- The entity.
public static boolean isSubstring(String ecStrip, String xecStrip)
public static String mentionString(MentionContext ec)
public static String stripNp(MentionContext mention)
mention
- The mention to be striped.
public static MentionContext getProperNounExtent(DiscourseEntity de)
public static List<String> getPronounMatchFeatures(MentionContext mention, DiscourseEntity entity)
mention
- The mention.entity
- The entity.
public static List<String> getDistanceFeatures(MentionContext mention, DiscourseEntity entity)
mention
- The mention.entity
- The entity.
public static boolean definiteArticle(String tok, String tag)
tok
- The token.tag
- The pos-tag for the specified token.
public static String getNumberCompatibilityFeature(MentionContext ec, DiscourseEntity de)
public static List<String> getCompatibilityFeatures(MentionContext mention, DiscourseEntity entity, TestSimilarityModel simModel)
mention
- The mention.entity
- The entity.
public static String getGenderCompatibilityFeature(MentionContext ec, DiscourseEntity de)
public static String getSemanticCompatibilityFeature(MentionContext ec, DiscourseEntity de, TestSimilarityModel simModel)
public static String getMentionCountFeature(DiscourseEntity de)
public static String getPronounGender(String pronoun)
pronoun
- An English pronoun.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |