Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #295 with assertion warning for phrase input #320 #321

Merged
merged 3 commits into from
Jul 28, 2020
Merged

Fix #295 with assertion warning for phrase input #320 #321

merged 3 commits into from
Jul 28, 2020

Conversation

daun-io
Copy link
Member

@daun-io daun-io commented Jul 25, 2020

#295 이슈에서 제기된 문제로, tagger 클래스들의 .pos method를 사용할 때 사용자들이 올바른 입력을 넣었는지 확인할 수 없는 부분을 assertion 오류를 통해서 개선합니다.

Example:

>>> tagger.pos([])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/daunjung/GitHub/konlpy/konlpy/tag/_okt.py", line 60, in pos
    validate_phrase_inputs(phrase)
  File "/Users/daunjung/GitHub/konlpy/konlpy/tag/_common.py", line 14, in validate_phrase_inputs
    assert isinstance(phrase, str), msg
AssertionError: phrase input should be string, not <class 'list'>
>>> tagger.pos("asdf")
[('asdf', 'Alpha')]

@coveralls
Copy link

coveralls commented Jul 25, 2020

Coverage Status

Coverage increased (+0.9%) to 52.141% when pulling 6c545eb on nyanye:master into ed4f2b2 on konlpy:master.

@daun-io
Copy link
Member Author

daun-io commented Jul 25, 2020

https://travis-ci.org/github/konlpy/konlpy/builds/711686088
python 2.7.15 환경에서의 간헐적으로 JPype 패키지를 설치하는 데에 실패하는 것 외에 (해당 문제의 원인은 정확히 알 수 없네요) python 3.6, 3.7 환경에서의 test는 잘 동작하는 것으로 확인되었습니다 :)

@daun-io daun-io requested a review from minhoryang July 25, 2020 08:43
@daun-io daun-io merged commit 7b9281a into konlpy:master Jul 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants