Hello all,

If you have something like this:

Statement : On Tuesday, John Smith bought a Honda Accord

(TOP (SBAR (IN On) (S (NP (NNP Tuesday,) (NNP John) (NNP Smith)) (VP (VBD
bought) (NP (DT a) (NNP Honda) (NNP Accord))))))

I have generated that from the Parse class Show() method as bellow:

 /**
   * Displays this parse using Penn Treebank-style formatting.
   */
  public void show() {
    StringBuffer sb = new StringBuffer(text.length()*4);
    show(sb);
    System.out.println(sb);
  }


My question is: How can I translate (TOP (SBAR (IN On) (S (NP (NNP
Tuesday,) (NNP John) (NNP Smith)) (VP (VBD bought) (NP (DT a) (NNP Honda)
(NNP Accord)))))) into a tree object?

I think I would parse that with ( -> new node, (-> new child, ) -> end node.

But is there some example that someone might have already done and you
could refer to me?

Thanks,

Carlos.

Reply via email to