From 93438350712ec2c2b3e99d8162cf04450e5273e0 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 3 Jul 2018 17:20:23 +0300 Subject: [PATCH] added weight param --- pymystem3/mystem.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pymystem3/mystem.py b/pymystem3/mystem.py index 94bb49c..062f11e 100644 --- a/pymystem3/mystem.py +++ b/pymystem3/mystem.py @@ -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 @@ -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