opennlp.tools.coref.mention
Class AbstractMentionFinder

java.lang.Object
  extended by opennlp.tools.coref.mention.AbstractMentionFinder
All Implemented Interfaces:
MentionFinder
Direct Known Subclasses:
PTBMentionFinder, ShallowParseMentionFinder

public abstract class AbstractMentionFinder
extends Object
implements MentionFinder

Provides default implementation of many of the methods in the MentionFinder interface.


Field Summary
protected  boolean collectCoordinatedNounPhrases
           
protected  boolean collectPrenominalNamedEntities
           
protected  HeadFinder headFinder
           
 
Constructor Summary
AbstractMentionFinder()
           
 
Method Summary
protected  Map<Parse,Parse> constructHeadMap(List<Parse> nps)
          Assigns head relations between noun phrases and the child np which is their head.
 Mention[] getMentions(Parse p)
          Returns an array of mentions.
 List<Parse> getNamedEntities(Parse p)
          Return all noun phrases which are contained by p.
protected  boolean isBasalNounPhrase(Parse np)
           
protected  boolean isConjoinedBasal(Parse np)
           
 boolean isCoordinatedNounPhraseCollection()
          Returns whether this mention finder collects coordinated noun phrases as mentions.
protected  boolean isOfPrepPhrase(Parse np)
           
protected  boolean isPossessive(Parse np)
           
 boolean isPrenominalNamedEntityCollection()
          Returns whether this mention finder collects pre-nominal named-entities as mentions.
 void setCoordinatedNounPhraseCollection(boolean b)
          Specifies whether coordinated noun phrases should be collected as mentions.
 void setPrenominalNamedEntityCollection(boolean b)
          Specifies whether pre-nominal named-entities should be collected as mentions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

headFinder

protected HeadFinder headFinder

collectPrenominalNamedEntities

protected boolean collectPrenominalNamedEntities

collectCoordinatedNounPhrases

protected boolean collectCoordinatedNounPhrases
Constructor Detail

AbstractMentionFinder

public AbstractMentionFinder()
Method Detail

constructHeadMap

protected Map<Parse,Parse> constructHeadMap(List<Parse> nps)
Assigns head relations between noun phrases and the child np which is their head.

Parameters:
nps - List of valid nps for this mention finder.
Returns:
mapping from noun phrases and the child np which is their head

isPrenominalNamedEntityCollection

public boolean isPrenominalNamedEntityCollection()
Description copied from interface: MentionFinder
Returns whether this mention finder collects pre-nominal named-entities as mentions.

Specified by:
isPrenominalNamedEntityCollection in interface MentionFinder
Returns:
true if this mention finder collects pre-nominal named-entities as mentions

setPrenominalNamedEntityCollection

public void setPrenominalNamedEntityCollection(boolean b)
Description copied from interface: MentionFinder
Specifies whether pre-nominal named-entities should be collected as mentions.

Specified by:
setPrenominalNamedEntityCollection in interface MentionFinder
Parameters:
b - true if pre-nominal named-entities should be collected; false otherwise.

isBasalNounPhrase

protected boolean isBasalNounPhrase(Parse np)

isPossessive

protected boolean isPossessive(Parse np)

isOfPrepPhrase

protected boolean isOfPrepPhrase(Parse np)

isConjoinedBasal

protected boolean isConjoinedBasal(Parse np)

getNamedEntities

public List<Parse> getNamedEntities(Parse p)
Return all noun phrases which are contained by p.

Parameters:
p - The parse in which to find the noun phrases.
Returns:
A list of Parse objects which are noun phrases contained by p.

getMentions

public Mention[] getMentions(Parse p)
Description copied from interface: MentionFinder
Returns an array of mentions.

Specified by:
getMentions in interface MentionFinder
Parameters:
p - A top level parse from which mentions are gathered.
Returns:
an array of mentions which implement the Extent interface.

isCoordinatedNounPhraseCollection

public boolean isCoordinatedNounPhraseCollection()
Description copied from interface: MentionFinder
Returns whether this mention finder collects coordinated noun phrases as mentions.

Specified by:
isCoordinatedNounPhraseCollection in interface MentionFinder
Returns:
true if this mention finder collects coordinated noun phrases as mentions; false otherwise.

setCoordinatedNounPhraseCollection

public void setCoordinatedNounPhraseCollection(boolean b)
Description copied from interface: MentionFinder
Specifies whether coordinated noun phrases should be collected as mentions.

Specified by:
setCoordinatedNounPhraseCollection in interface MentionFinder
Parameters:
b - true if coordinated noun phrases should be collected; false otherwise.


Copyright © 2010. All Rights Reserved.