edu.stanford.nlp.parser.lexparser
Class DependencyGrammar

java.lang.Object
  extended byedu.stanford.nlp.parser.lexparser.DependencyGrammar
All Implemented Interfaces:
Serializable

public class DependencyGrammar
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
 double distanceDecay
           
 double[] interp
           
protected  int numTagBins
           
protected  int numTags
           
protected  int numWords
           
 double[] smooth
           
protected  int[] tagBin
           
protected static edu.stanford.nlp.parser.lexparser.DependencyGrammar.EndHead tempEndHead
           
 
Constructor Summary
DependencyGrammar()
           
DependencyGrammar(int numWords, int numTags)
           
DependencyGrammar(edu.stanford.nlp.parser.lexparser.TagProjection tagProjection)
           
 
Method Summary
 void addRule(edu.stanford.nlp.parser.lexparser.Dependency dependency, double count)
           
protected static short distanceBin(int distance)
           
 Counter getCoreDependencies()
           
static int NUMDISTBIN()
           
 int numTagBins()
           
static boolean pruneTW(IntTaggedWord argTW)
           
 void readData(BufferedReader in)
          Populates data in this DependencyGrammar from the character stream given by the Reader r.
static boolean rootTW(IntTaggedWord rTW)
           
 double score(edu.stanford.nlp.parser.lexparser.Dependency dependency)
           
 double score(int headWord, int headTag, int argWord, int argTag, boolean leftHeaded, int dist)
           
protected  double scoreAll(Collection deps)
           
 double scoreTB(edu.stanford.nlp.parser.lexparser.Dependency dependency)
           
 double scoreTB(int headWord, int headTag, int argWord, int argTag, boolean leftHeaded, int dist)
           
 int tagBin(int tag)
           
 String toString()
           
protected static edu.stanford.nlp.parser.lexparser.DependencyGrammar.EndHead treeToDependencyHelper(Tree tree, List depList, int loc)
           
static List treeToDependencyList(Tree tree)
           
 void tune(List deps)
           
protected static short valenceBin(int distance)
           
 void writeData(Writer w)
          Writes out data from this Object to the Writer w.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numWords

protected int numWords

numTags

protected int numTags

numTagBins

protected int numTagBins

tagBin

protected int[] tagBin

smooth

public double[] smooth

interp

public double[] interp

distanceDecay

public double distanceDecay

tempEndHead

protected static transient edu.stanford.nlp.parser.lexparser.DependencyGrammar.EndHead tempEndHead
Constructor Detail

DependencyGrammar

public DependencyGrammar(int numWords,
                         int numTags)

DependencyGrammar

public DependencyGrammar()

DependencyGrammar

public DependencyGrammar(edu.stanford.nlp.parser.lexparser.TagProjection tagProjection)
Method Detail

toString

public String toString()

numTagBins

public int numTagBins()

tagBin

public int tagBin(int tag)

pruneTW

public static boolean pruneTW(IntTaggedWord argTW)

rootTW

public static boolean rootTW(IntTaggedWord rTW)

treeToDependencyHelper

protected static edu.stanford.nlp.parser.lexparser.DependencyGrammar.EndHead treeToDependencyHelper(Tree tree,
                                                                                                    List depList,
                                                                                                    int loc)

treeToDependencyList

public static List treeToDependencyList(Tree tree)

scoreAll

protected double scoreAll(Collection deps)

tune

public void tune(List deps)

addRule

public void addRule(edu.stanford.nlp.parser.lexparser.Dependency dependency,
                    double count)

valenceBin

protected static short valenceBin(int distance)

NUMDISTBIN

public static int NUMDISTBIN()

distanceBin

protected static short distanceBin(int distance)

score

public double score(edu.stanford.nlp.parser.lexparser.Dependency dependency)

scoreTB

public double scoreTB(edu.stanford.nlp.parser.lexparser.Dependency dependency)

score

public double score(int headWord,
                    int headTag,
                    int argWord,
                    int argTag,
                    boolean leftHeaded,
                    int dist)

scoreTB

public double scoreTB(int headWord,
                      int headTag,
                      int argWord,
                      int argTag,
                      boolean leftHeaded,
                      int dist)

getCoreDependencies

public Counter getCoreDependencies()

readData

public void readData(BufferedReader in)
              throws IOException
Populates data in this DependencyGrammar from the character stream given by the Reader r.

Throws:
IOException

writeData

public void writeData(Writer w)
               throws IOException
Writes out data from this Object to the Writer w.

Throws:
IOException


Stanford NLP Group