louismullie / stanford-core-nlp

Ruby bindings to the Stanford Core NLP tools (English, French, German).
Other
433 stars 70 forks source link

Using SemanticGraph.OutputFormat enum as argument #51

Open nark opened 6 years ago

nark commented 6 years ago

Hey

First, thank you for the good work here, these bindings to the StanfordCoreNLP API are very useful !

I'm trying to print Stanford dependencies as XML using the toString() method. But I can't figure how to pass the enum argument properly. Do I have to manually load some classes before doing so? I tried the following options, without luck. Any hint ?

graph = sentence.get(:basic_dependencies).toString(XML)
graph = sentence.get(:basic_dependencies).toString(OutputFormat::XML)
graph = sentence.get(:basic_dependencies).toString(StanfordCoreNLP::SemanticGraph.OutputFormat.XML)