de.uni_tuebingen.sfb.lichtenstein.treebanks
Class Node

java.lang.Object
  extended by de.uni_tuebingen.sfb.lichtenstein.treebanks.Node

public class Node
extends Object

A node in a tree representing a sentence in the corpus.

Author:
Hendrik Maryns

Constructor Summary
Node(int id, int parent, String pos, String morph, String edge)
          Create a non-leaf node.
Node(int id, int parent, String pos, String morph, String edge, String lemma, String word)
          Create a leaf node.
 
Method Summary
 LinkedList<Node> getDaughters()
           
 String getEdgeLabel()
           
 int getId()
          Get the ID of this tree in the tree bank.
 int getLeftCorner()
           
 String getLemma()
          Get the lemma tag.
 String getMorph()
           
 int getParentId()
          Get the ID of the parent in the tree.
 String getPos()
          Get the Part-Of-Speech tag.
 int getRightCorner()
           
 String getWord()
           
 void insertDaughter(Node node)
           
 BinaryTree.BinaryNode toBinaryTree(List<Node> sisters, int sisterIndex)
          Convert to binary tree and collect label.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Node

public Node(int id,
            int parent,
            String pos,
            String morph,
            String edge)
Create a non-leaf node.

Parameters:
id - The node’s ID.
parent - The parent ID of the node.
pos - The part of speech tag of the node.
morph - The morphology tag of the node.
edge - The label of the edge to the node.

Node

public Node(int id,
            int parent,
            String pos,
            String morph,
            String edge,
            String lemma,
            String word)
Create a leaf node.

Parameters:
id - The node’s ID.
parent - The parent ID of the node.
pos - The part of speech tag of the node.
morph - The morphology tag of the node.
edge - The label of the edge to the node.
lemma - The lemma form of the word.
word - The word in the string corresponding to this node.
Method Detail

getId

public int getId()
Get the ID of this tree in the tree bank.

Returns:
The ID

getParentId

public int getParentId()
Get the ID of the parent in the tree.

Returns:
The ID of the parent of this node.

getPos

public String getPos()
Get the Part-Of-Speech tag.

Returns:
The part-of-speech tag.

getMorph

public String getMorph()

getEdgeLabel

public String getEdgeLabel()

getLemma

public String getLemma()
Get the lemma tag.

Returns:
The lemma tag.

getWord

public String getWord()

getLeftCorner

public int getLeftCorner()

getRightCorner

public int getRightCorner()

getDaughters

public LinkedList<Node> getDaughters()

insertDaughter

public void insertDaughter(Node node)

toBinaryTree

public BinaryTree.BinaryNode toBinaryTree(List<Node> sisters,
                                          int sisterIndex)
Convert to binary tree and collect label. We follow the leftmost-daughter next-sister encoding.

Parameters:
sisters - The sisters of the current node.
sisterIndex - The index of the sister in the sister list that should be processed next.
Returns:
A binary node that corresponds to this node in its binary form.

toString

public String toString()
Overrides:
toString in class Object


© Copyright 2008 Hendrik Maryns   Creative Commons License