Skip to content

Commit

Permalink
control.py: use mecab to deconjugate verbs
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeprobst committed Feb 5, 2012
1 parent a618a20 commit aa2b165
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README
Expand Up @@ -8,6 +8,7 @@ copy kepwing wherever you like your binaries
usage
---------------------------------------
ctrl+d to bring up dict list/preference window
ctrl+l to select search bar
=======================================

fifo
Expand Down
6 changes: 6 additions & 0 deletions control.py
Expand Up @@ -4,13 +4,19 @@
from sys import argv
import os
import stat
import MeCab


def main(t):
cb = os.popen("xsel").read()
path = os.getenv("XDG_CONFIG_HOME") + "/kepwing/control"
if not stat.S_ISFIFO(os.stat(path)[stat.ST_MODE]):
return

m = MeCab.Tagger()
cb = m.parseToNode(cb).next.feature.split(',')[6]
print cb

f = open(path, "w")
if t == "popup":
f.write("popup %s\n" % cb)
Expand Down

0 comments on commit aa2b165

Please sign in to comment.