'An interface for parsing with the Malt Parser.
:param parser_dirname: The path to the maltparser directory that
contains the maltparser-1.x.jar
:type parser_dirname: str
:param model_filename: The name of the pre-trained model with .mco file
extension. If provided, training will not be required.
(see http://www.maltparser.org/mco/mco.html and
see http://www.patful.com/chalk/node/185)
:type model_filename: str
:param tagger: The tagger used to POS tag the raw string before
formatting to CONLL format. It should behave like `nltk.pos_tag`
:type tagger: function
:param additional_java_args: This is the additional Java arguments that
one can use when calling Maltparser, usually this is the heapsize
limits, e.g. `additional_java_args=[\'-Xmx1024m\']`
(see http://goo.gl/mpDBvQ)
:type additional_java_args: list'

def __init__(self, parser_dirname, model_filename=None, tagger=None, additional_java_args=None):

    self.malt_jars = find_maltparser(parser_dirname)
    self.additional_java_args = (additional_java_args if (additional_java_args is not None) else [])
    self.model = find_malt_model(model_filename)
    self._trained = (self.model != u'malt_temp.mco')
    self.working_dir = tempfile.gettempdir()
    self.tagger = (tagger if (tagger is not None) else malt_regex_tagger())
