|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object se.lth.cs.nlp.nlputils.pstree.PSTree
public class PSTree
A phrase structure tree.
Field Summary | |
---|---|
ArrayList<Node> |
heads
The heads. |
ArrayList<Node> |
nodes
The nodes. |
ArrayList<TokenNode> |
tokens
The tokens. |
Node |
topnode
The top node. |
Constructor Summary | |
---|---|
PSTree()
|
Method Summary | |
---|---|
static PSTree |
collinsTree(String line)
Creates a parse tree from a string containing a tree in Collins' format, that is a phrase structure tree with heads. |
int |
countEndPunc(Node n)
Returns the number of punctuation tokens that the node n ends
with. |
static PSTree |
pennTree(String line)
Creates a parse tree from a string containing a tree in the Penn Treebank format. |
static PSTree |
pennTreeWithLemmas(String line)
Creates a parse tree from a string containing a tree in the Penn Treebank format with lemmas. |
String |
tabbedOutput()
Returns an indented string representing this tree. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public Node topnode
public ArrayList<TokenNode> tokens
public ArrayList<Node> heads
public ArrayList<Node> nodes
Constructor Detail |
---|
PSTree()
Method Detail |
---|
public static PSTree collinsTree(String line)
line
- the string.
public static PSTree pennTree(String line)
line
- the string.
public static PSTree pennTreeWithLemmas(String line)
line
- the string.
public String toString()
toString
in class Object
public int countEndPunc(Node n)
n
ends
with.
n
- the node.
public String tabbedOutput()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |