Is it possible to parse a sentence using the Stanford Parser by passing a string and not an array of strings. This is the example they gave in their short tutorial (See Docs
For simple usage, with the default tokenizer and default tokenizer options for a grammar, there is an easy convenience method you can use:
lp.parse(String)
But the PTBTokenizer
methods that you point at don't take a FileReader
, they just take a Reader
, so you can also easily point a PTBTokenizer
at a String by wrapping the String in a StringReader
. This is the right approach if you need more control over how tokenization happens.