org.jscience.ml.tigerxml.tools
Class SyntaxTools

java.lang.Object
  extended by org.jscience.ml.tigerxml.tools.SyntaxTools

public class SyntaxTools
extends java.lang.Object

Provides methods that define a number of higher-level linguistic concepts. Included are "subject", and "voice". This class is for static use.


Constructor Summary
SyntaxTools()
           
 
Method Summary
 java.lang.String generalizePreposition(java.lang.String prep)
          Generalizes a preposition.
 NT getDominatingClausalNode(GraphNode node)
          Returns the nearest dominating clausal node of this GraphNode.
 NT getDominatingNominalNode(GraphNode node)
          Returns the nearest dominating nominal node of this GraphNode.
 java.lang.String getHeadWord(GraphNode node)
          Returns the head word of the constituent.
 GraphNode getLeftmostConstituent(GraphNode verbal_node)
          Returns the leftmost constituent of the Mittelfeld that belongs to the verbal node.
 java.util.ArrayList getPpSignature(GraphNode node)
          Returns the PP signature of the clause or NP the node belongs to.
 java.lang.String getPreposition(GraphNode pp)
          Returns the preposition of a PP
 GraphNode getSubject(GraphNode node)
          Returns the subject of the sentence the node belongs to.
 boolean hasActiveVoice(T verbal_node)
          Returns true if the input node is a full verb node and occurs in an active clause.
 boolean haveSameArgumentDomain(GraphNode verbal_node, GraphNode other_node)
          Returns true if the verbal node has the same argument domain as the other node.
static boolean isApposition(GraphNode node)
          Returns true if the input node is an apposition.
protected static boolean isAttributiveMarkablePronoun(T terminal)
          DOCUMENT ME!
static boolean isNoun(T terminal)
          Defines the term noun as it is commonly understood in terms of TIGER syntax.
static boolean isNpLikeNode(NT node)
          Defines the term NP as it is commonly understood in terms of TIGER syntax.
static boolean isPronoun(T terminal)
          Returns true if the node is a personal pronoun like "er", "mir" and so forth.
static boolean isSLikeNode(NT node)
          Defines the term S as it is commonly understood in terms of TIGER syntax.
protected static boolean isSubstitutingMarkablePronoun(T terminal)
          DOCUMENT ME!
static boolean isVpLikeNode(NT node)
          Defines the term VP as it is commonly understood in terms of TIGER syntax.
 boolean occursInNominalContext(GraphNode node)
          Returns true if the nearest dominating clausal node is nearer than the nearest dominating nominal node.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyntaxTools

public SyntaxTools()
Method Detail

getPreposition

public java.lang.String getPreposition(GraphNode pp)
Returns the preposition of a PP

Parameters:
pp - DOCUMENT ME!
Returns:
DOCUMENT ME!

generalizePreposition

public java.lang.String generalizePreposition(java.lang.String prep)
Generalizes a preposition. For example, "am", "ans", and "daran" will all be generalized to "an".

Parameters:
prep - DOCUMENT ME!
Returns:
DOCUMENT ME!

getPpSignature

public java.util.ArrayList getPpSignature(GraphNode node)
Returns the PP signature of the clause or NP the node belongs to. The PP signature is an alphabetically ordered list of the (generalized) prepositions of the PPs that occur in the same clause or NP as the input node. If the node occurs in a nominal context, the NP will be considered, otherwise the clause.

Parameters:
node - DOCUMENT ME!
Returns:
DOCUMENT ME!

isNpLikeNode

public static final boolean isNpLikeNode(NT node)
Defines the term NP as it is commonly understood in terms of TIGER syntax.

Parameters:
node - The node to be classified as NP or not NP.
Returns:
True if node is an NP as commonly understood in terms of TIGER Syntax.

getLeftmostConstituent

public GraphNode getLeftmostConstituent(GraphNode verbal_node)
Returns the leftmost constituent of the Mittelfeld that belongs to the verbal node.

Parameters:
verbal_node - DOCUMENT ME!
Returns:
DOCUMENT ME!

getHeadWord

public java.lang.String getHeadWord(GraphNode node)
Returns the head word of the constituent. In case of "an den Kanzler" this would be "Kanzler".

Parameters:
node - DOCUMENT ME!
Returns:
DOCUMENT ME!

isSLikeNode

public static final boolean isSLikeNode(NT node)
Defines the term S as it is commonly understood in terms of TIGER syntax.

Parameters:
node - The node to be classified as S or not S.
Returns:
True if node is an S as commonly understood in terms of TIGER Syntax.

isVpLikeNode

public static final boolean isVpLikeNode(NT node)
Defines the term VP as it is commonly understood in terms of TIGER syntax.

Parameters:
node - The node to be classified as VP or not VP.
Returns:
True if node is an VP as commonly understood in terms of TIGER Syntax.

getDominatingClausalNode

public NT getDominatingClausalNode(GraphNode node)
Returns the nearest dominating clausal node of this GraphNode. It can be either an S or a VP node as commonly understood. The method returns null if there is no such node.

Parameters:
node - DOCUMENT ME!
Returns:
DOCUMENT ME!

getDominatingNominalNode

public NT getDominatingNominalNode(GraphNode node)
Returns the nearest dominating nominal node of this GraphNode. It will be an NP as commonly understood. The method returns null if there is no such node.

Parameters:
node - DOCUMENT ME!
Returns:
DOCUMENT ME!

occursInNominalContext

public boolean occursInNominalContext(GraphNode node)
Returns true if the nearest dominating clausal node is nearer than the nearest dominating nominal node.

Parameters:
node - DOCUMENT ME!
Returns:
DOCUMENT ME!

haveSameArgumentDomain

public boolean haveSameArgumentDomain(GraphNode verbal_node,
                                      GraphNode other_node)
Returns true if the verbal node has the same argument domain as the other node. Having the same argument domain is defined as follows: a verbal node and another node have the same argument domain if the shortest path leading from the verbal node to the other does not cross an s node and does not cross a vp node from above to below. Usually, all nodes the content of which enters as an argument in the relation expressed by the verb are syntactically located within the argument domain of the verb.

Parameters:
verbal_node - this node is supposed to be a full verb node like "(zu) sagen", "gesagt", or "sagte".
other_node - this can be any GraphNode.
Returns:
a truth value indicating whether the second node belongs to the argument domain of the first.

hasActiveVoice

public boolean hasActiveVoice(T verbal_node)
Returns true if the input node is a full verb node and occurs in an active clause.

E.g. in case of "Peter glaubt, gerufen zu werden" it returns true for "glaubt" and false for "gerufen".

The method is meant to be applied to full verb terminals like "sagen", "sagte", "gesagt" and so forth, but not to non-full-verb terminals like "Peter" oder "werden".

Parameters:
verbal_node - DOCUMENT ME!
Returns:
DOCUMENT ME!

getSubject

public GraphNode getSubject(GraphNode node)
Returns the subject of the sentence the node belongs to. Note that this will always be the subject of a higher structure. That is, if applied to "dass Doris verliebt ist" in "Frank glaubt, dass Doris verliebt ist"" it will return "Frank", not "Doris". The method will return null if there is no subject as in "VfL Bochum-Eintracht Frankfurt 3:2".

Parameters:
node - DOCUMENT ME!
Returns:
DOCUMENT ME!

isSubstitutingMarkablePronoun

protected static boolean isSubstitutingMarkablePronoun(T terminal)
DOCUMENT ME!

Parameters:
terminal - DOCUMENT ME!
Returns:
DOCUMENT ME!

isPronoun

public static final boolean isPronoun(T terminal)
Returns true if the node is a personal pronoun like "er", "mir" and so forth.

Parameters:
terminal - DOCUMENT ME!
Returns:
DOCUMENT ME!

isAttributiveMarkablePronoun

protected static boolean isAttributiveMarkablePronoun(T terminal)
DOCUMENT ME!

Parameters:
terminal - DOCUMENT ME!
Returns:
DOCUMENT ME!

isNoun

public static final boolean isNoun(T terminal)
Defines the term noun as it is commonly understood in terms of TIGER syntax.

Parameters:
terminal - The node to be classified as noun or not a noun.
Returns:
True if node is a noun as commonly understood in terms of TIGER syntax.

isApposition

public static final boolean isApposition(GraphNode node)
Returns true if the input node is an apposition.

Parameters:
node - The node to be classified as apposition.
Returns:
True if node is an apposition.