Show HN: Typkov - Generate typing lessons from your own writing (Clojure/Noir)(typkov.stevelosh.com)
typkov.stevelosh.com
Show HN: Typkov - Generate typing lessons from your own writing (Clojure/Noir)
http://typkov.stevelosh.com/
2 comments
Could this be used to generate typing lessons for programmers? One of the things lacking from many typing tools is practice typing symbols as used by programmers - I guess random code would be difficult to generate though and you'd need to specify language etc, although maybe just pasting in your github projects would be sufficient as learning material.
It works fine with code -- it basically just splits on whitespace and considers anything in the result to be a "word".
The code won't make sense, and parens/brackets/etc won't be balanced, but you can definitely use it for practicing.
EDIT:
Here are a few drills it generated when I gave it its own source code:
The code won't make sense, and parens/brackets/etc won't be balanced, but you can definitely use it for practicing.
EDIT:
Here are a few drills it generated when I gave it its own source code:
# Lesson generated by Typkov
Lesson 1
(string/split (sanitize text) #"\s+"))) dict [w n] 0))) (rest words))))))
lessons)))) (defn sanitize [s] (-> s (string/replace \" \"))) (defn
[lesson n] (let [w n] (let [initial-word (random-choice (keys dict))))
(defn markov-dict ([words] (markov-dict words) n "\n" (join-n lines)))) (defn
Lesson 2
text 24) [:text "You must enter a decent amount of
"])))) "G:MENU\n"))) (defn random-choice [coll] (nth coll (rand-int n))] (loop
data))) (render "/" data) (not (form-valid? data))) (render "/" data)
data} (t/home (:text data) (t/home (:text data) (not (second words)]
Lesson 3
n] (let [initial-word (random-choice (keys dict))] (case format n] (let
[w (first words) lessons (repeatedly n (partial string/join "\n")) (def
\' \') (string/replace \" \"))) (defn markov-dict ([words] (markov-dict {}
get-lesson [text format n] 0))) (rest choices))))))) (def join-nn (partial
You paste in some text (like blog entries, essays, code, and such that you've written) and it generates typing lessons based on that text using simple Markov chains. So instead of practicing random words from the dictionary you can practice with the kind of stuff you actually write in real life. It works surprisingly well.
Right now it outputs files for gtypist and ktouch. If there's another program you'd like supported let me know and if the file format isn't too terrible I'll add it.
It's open source (on BitBucket and GitHub), and I also recorded myself as I made the initial version, so if you like watching programmers work you might like that (though I'm pretty new to Clojure/Noir).
BitBucket: http://bitbucket.org/sjl/typkov/
GitHub: http://github.com/sjl/typkov
Screencast: http://youtu.be/uTwnoZEw7FE