com.xerox.jxip
Class XipNode

java.lang.Object
  extended by com.xerox.jxip.XipNode
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
XipLeaf

public class XipNode
extends java.lang.Object
implements java.lang.Comparable

XipNode Class


Field Summary
protected  java.util.Vector<XipNode> daughters
          vector of XipNode :the daughters node of this node
protected  java.util.Vector<XipDependency> dependencies
          Vector of XipDependency
protected  java.util.Vector<XipFeature> features
          vector of XipFeature
static int LEAF
          o specify a node as XipLeaf
protected  XipNode mother
          The mother of this node
static int NODE
          to specify a node as XipNode
 
Constructor Summary
XipNode(java.lang.String category, long left, long right, long index, long gramIdNode, java.lang.String fileName, long sentenceNb, long leftChar, long rightChar)
          Constructor for the XipNode object
 
Method Summary
 void addDaughter(XipNode daught)
          Adds a new daughter node
 void addDependency(XipDependency dependency)
          Adds a XipDependency
 java.lang.String chunkTreeToString(boolean withFeature, java.lang.String tab, boolean deeply)
          return XipNode data as a string
 java.lang.String chunkTreeToString(boolean withFeature, java.lang.String cumultab, java.lang.String tab, boolean deeply)
           
 int compareTo(java.lang.Object o)
          method for Collections.sort() to work properly
 java.lang.String dependenciesToString()
          return dependencies data as a string
 java.lang.String featuresToString(boolean withFeature)
          return features data as a string
 boolean flMatches(java.lang.String featstring)
          Checks if the feature list of this node matches the specified feature list string
 boolean fMatches(java.lang.String f)
          Checks if the feature list of this node matches the specified feature (the feature value that is assumed is +)
 boolean fMatches(java.lang.String f, java.lang.String v)
          Checks if the feature list of this node matches the specified feature-value couple
 java.lang.String getCategory()
          get the name of the XipNode
 XipNode getChunkHead()
          Gets the chunk head of this node
 java.util.Vector<XipNode> getDaughters()
          Gets the daughters
 java.util.Vector<XipDependency> getDependencies()
          Gets the dependencies which involve this XipNode
 java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name)
          Gets the dependencies having the specified name.
 java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name, int position)
          Gets the dependencies having the specified name.
 java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name, java.lang.String features)
          Gets the dependencies having the specified name and feature.
 java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name, java.lang.String features, int position)
          Gets the dependencies having the specified name and feature.
 XipNode getDependentAhead(java.lang.String depname)
          Gets the node that is a dependent of this node in the dependency relation with the name depname.
 XipNode getDependentAhead(java.lang.String depname, java.lang.String nodefeats)
          Gets the node that is a dependent of this node in the dependency relation with the name depname.
 XipNode getDependentAhead(java.lang.String depname, java.lang.String depfeats, java.lang.String nodefeats)
          Gets the node that is a dependent of this node in the dependency relation with the name depname.
 XipNode getDependentIn(java.lang.String depname)
          Gets the node that is a dependent of this node in the dependency relation with the name depname.
 XipNode getDependentIn(java.lang.String depname, java.lang.String nodefeats)
          Gets the node that is a dependent of this node in the dependency relation with the name depname.
 java.util.Vector<XipNode> getDescendantsByBooleanMethod(java.lang.reflect.Method method, java.lang.Object[] params)
          Invokes a boolean method on every descendants of the current node and returns the ones for which the method has returned true.
 java.util.Vector<XipNode> getDescendantsByBooleanMethod(java.lang.String className, java.lang.String methodName)
          Invokes a boolean method on every descendants of the current node and returns the ones for which the method has returned true.
 java.util.Vector<XipNode> getDescendantsByCategory(java.lang.String category)
          Returns all XipNodes descendant of the current XipNode that have the category name.
 java.util.Vector<XipNode> getDescendantsByCategory(java.lang.String category, java.lang.String features)
          Returns all XipNodes descendant of the current XipNode that have the category name and the specified features.
 java.util.Vector<XipNode> getDescendantsByDependency(java.lang.String dependency)
          Returns all XipNodes descendant of the current XipNode that have the named dependency.
 java.util.Vector<XipNode> getDescendantsByDependency(java.lang.String dependency, java.lang.String features)
          Returns all XipNodes descendant of the current XipNode that have the named dependency with the specified features.
 java.util.Vector<XipNode> getDescendantsByDependency(java.lang.String dependency, java.lang.String features, int position)
          Returns all XipNodes descendant of the current XipNode that have the named dependency with the specified features.
 java.util.Vector<XipNode> getDescendantsByFeature(java.lang.String name)
          Returns all XipNodes descendant of the current XipNode that have the feature name with any value.
 java.util.Vector<XipNode> getDescendantsByFeature(java.lang.String name, java.lang.String value)
          Returns all XipNodes descendant of the current XipNode that have the feature name with the specified value.
 java.lang.String getFeature(java.lang.String name)
          Gets the value of the specified feature
 java.util.Vector<XipFeature> getFeatures()
          Gets the features
 java.util.Vector<XipNode> getFirstDescendantsByCategory(java.lang.String category)
          Returns all XipNodes descendant of the current XipNode that have the category name.
 java.util.Vector<XipNode> getFirstDescendantsByFeature(java.lang.String name)
          Returns all XipNodes descendant of the current XipNode that have the feature name with any value.
 java.util.Vector<XipNode> getFirstDescendantsByFeature(java.lang.String name, java.lang.String value)
          Returns all XipNodes descendant of the current XipNode that have the feature name with the specified value.
 long getGramIdNode()
          Gets the grammar node index
 XipNode getHeadIn(java.lang.String depname)
          Gets the node that is a head of this node in the dependency relation with the name depname.
 XipNode getHeadIn(java.lang.String depname, java.lang.String nodefeats)
          Gets the node that is a head of this node in the dependency relation with the name depname.
 java.lang.String getId()
          Gets the Id string of this node.
 java.lang.String getId(long sentid)
          Gets the Id string of this node taking into account the sentence where it occurs.
 long getIndex()
          Gets the node index in the c++ struct
 java.util.Vector<XipNode> getLeafNodes()
          Returns a Vector containing leaf nodes descendant of the current node.
 long getLeft()
          Gets the left position in the sentence
 long getLeftChar()
          Gets the left position in the sentence
 long getLeftTokOffset()
          Gets the left token-based offset in the sentence
 java.lang.String getLemma()
          Gets the lemma (base form) of this node
 java.lang.Object getMiscInfo()
          Returns the value of the application-related information field of this node.
 XipNode getMother()
          Gets the mother XipNode of this node
 XipNode getNodeByGramId(long id)
          Returns the node having the specified gram id among the current node or its descendants.
 XipNode getNodeByUid(java.lang.Object uid)
          Returns the node having the specified uid among the current node or its descendants.
 long getRight()
          gets the right position in the sentence
 long getRightChar()
          gets the right position in the sentence
 long getRightTokOffset()
          gets the right position in the sentence
 java.lang.String getSurface()
          Gets the surface form of this node
 int getType()
          return always XipNode.Node
 java.lang.String getUid()
          Gets the a unique node identifier
 boolean hasDependency(java.lang.String name)
          Tests whether the current node has the specified dependency or not.
 boolean hasDependency(java.lang.String name, int position)
          Tests whether the current node has the specified dependency or not.
 boolean hasDependency(java.lang.String name, java.lang.String features)
          Tests whether the current node has the specified dependency or not.
 boolean hasDependency(java.lang.String name, java.lang.String features, int position)
          Tests whether the current node has the specified dependency or not.
 boolean hasFeature(java.lang.String name)
          Tests if the node has a given feature.
 boolean hasFeature(java.lang.String name, java.lang.String value)
          Tests if the node has a given feature with a given value
 boolean hasFeatures(java.lang.String features)
          Tests if the node has given features.
 boolean invokeMethodOnNode(java.lang.reflect.Method method, java.lang.Object[] params)
          Invokes a boolean method on the current node and returns its results.
 boolean isChunkHead()
          Checks if this node is a chunk head (i.e.
 boolean isDependentIn(java.lang.String depname)
          Checks if this node is a dependent in a dependency relation with the name depname.
 boolean isFicticious()
          Checks if this node is ficticious (i.e.
 boolean isHeadIn(java.lang.String depname)
          Checks if this node is a head in a dependency relation with the name depname.
 boolean isLeaf()
          return false
 boolean isPreTerminalNode()
          Checks if this node is a preterminal node (i.e.
 boolean isRelDependentOf(XipNode n)
          Checks if this node is dependent of a node n in any dependency relation.
 boolean isRelDependentOf(XipNode n, java.lang.String depname)
          Checks if this node is dependent of a node n in a relation named depname.
 boolean isRelHeadOf(XipNode n)
          Checks if this node is the head of a node n in any dependency relation.
 boolean isRelHeadOf(XipNode n, java.lang.String depname)
          Checks if this node is the head of a node n in a relation named depname.
 void setFeatures(java.util.Vector<XipFeature> nodeFeatures)
          Sets the Vector of features
 void setMiscInfo(java.lang.Object obj)
          Sets the value of the application-related information field of this node.
 void setMother(XipNode moth)
          set the mother node
 java.lang.String toHtmlString(boolean withFeature, boolean deeply)
           
 java.lang.String toString()
          Returns a string representation of this node
 java.lang.String toString(boolean withFeature, java.lang.String tab, boolean deeply)
          return XipNode data as a string
 java.lang.String toString2()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NODE

public static final int NODE
to specify a node as XipNode

See Also:
Constant Field Values

LEAF

public static final int LEAF
o specify a node as XipLeaf

See Also:
Constant Field Values

features

protected java.util.Vector<XipFeature> features
vector of XipFeature


daughters

protected java.util.Vector<XipNode> daughters
vector of XipNode :the daughters node of this node


mother

protected XipNode mother
The mother of this node


dependencies

protected java.util.Vector<XipDependency> dependencies
Vector of XipDependency

Constructor Detail

XipNode

public XipNode(java.lang.String category,
               long left,
               long right,
               long index,
               long gramIdNode,
               java.lang.String fileName,
               long sentenceNb,
               long leftChar,
               long rightChar)
Constructor for the XipNode object

Parameters:
category - category name
left - offset of the beginning of the word in the sentence
right - offset of the end of the word in the sentence
index -
gramIdNode -
fileName -
sentenceNb -
leftChar -
rightChar -
Method Detail

getCategory

public java.lang.String getCategory()
get the name of the XipNode

Returns:
the name of the XipNode

getLeft

public long getLeft()
Gets the left position in the sentence

Returns:
the left position (offset in byte)

getRight

public long getRight()
gets the right position in the sentence

Returns:
the right position (offset in byte)

getLeftChar

public long getLeftChar()
Gets the left position in the sentence

Returns:
the left position (offset in char)

getRightChar

public long getRightChar()
gets the right position in the sentence

Returns:
the right position (offset in char)

getLeftTokOffset

public long getLeftTokOffset()
Gets the left token-based offset in the sentence

Returns:
the left token-based offset

getRightTokOffset

public long getRightTokOffset()
gets the right position in the sentence

Returns:
the right position

getIndex

public long getIndex()
Gets the node index in the c++ struct

Returns:
The node index

getGramIdNode

public long getGramIdNode()
Gets the grammar node index

Returns:
The node index used in the grammar: #n

getUid

public java.lang.String getUid()
Gets the a unique node identifier

Returns:
The uid value

getId

public java.lang.String getId()
Gets the Id string of this node.

Returns:
The Id string of this node

getId

public final java.lang.String getId(long sentid)
Gets the Id string of this node taking into account the sentence where it occurs. Hence a node Id is unique over the input string/file

Parameters:
sentid -
Returns:
The Id string of this node

compareTo

public int compareTo(java.lang.Object o)
method for Collections.sort() to work properly

Specified by:
compareTo in interface java.lang.Comparable

getNodeByGramId

public XipNode getNodeByGramId(long id)
Returns the node having the specified gram id among the current node or its descendants.

Parameters:
id - the search node gram id
Returns:
the XipNode corresponding to this id if found in the current node null otherwise.

getNodeByUid

public XipNode getNodeByUid(java.lang.Object uid)
Returns the node having the specified uid among the current node or its descendants.

Parameters:
uid - the search node uid
Returns:
the XipNode corresponding to this id if found in the current node null otherwise.

getDescendantsByFeature

public java.util.Vector<XipNode> getDescendantsByFeature(java.lang.String name)
Returns all XipNodes descendant of the current XipNode that have the feature name with any value.

Parameters:
name - the name of the feature
Returns:
a Vector of XipNode having the appropriate feature.

getDescendantsByFeature

public java.util.Vector<XipNode> getDescendantsByFeature(java.lang.String name,
                                                         java.lang.String value)
Returns all XipNodes descendant of the current XipNode that have the feature name with the specified value.

Parameters:
name - the name of the feature
value - the value of the feature ("*" if all values are fine)
Returns:
a Vector of XipNode having the appropriate feature.

getFirstDescendantsByFeature

public java.util.Vector<XipNode> getFirstDescendantsByFeature(java.lang.String name)
Returns all XipNodes descendant of the current XipNode that have the feature name with any value. Does not return XipNodes having an ancestor with the same specified feature

Parameters:
name - the name of the feature
Returns:
a Vector of XipNode having the appropriate feature.

getFirstDescendantsByFeature

public java.util.Vector<XipNode> getFirstDescendantsByFeature(java.lang.String name,
                                                              java.lang.String value)
Returns all XipNodes descendant of the current XipNode that have the feature name with the specified value. Does not return XipNodes having an ancestor with the same specified feature

Parameters:
name - the name of the feature
value - the value of the feature ("*" if all values are fine)
Returns:
a Vector of XipNode having the appropriate feature.

getDescendantsByCategory

public java.util.Vector<XipNode> getDescendantsByCategory(java.lang.String category)
Returns all XipNodes descendant of the current XipNode that have the category name.

Parameters:
category - the name of the category.
Returns:
a Vector of XipNode having the appropriate categories.
See Also:
getDescendantsByCategory(String category, String features)

getDescendantsByCategory

public java.util.Vector<XipNode> getDescendantsByCategory(java.lang.String category,
                                                          java.lang.String features)
Returns all XipNodes descendant of the current XipNode that have the category name and the specified features. Features String format are the XIP traditional format.

Parameters:
category - the name of the category.
features - the String representation of the feature lists (XIP format)
Returns:
a Vector of XipNode having the appropriate categories.

getFirstDescendantsByCategory

public java.util.Vector<XipNode> getFirstDescendantsByCategory(java.lang.String category)
Returns all XipNodes descendant of the current XipNode that have the category name. Does not return XipNodes having an ancestor with the same specified category

Parameters:
category - the name of the category.
Returns:
a Vector of XipNode having the appropriate categories.

getDescendantsByDependency

public java.util.Vector<XipNode> getDescendantsByDependency(java.lang.String dependency)
Returns all XipNodes descendant of the current XipNode that have the named dependency.

Parameters:
dependency - the name of the dependency.
Returns:
a Vector of XipNode having the appropriate dependency.
See Also:
getDescendantsByDependency(String dependency, String features, int position)

getDescendantsByDependency

public java.util.Vector<XipNode> getDescendantsByDependency(java.lang.String dependency,
                                                            java.lang.String features)
Returns all XipNodes descendant of the current XipNode that have the named dependency with the specified features.

Parameters:
dependency - the name of the dependency.
features - the String representation of the feature lists (XIP format)
Returns:
a Vector of XipNode having the appropriate dependency.
See Also:
getDescendantsByDependency(String dependency, String features, int position)

getDescendantsByDependency

public java.util.Vector<XipNode> getDescendantsByDependency(java.lang.String dependency,
                                                            java.lang.String features,
                                                            int position)
Returns all XipNodes descendant of the current XipNode that have the named dependency with the specified features. Features String format are the XIP traditional format.

Parameters:
dependency - the name of the dependency.
features - the String representation of the feature lists (XIP format)
position - the expected position of the node in the dependency (0 if any position is OK).
Returns:
a Vector of XipNode having the appropriate dependency.

invokeMethodOnNode

public boolean invokeMethodOnNode(java.lang.reflect.Method method,
                                  java.lang.Object[] params)
                           throws java.lang.Exception
Invokes a boolean method on the current node and returns its results. The method MUST:

Parameters:
method - the Method to invoke on the node
params - the list of parameters (excepted the node itself)
Returns:
the boolean result of the method
Throws:
java.lang.Exception - whether the method is not appropriate.
See Also:
getDescendantsByBooleanMethod(String className, String methodName), getDescendantsByBooleanMethod(Method method, Object[] params)

getDescendantsByBooleanMethod

public java.util.Vector<XipNode> getDescendantsByBooleanMethod(java.lang.String className,
                                                               java.lang.String methodName)
                                                        throws java.lang.Exception
Invokes a boolean method on every descendants of the current node and returns the ones for which the method has returned true. The method MUST:

Parameters:
className - the String name of the class where the method can be found (package included)
methodName - the String name of the method to be invoked
Returns:
the Vector containing all descendants of the current XipNode and selected by the method
Throws:
java.lang.Exception - whether the method is not appropriate.
See Also:
getDescendantsByBooleanMethod(Method method, Object[] params)

getDescendantsByBooleanMethod

public java.util.Vector<XipNode> getDescendantsByBooleanMethod(java.lang.reflect.Method method,
                                                               java.lang.Object[] params)
                                                        throws java.lang.Exception
Invokes a boolean method on every descendants of the current node and returns the ones for which the method has returned true. The method MUST:

Parameters:
method - the Method to invoke on the node
params - the list of parameters (excepted the node itself)
Returns:
the Vector containing all descendants of the current XipNode and selected by the method
Throws:
java.lang.Exception
See Also:
getDescendantsByBooleanMethod(String className, String methodName)

getDependenciesByName

public java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name)
Gets the dependencies having the specified name.

Parameters:
name - the name of the expected dependencies.
Returns:
the dependencies having the appropriate name.

getDependenciesByName

public java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name,
                                                             int position)
Gets the dependencies having the specified name.

Parameters:
name - the name of the expected dependencies.
position - the expected position of the current node if the dependency arguments. (0 if any position is OK).
Returns:
the dependencies having the appropriate name.

getDependenciesByName

public java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name,
                                                             java.lang.String features)
Gets the dependencies having the specified name and feature.

Parameters:
name - the name of the expected dependencies.
features - the expected list of features hold by the dependency. Format is XIP usual format.
Returns:
the dependencies having the appropriate name and feature.

getDependenciesByName

public java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name,
                                                             java.lang.String features,
                                                             int position)
Gets the dependencies having the specified name and feature.

Parameters:
name - the name of the expected dependencies.
features - the expected list of features hold by the dependency. Format is XIP usual format.
position - the expected position of the current node if the dependency arguments. (0 if any position is OK).
Returns:
the dependencies having the appropriate name and features.

hasDependency

public boolean hasDependency(java.lang.String name)
Tests whether the current node has the specified dependency or not. Same as hasDependency(name, 0);

Parameters:
name - the name of the dependency.
Returns:
true if the node has the specified dependency, false otherwise.
See Also:
hasDependency(String name, String features, int position)

hasDependency

public boolean hasDependency(java.lang.String name,
                             java.lang.String features)
Tests whether the current node has the specified dependency or not.

Parameters:
name - the name of the dependency.
features - the features of the dependency (in a XIP-like format String representation)
Returns:
true if the node has the specified dependency, false otherwise.

hasDependency

public boolean hasDependency(java.lang.String name,
                             int position)
Tests whether the current node has the specified dependency or not.

Parameters:
name - the name of the dependency.
position - the expected position of the current node if the dependency arguments. (0 if any position is OK).
Returns:
true if the node has the specified dependency, false otherwise.
See Also:
hasDependency(String name, String features, int position)

hasDependency

public boolean hasDependency(java.lang.String name,
                             java.lang.String features,
                             int position)
Tests whether the current node has the specified dependency or not.

Parameters:
name - the name of the dependency.
features - the features of the dependency (in a XIP-like format String representation)
position - the expected position of the current node if the dependency arguments. (0 if any position is OK).
Returns:
true if the node has the specified dependency, false otherwise.

hasFeature

public boolean hasFeature(java.lang.String name)
Tests if the node has a given feature.

Parameters:
name - the name of the feature
Returns:
true whether the node has the feature (with any value) false otherwise

hasFeature

public boolean hasFeature(java.lang.String name,
                          java.lang.String value)
Tests if the node has a given feature with a given value

Parameters:
name - the name of the feature
value - the value of the feature ("*" if all values are fine) Value can be negated ("~" or "~value")
Returns:
true whether the node has the feature with the appropriate value false otherwise

hasFeatures

public boolean hasFeatures(java.lang.String features)
Tests if the node has given features. These features are separated by ",", and the names are separated from values by ":". All is in XIP format

Parameters:
features - the list features in XIP format
Returns:
true whether the node has the features with the appropriate value false otherwise

getFeatures

public java.util.Vector<XipFeature> getFeatures()
Gets the features

Returns:
The features: a Vector of XipFeatures

setFeatures

public void setFeatures(java.util.Vector<XipFeature> nodeFeatures)
Sets the Vector of features

Parameters:
nodeFeatures - a Vector of XipFeature

getFeature

public java.lang.String getFeature(java.lang.String name)
Gets the value of the specified feature

Parameters:
name - the name of the feature.
Returns:
a String value of the specified feature, or null if the feature does not exist

getDaughters

public java.util.Vector<XipNode> getDaughters()
Gets the daughters

Returns:
The daughters: a Vector of XipNode

addDaughter

public void addDaughter(XipNode daught)
Adds a new daughter node

Parameters:
daught - The daugther XipNode to add

getMother

public XipNode getMother()
Gets the mother XipNode of this node

Returns:
The mother XipNode

setMother

public void setMother(XipNode moth)
set the mother node

Parameters:
moth - the mother node

getDependencies

public java.util.Vector<XipDependency> getDependencies()
Gets the dependencies which involve this XipNode

Returns:
The dependencies: a Vector of XipDependency

addDependency

public void addDependency(XipDependency dependency)
Adds a XipDependency

Parameters:
dependency - The feature to be added to the Dependency attribute

getType

public int getType()
return always XipNode.Node

Returns:
return always XipNode.Node

getMiscInfo

public java.lang.Object getMiscInfo()
Returns the value of the application-related information field of this node.

Returns:
the value of the application-related information field of this node.

setMiscInfo

public void setMiscInfo(java.lang.Object obj)
Sets the value of the application-related information field of this node.

Parameters:
obj -

isLeaf

public boolean isLeaf()
return false

Returns:
false

flMatches

public boolean flMatches(java.lang.String featstring)
Checks if the feature list of this node matches the specified feature list string

Parameters:
featstring - A string that represents the required feature list
Returns:
true if the required feature list is matched by this node feature list; false otherwise

fMatches

public boolean fMatches(java.lang.String f,
                        java.lang.String v)
Checks if the feature list of this node matches the specified feature-value couple

Parameters:
f - A string that represents the feature name
v - A string that represents the value that is required for the feature
Returns:
true if the required feature-value is matched by this node feature list; false otherwise

fMatches

public boolean fMatches(java.lang.String f)
Checks if the feature list of this node matches the specified feature (the feature value that is assumed is +)

Parameters:
f - A string that represents the name of the required feature
Returns:
true if the required feature (with value +) is matched by this node feature list; false otherwise

getDependentIn

public XipNode getDependentIn(java.lang.String depname)
Gets the node that is a dependent of this node in the dependency relation with the name depname. A node is a dependent in a dependency relation if it is the second argument of the relation, and it is ahead in the relation if it is the first argument of the relation.

Parameters:
depname - is the name of the required dependency relation
Returns:
the dependent node if it exists; null if this node is not a head in a dependency relation that has the specified name

getDependentAhead

public XipNode getDependentAhead(java.lang.String depname)
Gets the node that is a dependent of this node in the dependency relation with the name depname. A node is a dependent in a dependency relation if it is the second argument of the relation, and it is ahead in the relation if it is the first argument of the relation.

Parameters:
depname - is the name of the required dependency relation
Returns:
the dependent node if it exists; null if this node is not a head in a dependency relation that has the specified name

getDependentIn

public XipNode getDependentIn(java.lang.String depname,
                              java.lang.String nodefeats)
Gets the node that is a dependent of this node in the dependency relation with the name depname. A node is a dependent in a dependency relation if it is the second argument of the relation, and it is ahead in the relation if it is the first argument of the relation.

Parameters:
depname - is the name of the required dependency relation
nodefeats - the feature list that the required dependent node must satisfy
Returns:
the dependent node if it exists; null if this node is not a head in a dependency relation that has the specified name

getDependentAhead

public XipNode getDependentAhead(java.lang.String depname,
                                 java.lang.String nodefeats)
Gets the node that is a dependent of this node in the dependency relation with the name depname. A node is a dependent in a dependency relation if it is the second argument of the relation, and it is ahead in the relation if it is the first argument of the relation.

Parameters:
depname - is the name of the required dependency relation
nodefeats - the feature list that the required dependent node must satisfy
Returns:
the dependent node if it exists; null if this node is not a head in a dependency relation that has the specified name

getDependentAhead

public XipNode getDependentAhead(java.lang.String depname,
                                 java.lang.String depfeats,
                                 java.lang.String nodefeats)
Gets the node that is a dependent of this node in the dependency relation with the name depname. A node is a dependent in a dependency relation if it is the second argument of the relation, and it is ahead in the relation if it is the first argument of the relation.

Parameters:
depname - is the name of the required dependency relation
depfeats - the feature list that the required dependency must satisfy
nodefeats - the feature list that the required dependent node must satisfy
Returns:
the dependent node if it exists; null if this node is not a head in a dependency relation that has the specified name

isDependentIn

public boolean isDependentIn(java.lang.String depname)
Checks if this node is a dependent in a dependency relation with the name depname. A node is a dependent in a dependency relation if it is the second argument of the relation, and it is ahead in the relation if it is the first argument of the relation.

Parameters:
depname - is the name of the required dependency relation
Returns:
true if this node is a dependent in a dependency relation with the name depname; false otherwise

isRelDependentOf

public boolean isRelDependentOf(XipNode n,
                                java.lang.String depname)
Checks if this node is dependent of a node n in a relation named depname.

Parameters:
n - the node for which this node would be a dependent
depname - the name of the dependency relation
Returns:
true if this node is dependent of node n in a relation named depname; false otherwise.

isRelDependentOf

public boolean isRelDependentOf(XipNode n)
Checks if this node is dependent of a node n in any dependency relation.

Parameters:
n - the node for which this node would be dependent
Returns:
true if this node is dependent of node n in a relation; false otherwise.

getHeadIn

public XipNode getHeadIn(java.lang.String depname)
Gets the node that is a head of this node in the dependency relation with the name depname. A node is a dependent in a dependency relation if it is the second argument of the relation, and it is a head in the relation if it is the first argument of the relation.

Parameters:
depname - the name of the required dependency relation
Returns:
the head node if it exists; null if this node is not a dependent in a dependency relation that has the specified name

getHeadIn

public XipNode getHeadIn(java.lang.String depname,
                         java.lang.String nodefeats)
Gets the node that is a head of this node in the dependency relation with the name depname. A node is a dependent in a dependency relation if it is the second argument of the relation, and it is a head in the relation if it is the first argument of the relation.

Parameters:
depname - the name of the required dependency relation
nodefeats - the feature list that the required dependent node must satisfy
Returns:
the head node if it exists; null if this node is not a dependent in a dependency relation that has the specified name

isHeadIn

public boolean isHeadIn(java.lang.String depname)
Checks if this node is a head in a dependency relation with the name depname. A node is a dependent in a dependency relation if it is the second argument of the relation, and it is a head in the relation if it is the first argument of the relation.

Parameters:
depname - is the name of the required dependency relation
Returns:
true if this node is a head in a dependency relation with the name depname; false otherwise

isRelHeadOf

public boolean isRelHeadOf(XipNode n,
                           java.lang.String depname)
Checks if this node is the head of a node n in a relation named depname.

Parameters:
n - the node for which this node would be the head
depname - the name of the dependency relation
Returns:
true if this node is the head of node n in a relation named depname; false otherwise.

isRelHeadOf

public boolean isRelHeadOf(XipNode n)
Checks if this node is the head of a node n in any dependency relation.

Parameters:
n - the node for which this node would be the head
Returns:
true if this node is the head of node n in a relation; false otherwise.

featuresToString

public java.lang.String featuresToString(boolean withFeature)
return features data as a string

Parameters:
withFeature - if true build the string with the features otherwise return empty string
Returns:
features to string

dependenciesToString

public java.lang.String dependenciesToString()
return dependencies data as a string

Returns:
dependencies to string

getSurface

public java.lang.String getSurface()
Gets the surface form of this node

Returns:
A string representing the surface form of this node

getLemma

public java.lang.String getLemma()
Gets the lemma (base form) of this node

Returns:
A string representing the lemma of this node

getLeafNodes

public java.util.Vector<XipNode> getLeafNodes()
Returns a Vector containing leaf nodes descendant of the current node. Leaves that are only different interpretations of a same node are NOT considered.

Returns:
a Vector of XipNodes corresponding to the tokenization part.

getChunkHead

public XipNode getChunkHead()
Gets the chunk head of this node

Returns:
The chunk head node of this node if this node is a chunk; this node if this node is not a chunk (i.e. if it is preterminal or terminal node)

isFicticious

public boolean isFicticious()
Checks if this node is ficticious (i.e. has not been directly created from the input string but from derivational morphology rules)

Returns:
true if this node is ficticious; false otherwise

isChunkHead

public boolean isChunkHead()
Checks if this node is a chunk head (i.e. is the last daughter node of a chunk). Hence the TOP node is not a chunk head.

Returns:
true if this node is a chunk head, false otherwise

isPreTerminalNode

public boolean isPreTerminalNode()
Checks if this node is a preterminal node (i.e. it is the mother node of terminal (leaf) nodes).

Returns:
true if this node is preterminal node, false otherwise

toString

public java.lang.String toString()
Returns a string representation of this node

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this node

toString2

public java.lang.String toString2()

toString

public java.lang.String toString(boolean withFeature,
                                 java.lang.String tab,
                                 boolean deeply)
return XipNode data as a string

Parameters:
withFeature - if true build the string with the XipNode features
tab - tabulation
deeply - if true, go deeply inside the daughter
Returns:
XipNode to a string

chunkTreeToString

public java.lang.String chunkTreeToString(boolean withFeature,
                                          java.lang.String tab,
                                          boolean deeply)
return XipNode data as a string

Parameters:
withFeature - if true build the string with the XipNode features
tab - tabulation
deeply - if true, go deeply inside the daughter
Returns:
XipNode to a string

chunkTreeToString

public java.lang.String chunkTreeToString(boolean withFeature,
                                          java.lang.String cumultab,
                                          java.lang.String tab,
                                          boolean deeply)

toHtmlString

public java.lang.String toHtmlString(boolean withFeature,
                                     boolean deeply)


Copyright © 2008 Xerox All Rights Reserved.