com.aliasi.coref
Class AbstractMentionFactory

java.lang.Object
  extended by com.aliasi.coref.AbstractMentionFactory
All Implemented Interfaces:
MentionFactory
Direct Known Subclasses:
EnglishMentionFactory

public abstract class AbstractMentionFactory
extends Object
implements MentionFactory

The 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.

Since:
LingPipe1.0
Version:
3.8
Author:
Bob Carpenter

Constructor Summary
AbstractMentionFactory(TokenizerFactory tokenizerFactory)
          Construct an abstract mention factory with the specified tokenizer factory.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMentionFactory

public AbstractMentionFactory(TokenizerFactory tokenizerFactory)
Construct an abstract mention factory with the specified tokenizer factory.

Parameters:
tokenizerFactory - Tokenizer factory for this mention factory.
Method Detail

create

public Mention create(String phrase,
                      String entityType)
Return a mention based on the specified phrase and entity type.

Specified by:
create in interface MentionFactory
Parameters:
phrase - Phrase underlying the mention created.
entityType - Type of the mention created.
Returns:
A mention based on the specified phrase and entity type.

promote

public MentionChain promote(Mention mention,
                            int offset)
Returns a new mention chain based on the specified mention.

Specified by:
promote in interface MentionFactory
Parameters:
mention - Mention to promote to a mention chain.
Returns:
Mention chain constructed from the specified mention.

isHonorific

protected abstract boolean isHonorific(String token)
Returns true if the specified token is an honorific.

Parameters:
token - Token to test.
Returns:
true if the specified token is an honorific.

gender

protected abstract String gender(String entityType)
Returns a string rerpesenting the gender entities with the specified entity type.

Parameters:
entityType - Entity type from which to extract gender.
Returns:
Gender corresponding to the specified entity type.

isPronominal

protected abstract boolean isPronominal(String entityType)
Returns true if the specified entity type is a pronominal type.

Parameters:
entityType - Type of entity to test.
Returns:
true if the specified entity type is pronominal.

normalizeToken

protected abstract String normalizeToken(String token)
Returns a normalized version of the specified token.

Parameters:
token - Token to normalize.
Returns:
Normalized version of token.