edu.stanford.nlp.parser.lexparser
Class SisterAnnotationStats

java.lang.Object
  extended by edu.stanford.nlp.parser.lexparser.SisterAnnotationStats
All Implemented Interfaces:
TreeVisitor

public class SisterAnnotationStats
extends Object
implements TreeVisitor

See what parent annotation helps in treebank, based on support and KL divergence. Some code borrowing from ParentAnnotationStats.

Author:
Roger Levy

Field Summary
static double[] CUTOFFS
          Minimum support * KL to be included in output and as feature
static boolean DO_TAGS
           
static double SUPPCUTOFF
          Minimum support of parent annotated node for grandparent to be studied.
 
Constructor Summary
SisterAnnotationStats()
           
 
Method Summary
static List kidLabels(Tree t)
           
static List leftSisterLabels(Tree t, Tree p)
          string-value labels of left sisters; from inside to outside (right-left)
static void main(String[] args)
          Calculate sister annotation statistics suitable for doing selective sister splitting in the PCFGParser inside the FactoredParser.
 void printStats()
           
 void recurse(Tree t, Tree p)
          p is parent
static List rightSisterLabels(Tree t, Tree p)
          string-value labels of right sisters; from inside to outside (left-right)
protected  void sideCounters(String label, List rewrite, List sideSisters, Map sideRules)
           
protected  void sisterCounters(Tree t, Tree p)
           
 void visitTree(Tree t)
          Does whatever one needs to do to a particular parse tree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DO_TAGS

public static final boolean DO_TAGS
See Also:
Constant Field Values

CUTOFFS

public static final double[] CUTOFFS
Minimum support * KL to be included in output and as feature


SUPPCUTOFF

public static final double SUPPCUTOFF
Minimum support of parent annotated node for grandparent to be studied. Just there to reduce runtime and printout size.

See Also:
Constant Field Values
Constructor Detail

SisterAnnotationStats

public SisterAnnotationStats()
Method Detail

visitTree

public void visitTree(Tree t)
Does whatever one needs to do to a particular parse tree

Specified by:
visitTree in interface TreeVisitor
Parameters:
t - A tree. Classes implementing this interface can assume that the tree passed in is not null.

recurse

public void recurse(Tree t,
                    Tree p)
p is parent


leftSisterLabels

public static List leftSisterLabels(Tree t,
                                    Tree p)
string-value labels of left sisters; from inside to outside (right-left)


rightSisterLabels

public static List rightSisterLabels(Tree t,
                                     Tree p)
string-value labels of right sisters; from inside to outside (left-right)


kidLabels

public static List kidLabels(Tree t)

sisterCounters

protected void sisterCounters(Tree t,
                              Tree p)

sideCounters

protected void sideCounters(String label,
                            List rewrite,
                            List sideSisters,
                            Map sideRules)

printStats

public void printStats()

main

public static void main(String[] args)
Calculate sister annotation statistics suitable for doing selective sister splitting in the PCFGParser inside the FactoredParser.

Parameters:
args - One argument: path to the Treebank


Stanford NLP Group