Skip to content

Instantly share code, notes, and snippets.

View lotz84's full-sized avatar

Tatsuya Hirose lotz84

View GitHub Profile
(import concurrent.futures)
(import sys)
(import subprocess)
(import time)
(import [collections [defaultdict]])
(import [data [sentences]])
(defn sent2kgram [sentence &optional [k (int "2")] [delimiter " "]]
(setv sentence (str (.getoutput subprocess (.format "echo {0} | mecab -O wakati" sentence))))