19 lines
346 B
Python
19 lines
346 B
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
import MeCab, sys, string
|
|
|
|
term = sys.argv[1]
|
|
t = MeCab.Tagger('-d /usr/local/lib/mecab/dic/mecab-ko-dic')
|
|
|
|
mecabRes = t.parse(term)
|
|
|
|
mArray = mecabRes.split("\n")
|
|
|
|
res = ""
|
|
|
|
for i in range(len(mArray)-2) :
|
|
res = res + mArray[i].split("\t")[0]
|
|
if i != len(mArray)-3 :
|
|
res = res + ","
|
|
|
|
print(res) |