We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2429709 commit 856727cCopy full SHA for 856727c
src/intellitext/core.cljs
@@ -12,8 +12,13 @@
12
(def cells (map #(dom/getElement (str "cell" %)) [0 1 2]))
13
14
(defn make-suggestion []
15
- (let [input (last (string/split (.-value input-field) #" "))
16
- suggestions (iterate #(mca/step chain %) input)]
+ (let [input (string/lower-case
+ (last (string/split (.-value input-field) #" ")))
17
+ follow-ups (keys (chain input))
18
+ stream (if (< (count follow-ups) 3)
19
+ follow-ups
20
+ (repeatedly #(mca/step chain input)))
21
+ suggestions (distinct stream)]
22
(doseq [[cell word] (map list cells suggestions)]
23
(set! (.-innerHTML cell) word))))
24
0 commit comments