|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.xerox.jxip.XipNode
public class XipNode
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 |
|---|
public static final int NODE
public static final int LEAF
protected java.util.Vector<XipFeature> features
protected java.util.Vector<XipNode> daughters
protected XipNode mother
protected java.util.Vector<XipDependency> dependencies
| Constructor Detail |
|---|
public XipNode(java.lang.String category,
long left,
long right,
long index,
long gramIdNode,
java.lang.String fileName,
long sentenceNb,
long leftChar,
long rightChar)
category - category nameleft - offset of the beginning of the word in the sentenceright - offset of the end of the word in the sentenceindex - gramIdNode - fileName - sentenceNb - leftChar - rightChar - | Method Detail |
|---|
public java.lang.String getCategory()
public long getLeft()
public long getRight()
public long getLeftChar()
public long getRightChar()
public long getLeftTokOffset()
public long getRightTokOffset()
public long getIndex()
public long getGramIdNode()
public java.lang.String getUid()
public java.lang.String getId()
public final java.lang.String getId(long sentid)
sentid -
public int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparablepublic XipNode getNodeByGramId(long id)
id - the search node gram id
public XipNode getNodeByUid(java.lang.Object uid)
uid - the search node uid
public java.util.Vector<XipNode> getDescendantsByFeature(java.lang.String name)
name - the name of the feature
public java.util.Vector<XipNode> getDescendantsByFeature(java.lang.String name,
java.lang.String value)
name - the name of the featurevalue - the value of the feature ("*" if all values are fine)
public java.util.Vector<XipNode> getFirstDescendantsByFeature(java.lang.String name)
name - the name of the feature
public java.util.Vector<XipNode> getFirstDescendantsByFeature(java.lang.String name,
java.lang.String value)
name - the name of the featurevalue - the value of the feature ("*" if all values are fine)
public java.util.Vector<XipNode> getDescendantsByCategory(java.lang.String category)
category - the name of the category.
getDescendantsByCategory(String category, String features)
public java.util.Vector<XipNode> getDescendantsByCategory(java.lang.String category,
java.lang.String features)
category - the name of the category.features - the String representation of the feature lists (XIP
format)
public java.util.Vector<XipNode> getFirstDescendantsByCategory(java.lang.String category)
category - the name of the category.
public java.util.Vector<XipNode> getDescendantsByDependency(java.lang.String dependency)
dependency - the name of the dependency.
getDescendantsByDependency(String dependency, String features, int
position)
public java.util.Vector<XipNode> getDescendantsByDependency(java.lang.String dependency,
java.lang.String features)
dependency - the name of the dependency.features - the String representation of the feature lists (XIP
format)
getDescendantsByDependency(String dependency, String features, int
position)
public java.util.Vector<XipNode> getDescendantsByDependency(java.lang.String dependency,
java.lang.String features,
int position)
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).
public boolean invokeMethodOnNode(java.lang.reflect.Method method,
java.lang.Object[] params)
throws java.lang.Exception
method - the Method to invoke on the nodeparams - the list of parameters (excepted the node itself)
java.lang.Exception - whether the method is not appropriate.getDescendantsByBooleanMethod(String className, String methodName),
getDescendantsByBooleanMethod(Method method, Object[] params)
public java.util.Vector<XipNode> getDescendantsByBooleanMethod(java.lang.String className,
java.lang.String methodName)
throws java.lang.Exception
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
java.lang.Exception - whether the method is not appropriate.getDescendantsByBooleanMethod(Method method, Object[] params)
public java.util.Vector<XipNode> getDescendantsByBooleanMethod(java.lang.reflect.Method method,
java.lang.Object[] params)
throws java.lang.Exception
method - the Method to invoke on the nodeparams - the list of parameters (excepted the node itself)
java.lang.ExceptiongetDescendantsByBooleanMethod(String className, String methodName)public java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name)
name - the name of the expected dependencies.
public java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name,
int position)
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).
public java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name,
java.lang.String features)
name - the name of the expected dependencies.features - the expected list of features hold by the dependency.
Format is XIP usual format.
public java.util.Vector<XipDependency> getDependenciesByName(java.lang.String name,
java.lang.String features,
int position)
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).
public boolean hasDependency(java.lang.String name)
name - the name of the dependency.
hasDependency(String name, String features, int position)
public boolean hasDependency(java.lang.String name,
java.lang.String features)
name - the name of the dependency.features - the features of the dependency (in a XIP-like format
String representation)
public boolean hasDependency(java.lang.String name,
int position)
name - the name of the dependency.position - the expected position of the current node if the
dependency arguments. (0 if any position is OK).
hasDependency(String name, String features, int position)
public boolean hasDependency(java.lang.String name,
java.lang.String features,
int position)
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).
public boolean hasFeature(java.lang.String name)
name - the name of the feature
public boolean hasFeature(java.lang.String name,
java.lang.String value)
name - the name of the featurevalue - the value of the feature ("*" if all values are fine) Value
can be negated ("~" or "~value")
public boolean hasFeatures(java.lang.String features)
features - the list features in XIP format
public java.util.Vector<XipFeature> getFeatures()
public void setFeatures(java.util.Vector<XipFeature> nodeFeatures)
nodeFeatures - a Vector of XipFeaturepublic java.lang.String getFeature(java.lang.String name)
name - the name of the feature.
public java.util.Vector<XipNode> getDaughters()
public void addDaughter(XipNode daught)
daught - The daugther XipNode to addpublic XipNode getMother()
public void setMother(XipNode moth)
moth - the mother nodepublic java.util.Vector<XipDependency> getDependencies()
public void addDependency(XipDependency dependency)
dependency - The feature to be added to the Dependency attributepublic int getType()
public java.lang.Object getMiscInfo()
public void setMiscInfo(java.lang.Object obj)
obj - public boolean isLeaf()
public boolean flMatches(java.lang.String featstring)
featstring - A string that represents the required feature list
public boolean fMatches(java.lang.String f,
java.lang.String v)
f - A string that represents the feature namev - A string that represents the value that is required for the
feature
public boolean fMatches(java.lang.String f)
+)
f - A string that represents the name of the required feature
+) is matched by
this node feature list; false otherwisepublic XipNode getDependentIn(java.lang.String depname)
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.
depname - is the name of the required dependency relation
public XipNode getDependentAhead(java.lang.String depname)
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.
depname - is the name of the required dependency relation
public XipNode getDependentIn(java.lang.String depname,
java.lang.String nodefeats)
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.
depname - is the name of the required dependency relationnodefeats - the feature list that the required dependent node must
satisfy
public XipNode getDependentAhead(java.lang.String depname,
java.lang.String nodefeats)
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.
depname - is the name of the required dependency relationnodefeats - the feature list that the required dependent node must
satisfy
public XipNode getDependentAhead(java.lang.String depname,
java.lang.String depfeats,
java.lang.String nodefeats)
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.
depname - is the name of the required dependency relationdepfeats - the feature list that the required dependency must
satisfynodefeats - the feature list that the required dependent node must
satisfy
public boolean isDependentIn(java.lang.String depname)
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.
depname - is the name of the required dependency relation
depname; false otherwise
public boolean isRelDependentOf(XipNode n,
java.lang.String depname)
n in a relation named
depname.
n - the node for which this node would be a dependentdepname - the name of the dependency relation
n in a relation
named
depname; false otherwise.public boolean isRelDependentOf(XipNode n)
n in any dependency
relation.
n - the node for which this node would be dependent
n in a relation;
false otherwise.public XipNode getHeadIn(java.lang.String depname)
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.
depname - the name of the required dependency relation
public XipNode getHeadIn(java.lang.String depname,
java.lang.String nodefeats)
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.
depname - the name of the required dependency relationnodefeats - the feature list that the required dependent node must
satisfy
public boolean isHeadIn(java.lang.String depname)
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.
depname - is the name of the required dependency relation
depname; false otherwise
public boolean isRelHeadOf(XipNode n,
java.lang.String depname)
n in a relation named
depname.
n - the node for which this node would be the headdepname - the name of the dependency relation
n in a relation
named
depname; false otherwise.public boolean isRelHeadOf(XipNode n)
n in any dependency
relation.
n - the node for which this node would be the head
n in a relation;
false otherwise.public java.lang.String featuresToString(boolean withFeature)
withFeature - if true build the string with the features otherwise
return empty string
public java.lang.String dependenciesToString()
public java.lang.String getSurface()
public java.lang.String getLemma()
public java.util.Vector<XipNode> getLeafNodes()
public XipNode getChunkHead()
public boolean isFicticious()
public boolean isChunkHead()
public boolean isPreTerminalNode()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString2()
public java.lang.String toString(boolean withFeature,
java.lang.String tab,
boolean deeply)
withFeature - if true build the string with the XipNode featurestab - tabulationdeeply - if true, go deeply inside the daughter
public java.lang.String chunkTreeToString(boolean withFeature,
java.lang.String tab,
boolean deeply)
withFeature - if true build the string with the XipNode featurestab - tabulationdeeply - if true, go deeply inside the daughter
public java.lang.String chunkTreeToString(boolean withFeature,
java.lang.String cumultab,
java.lang.String tab,
boolean deeply)
public java.lang.String toHtmlString(boolean withFeature,
boolean deeply)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||