Jet.Parser
Class SynFun

java.lang.Object
  extended byJet.Parser.SynFun

public class SynFun
extends java.lang.Object

syntactic functions which retrieve information from parse trees. In general, these should work with trees produced either by the full-sentence (Penn Tree Bank) parser or the partial parser.


Constructor Summary
SynFun()
           
 
Method Summary
static java.lang.String getDet(Annotation constit)
          returns the determiner of 'constit', or null if the consitutent has no determiner.
static java.lang.String getHead(Document doc, Annotation ann)
          returns the head string of constituent 'ann' in a parse tree.
static boolean getHuman(Annotation constit)
          returns true if noun phrase 'constit' has a human head, as recorded either an a 'human' feature on PA (by the chunk patterns) or an 'nhuman' feature in the dictionary.
static java.lang.String getImmediateHead(Annotation node)
          returns the head string for the current node.
static java.lang.String getName(Document doc, Annotation constit)
          returns the name associated with a noun phrase, as a single string, or null if the np does not have a name.
static java.lang.String getNameOrHead(Document doc, Annotation ann)
          if the head (the end of the 'headC' chain) of constituent 'ann' is a name, return the name itself (with tokens connected by '-'); otherwise return the head as determined by 'getHead'.
static java.lang.String getNumber(Annotation constit)
          returns the number feature of noun phrase 'constit' (singular or plural), or 'null' if the number feature is not specified.
static java.lang.Object getPA(Annotation constit)
          returns the 'pa' feature directly or indirectly associated with parse tree node 'constit'.
static java.lang.String headOfPa(java.lang.Object pa)
          returns the head string from the value of the 'pa' feature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynFun

public SynFun()
Method Detail

getImmediateHead

public static java.lang.String getImmediateHead(Annotation node)
returns the head string for the current node. If the 'pa' feature has a 'head' feature, return that value (plus the particle, if present as a 'part' feature). If the 'pa' feature is a string, return that string. If 'node' does not have a 'pa' feature, return null.


headOfPa

public static java.lang.String headOfPa(java.lang.Object pa)
returns the head string from the value of the 'pa' feature. If the 'pa' feature has a 'head' feature, return that value (plus the particle, if present as a 'part' feature). If the 'pa' feature is a string, return that string. Otherwise there is an error, return "?".


getPA

public static java.lang.Object getPA(Annotation constit)
returns the 'pa' feature directly or indirectly associated with parse tree node 'constit'. If 'constit' has a pa feature itself, return it; otherwise follow the chain of 'headC' links down the parse tree until a node is found with a 'pa' feature.


getHead

public static java.lang.String getHead(Document doc,
                                       Annotation ann)
returns the head string of constituent 'ann' in a parse tree. If there is a 'pa' feature directly or indirectly associated with the constituent, use that to determine the head. Otherwise follow the 'headC' chain and then concatenate (with '-') the tokens of the constituent at the end of the chain.


getName

public static java.lang.String getName(Document doc,
                                       Annotation constit)
returns the name associated with a noun phrase, as a single string, or null if the np does not have a name. Whitespace between tokens of a name is normalized to single blanks.


getNameOrHead

public static java.lang.String getNameOrHead(Document doc,
                                             Annotation ann)
if the head (the end of the 'headC' chain) of constituent 'ann' is a name, return the name itself (with tokens connected by '-'); otherwise return the head as determined by 'getHead'.


getDet

public static java.lang.String getDet(Annotation constit)
returns the determiner of 'constit', or null if the consitutent has no determiner. The determiner may appear either as an attribute of the constituent, or as an attribute of the pa feature of the constituent.


getNumber

public static java.lang.String getNumber(Annotation constit)
returns the number feature of noun phrase 'constit' (singular or plural), or 'null' if the number feature is not specified.


getHuman

public static boolean getHuman(Annotation constit)
returns true if noun phrase 'constit' has a human head, as recorded either an a 'human' feature on PA (by the chunk patterns) or an 'nhuman' feature in the dictionary.