'This function generates the maltparser command use at the terminal.
:param inputfilename: path to the input file
:type inputfilename: str
:param outputfilename: path to the output file
:type outputfilename: str'

def generate_malt_command(self, inputfilename, outputfilename=None, mode=None):

    cmd = [u'java']
    cmd += self.additional_java_args
    classpaths_separator = (u';' if sys.platform.startswith(u'win') else u':')
    cmd += [u'-cp', classpaths_separator.join(self.malt_jars)]
    cmd += [u'org.maltparser.Malt']
    if os.path.exists(self.model):
        cmd += [u'-c', os.path.split(self.model)[(-1)]]
    else:
        cmd += [u'-c', self.model]
    cmd += [u'-i', inputfilename]
    if (mode == u'parse'):
        cmd += [u'-o', outputfilename]
    cmd += [u'-m', mode]
    return cmd
