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
(def lda (second (get-model "model"))) | |
(spit "2014.sch" (clojure.string/join "\n" (map #(clojure.string/join ";" %) (map vec (vec (.getTopWords lda 12)))))) |
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
(use 'clojure.java.io) | |
(use 'com.guokr.nlp.seg) | |
(def corpus-root "/path/to/directory") | |
(def corpus-dir (clojure.java.io/file corpus-root)) | |
(def corpus-files (file-seq corpus-dir)) | |
(def corpus-writer (writer (str corpus-root "/corpus.txt"))) | |
(defn line-by-line [wrtr lhdl] (fn [file] (with-open [rdr (reader file)] (doseq [line (line-seq rdr)] (.write wrtr (str (lhdl line) "\n")))))) |
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
#!/bin/bash | |
# | |
# A wrapper for runner | |
# | |
CUR="${BASH_SOURCE[0]}"; | |
if([ -h "${CUR}" ]) then | |
while([ -h "${CUR}" ]) do CUR=`readlink -m "${CUR}"`; done | |
fi | |
pushd . > /dev/null | |
cd `dirname ${CUR}` > /dev/null |
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
### | |
csmain.coffee | |
link for this section: | |
http://playground.wahlque.org/tutorials/coffeescript/004-webworkers/ | |
### | |
define [ | |
'underscore', | |
'domReady', | |
'qwery', |
NewerOlder