I have a treebank with syntactic parse tree for each sentence as given below:
(S (NP (DT The) (NN government)) (VP (VBZ charges) (SBAR (IN that) (S (PP (IN between) (NP (NNP July) (CD 1971)) (CC and) (NP (NNP July) (CD 1992))) (, ,) (NP (NNP Rostenkowski)) (VP (VBD placed) (NP (CD 14) (NNS people)) (PP (IN on) (NP (NP (PRP$ his) (JJ congressional) (NN payroll)) (SBAR (WHNP (WP who)) (S (VP (VBD performed) (NP (NP (JJ personal) (NNS services)) (PP (IN for) (NP (NP (PRP him)) (CC and) (NP (PRP$ his) (NN family))))))))))))))
I want to annotate the parse tree with lexical information like headwords for each node in the parse tree.
Can I do that using StanfordCoreNLP? Please guide me in the right direction. I would prefer a solution that can be implemented in JAVA as I am familiar with JAVA.
Thanks a lot!