From: Tony Arcieri Date: 2009-09-15T20:02:26+09:00 Subject: Re: How to convert an string like this into a tree Object? --001636b2b12997aebe04739bb7c1 Content-Type: text/plain; charset=ISO-8859-1 With JRuby you can work directly with the Java objects coming out of your parser. This is probably the best way to write a Ruby wrapper. On Tue, Sep 15, 2009 at 12:20 AM, Possum wrote: > Hi, guys , > > recently I'm working on stanford parser(written in java) which has an > in-complete ruby rapper.I can get the result like this as a string , > but I still want to manipulate the result as an tree , what is the > convinient way for me to convert the following string to an tree > object,can someone give me some suggestion? > > (ROOT > (S > (S > (NP > (NP (DT The) (JJS strongest) (NN rain)) > (VP > (ADVP (RB ever)) > (VBN recorded) > (PP (IN in) > (NP (NNP India))))) > (VP > (VP (VBD shut) > (PRT (RP down)) > (NP > (NP (DT the) (JJ financial) (NN hub)) > (PP (IN of) > (NP (NNP Mumbai))))) > (, ,) > (VP (VBD snapped) > (NP (NN communication) (NNS lines))) > (, ,) > (VP (VBD closed) > (NP (NNS airports))) > (CC and) > (VP (VBD forced) > (NP > (NP (NNS thousands)) > (PP (IN of) > (NP (NNS people)))) > (S > (VP (TO to) > (VP > (VP (VB sleep) > (PP (IN in) > (NP (PRP$ their) (NNS offices)))) > (CC or) > (VP (VB walk) > (NP (NN home)) > (PP (IN during) > (NP (DT the) (NN night)))))))))) > (, ,) > (NP (NNS officials)) > (VP (VBD said) > (NP-TMP (NN today))) > (. .))) > > -- Tony Arcieri Medioh/Nagravision --001636b2b12997aebe04739bb7c1--