ikegami-yukino / pymlask

Emotion analyzer for Japanese text
Other
114 stars 26 forks source link

fixed a bug related to extracting information from mecab result. #5

Closed Kensuke-Mitsuzawa closed 7 years ago

Kensuke-Mitsuzawa commented 7 years ago

Python2.x/Python3.xの両方でエラーが実行エラーが出てしまうので、修正しました。

Python2.x/Python3.x共通エラー

_lexical_analysis() 内部で、mecabの解析結果を取得する部分。 記号 ( のfeatureが1つしか存在しない。 なので、features要素を足りなくて、エラーになる。

対処

featureが1つしかない場合のルールを追加

Python3.xエラー

nodeオブジェクトからsurface要素を獲得できない。参考情報

対処

__init__() 内部に self.mecab.parse('') を記述

以下の環境で検証しました

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-2.9%) to 93.827% when pulling 44570b45924323e3bbed99a5fdc0d027bdaec778 on Kensuke-Mitsuzawa:master into 20bd11a79eceb38a7eb3eded5736fc024c90a645 on ikegami-yukino:master.

ikegami-yukino commented 7 years ago

LGTM 👍