public abstract class AbstractMentionFactory extends Object implements MentionFactory
AbstractMentionFactory class implements the
mention factory interface using linguistically-motivated abstract
methods. These methods control gender, honorific status,
pronominal status, as well as providing a way to normalize tokens
for comparison. Furthermore, this class provides a way of generating
a new mention chain composed of a single mention.| Constructor and Description |
|---|
AbstractMentionFactory(TokenizerFactory tokenizerFactory)
Construct an abstract mention factory with the specified
tokenizer factory.
|
| Modifier and Type | Method and Description |
|---|---|
Mention |
create(String phrase,
String entityType)
Return a mention based on the specified phrase and entity type.
|
protected abstract String |
gender(String entityType)
Returns a string rerpesenting the gender entities
with the specified entity type.
|
protected abstract boolean |
isHonorific(String token)
Returns
true if the specified token is an
honorific. |
protected abstract boolean |
isPronominal(String entityType)
Returns
true if the specified entity type
is a pronominal type. |
protected abstract String |
normalizeToken(String token)
Returns a normalized version of the specified token.
|
MentionChain |
promote(Mention mention,
int offset)
Returns a new mention chain based on the specified mention.
|
public AbstractMentionFactory(TokenizerFactory tokenizerFactory)
tokenizerFactory - Tokenizer factory for this mention
factory.public Mention create(String phrase, String entityType)
create in interface MentionFactoryphrase - Phrase underlying the mention created.entityType - Type of the mention created.public MentionChain promote(Mention mention, int offset)
promote in interface MentionFactorymention - Mention to promote to a mention chain.protected abstract boolean isHonorific(String token)
true if the specified token is an
honorific.token - Token to test.true if the specified token is an
honorific.protected abstract String gender(String entityType)
entityType - Entity type from which to extract gender.protected abstract boolean isPronominal(String entityType)
true if the specified entity type
is a pronominal type.entityType - Type of entity to test.true if the specified entity type is
pronominal.Copyright © 2016 Alias-i, Inc.. All rights reserved.