Skip to content

Commit

Permalink
Merge pull request #23 from crazyministr/master
Browse files Browse the repository at this point in the history
Weight parameter
  • Loading branch information
alexanderpanchenko authored Jul 3, 2018
2 parents 62351ce + 9343835 commit 90e938b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pymystem3/mystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,18 @@ class Mystem(object):
:type disambiguation: bool
:param entire_input: copy entire input to output
:type entire_input: bool
:param weight: print context-independent lemma weight
:type weight: bool
.. note:: Default value of :py:attr:`mystem_bin` can be overwritted by :envvar:`MYSTEM_BIN`.
"""

def __init__(self, mystem_bin=None, grammar_info=True, disambiguation=True, entire_input=True):
def __init__(self, mystem_bin=None, grammar_info=True, disambiguation=True, entire_input=True, weight=True):
self._mystem_bin = mystem_bin
self._grammar_info = grammar_info
self._disambiguation = disambiguation
self._entire_input = entire_input
self._weight = weight
self._procin = None
self._procout = None
self._procout_no = None
Expand All @@ -191,6 +194,9 @@ def __init__(self, mystem_bin=None, grammar_info=True, disambiguation=True, enti
if self._entire_input is True:
self._mystemargs.append('-c')

if self._weight is True:
self._mystemargs.append('--weight')

def __del__(self):
self.close() # terminate process on exit

Expand Down

0 comments on commit 90e938b

Please sign in to comment.