opennlp.tools.coref.mention
Class PTBHeadFinder

java.lang.Object
  extended by opennlp.tools.coref.mention.PTBHeadFinder
All Implemented Interfaces:
HeadFinder

public final class PTBHeadFinder
extends Object
implements HeadFinder

Finds head information from Penn Treebank style parses.


Method Summary
 Parse getHead(Parse p)
          Returns the child parse which contains the lexical head of the specified parse.
 int getHeadIndex(Parse p)
          Returns which index the specified list of token is the head word.
 Parse getHeadToken(Parse p)
          Returns head token for the specified np parse.
static HeadFinder getInstance()
          Returns an instance of this head finder.
 Parse getLastHead(Parse p)
          Returns the bottom-most head of a Parse.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static HeadFinder getInstance()
Returns an instance of this head finder.

Returns:
an instance of this head finder.

getHead

public Parse getHead(Parse p)
Description copied from interface: HeadFinder
Returns the child parse which contains the lexical head of the specified parse.

Specified by:
getHead in interface HeadFinder
Parameters:
p - The parse in which to find the head.
Returns:
The parse containing the lexical head of the specified parse. If no head is available or the constituent has no sub-components that are eligible heads then null is returned.

getHeadIndex

public int getHeadIndex(Parse p)
Description copied from interface: HeadFinder
Returns which index the specified list of token is the head word.

Specified by:
getHeadIndex in interface HeadFinder
Parameters:
p - The parse in which to find the head index.
Returns:
The index of the head token.

getLastHead

public Parse getLastHead(Parse p)
Returns the bottom-most head of a Parse. If no head is available which is a child of p then p is returned.

Specified by:
getLastHead in interface HeadFinder
Parameters:
p - Parse to find the head of.
Returns:
bottom-most head of p.

getHeadToken

public Parse getHeadToken(Parse p)
Description copied from interface: HeadFinder
Returns head token for the specified np parse.

Specified by:
getHeadToken in interface HeadFinder
Parameters:
p - The noun parse to get head from.
Returns:
head token parse.


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.