edu.stanford.nlp.trees
Class CollinsHeadFinder
java.lang.Object
edu.stanford.nlp.trees.AbstractCollinsHeadFinder
edu.stanford.nlp.trees.CollinsHeadFinder
- All Implemented Interfaces:
- HeadFinder, Serializable
- Direct Known Subclasses:
- ModCollinsHeadFinder
public class CollinsHeadFinder
- extends AbstractCollinsHeadFinder
Implements the HeadFinder found in Michael Collins' 1999 thesis.
Except: we've added a head rule for NX, which returns the leftmost item.
No rule for the head of NX is found in any of the versions of
Collins' head table that we have (did he perhaps use the NP rules
for NX? -- no Bikel, CL, 2005 says it defaults to leftmost).
These rules are suitable for the Penn Treebank.
May 2004: Added support for AUX and AUXG to the VP rules; these cause
no interference in Penn Treebank parsing, but means that these rules
also work for the BLLIP corpus (or Charniak parser output in general).
Feb 2005: Fixes to coordination reheading so that punctuation cannot
become head.
- Author:
- Christopher Manning
- See Also:
- Serialized Form
Method Summary |
static void |
main(String[] args)
Go through trees and determine their heads and print them. |
protected int |
postOperationFix(int headIdx,
Tree[] daughterTrees)
A way for subclasses to fix any heads under special conditions
The default does nothing. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollinsHeadFinder
public CollinsHeadFinder()
CollinsHeadFinder
public CollinsHeadFinder(TreebankLanguagePack tlp)
postOperationFix
protected int postOperationFix(int headIdx,
Tree[] daughterTrees)
- Description copied from class:
AbstractCollinsHeadFinder
- A way for subclasses to fix any heads under special conditions
The default does nothing.
- Overrides:
postOperationFix
in class AbstractCollinsHeadFinder
- Parameters:
headIdx
- the index of the proposed headdaughterTrees
- the array of daughter trees
- Returns:
- the new headIndex
main
public static void main(String[] args)
- Go through trees and determine their heads and print them.
Just for debuggin'.
Usage:
java edu.stanford.nlp.trees.CollinsHeadFinder treebankFilePath
- Parameters:
args
- The treebankFilePath
Stanford NLP Group