Hi!
I am trying to use Stanford parser, written in Java
(http://www-nlp.stanford.edu/software/index.shtml). I translated the
following Java command for the parser:
import edu.stanford.nlp.parser.lexparser.LexicalizedParser;
class ParserDemo {
public static void main(String[] args) {
LexicalizedParser lp = new LexicalizedParser("englishPCFG.ser.gz");
lp.setOptionFlags(new String[]{"-maxLength", "80",
"-retainTmpSubcategories"});
into the following Jython language:
from edu.stanford.nlp.parser.lexparser import LexicalizedParser
lp = LexicalizedParser('englishPCFG.ser.gz')
lp.setOptionFlags("-maxLength", "80", "-retainTmpSubcategories")
Then I got the following error: "TypeError: setOptionFlags(): expected 1
args; got 3"
If I put only one argument and type: lp.setOptionFlags("-maxLength 80")
I get the following error: "TypeError: setOptionFlags(): 1st arg can't
be coerced to String[]"
I also wanted to increase the heap space and typed:
lp.setOptionFlags("-mx512m")
Then got the same message: "TypeError: setOptionFlags(): 1st arg can't
be coerced to String[]"
Can someone tell me what I am doing wrong? Is this the wrong way
of passing arguments to Jython methods?
Thank you very much.