|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.ml.tigerxml.GraphNode
org.jscience.ml.tigerxml.NT
public class NT
Represents a non-terminal node a syntax tree.
GraphNode,
Serialized Form| Field Summary |
|---|
| Fields inherited from class org.jscience.ml.tigerxml.GraphNode |
|---|
verbosity |
| Constructor Summary | |
|---|---|
NT()
Creates an empty NT setting all member variables to null |
|
NT(org.w3c.dom.Element ntElement,
Sentence sent)
|
|
NT(org.w3c.dom.Element ntElement,
Sentence sent,
int verbosity)
|
|
| Method Summary | |
|---|---|
void |
addDaughter(GraphNode newDaughter)
Adds a daughter. |
void |
addSecDaughter(GraphNode newDaughter)
Adds a secondary daughter. |
java.util.ArrayList |
getAllDaughters()
Returns an ArrayList of all daughters, primary as well as secondary, ordered left to right according to linear precedence. |
java.util.ArrayList |
getAllDaughtersByLabel(java.lang.String edgelabel)
Returns an ArrayList of all the daughter nodes, primary as well as secondary ones, with a given edge label. |
java.util.ArrayList |
getAllDescendants()
Returns an ArrayList of all descendant nodes, primary as well as secondary ones, of this node. |
java.util.ArrayList |
getAllDescendantsByLabel(java.lang.String edgelabel)
Returns an ArrayList of all descendant nodes, primary as well as secondary ones, with a given edge label. |
java.lang.String |
getCat()
Returns the category of this NT |
java.util.ArrayList |
getDaughters()
Returns an ArrayList of the daughter nodes ordered left to right according to linear precedence. |
java.util.ArrayList |
getDaughtersByLabel(java.lang.String edgelabel)
Returns an ArrayList of the daughter nodes with a given edge label. |
java.util.ArrayList |
getDescendants()
Returns an ArrayList of the descendant nodes of this node. |
java.util.ArrayList |
getDescendantsByLabel(java.lang.String edgelabel)
Returns an ArrayList of the descendant nodes with a given edge label. |
java.util.ArrayList |
getSecDaughters()
Returns an ArrayList of the secondary daughter nodes ordered left to right according to linear precedence. |
java.lang.String |
getSpan()
Returns the span (the list of terminal node IDs). |
java.util.ArrayList |
getTerminals()
Returns all terminal daughters recursively. |
java.lang.String |
getText()
Returns the surface of this NT - the String consisting of all terminals underneath this node. |
java.lang.String |
getWords()
Returns the surface of this NT - the String consisting of all terminals underneath this node. |
boolean |
hasSecDaughters()
Returns true if this node has secondary daughters. |
protected void |
print2Xml(java.io.FileWriter out_xml)
|
void |
setCat(java.lang.String newcat)
Sets the category of this NT |
| Methods inherited from class org.jscience.ml.tigerxml.GraphNode |
|---|
before, dominates, equals, getCorpus, getDominatingNodeByCat, getEdge2Mother, getEdge2SecMother, getId, getIndex, getLeftmostTerminal, getMother, getPath, getSecMothers, getSentence, getVerbosity, hasMother, hasSecMothers, hasSurfaceWord, isDominatedBy, isDominatedBy, isTerminal, printNode, printNode, printNodeErr, printNodeErr, printTree, printTreeErr, setEdge2Mother, setId, setIndex, setMother, setSecMother, setSentence, setTerminal, setVerbosity, toNodeInfoString, toString, toTreeString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public NT()
null
or empty.
public NT(org.w3c.dom.Element ntElement,
Sentence sent)
public NT(org.w3c.dom.Element ntElement,
Sentence sent,
int verbosity)
| Method Detail |
|---|
public void addDaughter(GraphNode newDaughter)
NT, a T,
or a GraphNode.
public void addSecDaughter(GraphNode newDaughter)
NT, a T,
or a GraphNode.
public boolean hasSecDaughters()
public void setCat(java.lang.String newcat)
public java.lang.String getCat()
public java.lang.String getSpan()
The concept "span" is taken from MMAX
(http://www.eml.org/nlp).
The idea is to have a compact string representation of all terminal IDs
underneath this NT.
For more methods related to MMAX concepts
SyncMMAXpublic java.util.ArrayList getDaughters()
GraphNode n = someNode.getChildren().get(1);
if (n.isTerminal) {
fooPos = n.getPos();
}
public java.util.ArrayList getSecDaughters()
GraphNode n = (GraphNode) someNode.getSDaughters().get(1);
if (n.isTerminal()) {
String fooPos = ((T)n).getPos();
}
public java.util.ArrayList getAllDaughters()
GraphNode n = (GraphNode) someNode.getAllDaughters().get(1);
if (n.isTerminal()) {
String fooPos = ((T)n).getPos();
}
public java.util.ArrayList getTerminals()
public java.lang.String getWords()
public java.lang.String getText()
getText in class GraphNodepublic java.util.ArrayList getDescendants()
GraphNode n = (GraphNode) someNode.getDescendants().get(1);
if (n.isTerminal()) {
String fooPos = ((T)n).getPos();
}
public java.util.ArrayList getAllDescendants()
GraphNode n = (GraphNode) someNode.getAllDescendants().get(1);
if (n.isTerminal()) {
String fooPos = ((T)n).getPos();
}
public java.util.ArrayList getDaughtersByLabel(java.lang.String edgelabel)
GraphNode n = (GraphNode) someNode.getDaughtersByLabel().get(1);
if (n.isTerminal()) {
String fooPos = ((T)n).getPos();
}
public java.util.ArrayList getAllDaughtersByLabel(java.lang.String edgelabel)
GraphNode n = (GraphNode) someNode.getAllDaughtersByLabel().get(1);
if (n.isTerminal()) {
String fooPos = ((T)n).getPos();
}
public java.util.ArrayList getDescendantsByLabel(java.lang.String edgelabel)
GraphNode n = (GraphNode) someNode.getDescendantsByLabel().get(1);
if (n.isTerminal()) {
String fooPos = ((T)n).getPos();
}
public java.util.ArrayList getAllDescendantsByLabel(java.lang.String edgelabel)
GraphNode n = (GraphNode) someNode.getAllDescendantsByLabel().get(1);
if (n.isTerminal()) {
String fooPos = ((T)n).getPos();
}
protected void print2Xml(java.io.FileWriter out_xml)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||