I would like to use MaltParser in conjunction with Nltk.
Bu it happens that the same code works in the python shell, but gives an error message if put in a script:
>>> import nltk >>> parser = nltk.parse.malt.MaltParser(working_dir="/home/ubuntu/maltparser-1.7.2", mco="engmalt.linear-1.7") >>> txt = "This is a test sentence" >>> graph = parser.raw_parse(txt) >>> graph.tree().pprint() '(This (sentence is a test))'