def tag_sents(self, sentences):
    encoding = self._encoding
    default_options = ' '.join(_java_options)
    config_java(options=self.java_options, verbose=False)
    (_input_fh, self._input_file_path) = tempfile.mkstemp(text=True)
    cmd = list(self._cmd)
    cmd.extend(['-encoding', encoding])
    _input_fh = os.fdopen(_input_fh, 'wb')
    _input = '\n'.join((' '.join(x) for x in sentences))
    if (isinstance(_input, compat.text_type) and encoding):
        _input = _input.encode(encoding)
    _input_fh.write(_input)
    _input_fh.close()
    (stanpos_output, _stderr) = java(cmd, classpath=self._stanford_jar, stdout=PIPE, stderr=PIPE)
    stanpos_output = stanpos_output.decode(encoding)
    os.unlink(self._input_file_path)
    config_java(options=default_options, verbose=False)
    return self.parse_output(stanpos_output, sentences)
def tag_sents(self, sentences):
    encoding = self._encoding
    default_options = ' '.join(_java_options)
    config_java(options=self.java_options, verbose=False)
    (_input_fh, self._input_file_path) = tempfile.mkstemp(text=True)
    cmd = list(self._cmd)
    cmd.extend(['-encoding', encoding])
    _input_fh = os.fdopen(_input_fh, 'wb')
    _input = '\n'.join((' '.join(x) for x in sentences))
    if (isinstance(_input, compat.text_type) and encoding):
        _input = _input.encode(encoding)
    _input_fh.write(_input)
    _input_fh.close()
    (stanpos_output, _stderr) = java(cmd, classpath=self._stanford_jar, stdout=PIPE, stderr=PIPE)
    stanpos_output = stanpos_output.decode(encoding)
    os.unlink(self._input_file_path)
    config_java(options=default_options, verbose=False)
    return self.parse_output(stanpos_output, sentences)