'Starts the hunpos-tag executable and establishes a connection with it.
:param path_to_model: The model file.
:param path_to_bin: The hunpos-tag binary.
:param encoding: The encoding used by the model. Unicode tokens
passed to the tag() and tag_sents() methods are converted to
this charset when they are sent to hunpos-tag.
The default is ISO-8859-1 (Latin-1).
This parameter is ignored for str tokens, which are sent as-is.
The caller must ensure that tokens are encoded in the right charset.'

def __init__(self, path_to_model, path_to_bin=None, encoding=_hunpos_charset, verbose=False):

    self._closed = True
    hunpos_paths = ['.', '/usr/bin', '/usr/local/bin', '/opt/local/bin', '/Applications/bin', '~/bin', '~/Applications/bin']
    hunpos_paths = list(map(os.path.expanduser, hunpos_paths))
    self._hunpos_bin = find_binary('hunpos-tag', path_to_bin, env_vars=('HUNPOS_TAGGER',), searchpath=hunpos_paths, url=_hunpos_url, verbose=verbose)
    self._hunpos_model = find_file(path_to_model, env_vars=('HUNPOS_TAGGER',), verbose=verbose)
    self._encoding = encoding
    self._hunpos = Popen([self._hunpos_bin, self._hunpos_model], shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE)
    self._closed = False
