Last active
October 12, 2016 06:57
-
-
Save j-min/fd7f3bab0d35ef82ade05ce965fb75eb to your computer and use it in GitHub Desktop.
Mecab-ko based POS tagging iterator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from konlpy.tag import Mecab | |
mecab = Mecab() | |
import sys | |
reload(sys) | |
sys.setdefaultencoding('utf-8') | |
def mecab_pos_tag(): | |
while True: | |
a = raw_input() | |
for x in mecab.pos(a): | |
print x[0].encode('utf-8').decode('utf-8'), x[1] | |
if __name__ == '__main__': | |
mecab_pos_tag() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ex)
python Mecab-ko-iter.py
대출 신청했는데 감감무소식이라서요
대출 NNG
신청 NNG
했 XSV+EP
는데 EC
감감무소식 NNG
이 VCP
라서요 EC