 
 (def spelling (reagent/cursor app-state [:spelling]))
 (def word (reagent/cursor app-state [:word]))
+(def hyphenations (reagent/cursor app-state [:hyphenations]))
 (def hyphenation (reagent/cursor app-state [:hyphenation]))
 (def suggested-hyphenation (reagent/cursor app-state [:suggested-hyphenation]))
 

          [hyphenation-pattern-edit-ui word new-hyphenation stop save])))))

(defn word-ui []
  [:div.form-group
   [:label {:for "wordInput"} "Word"]
   [:input.form-control
    {:id "wordInput"
     :type "text"
     :placeholder "Word"
     :auto-focus true
     :value @word
     :on-change (fn [e]
                  (reset! word (-> e .-target .-value string/lower-case))
                  (load-hyphenation-patterns! @spelling @word))
     :on-blur #(lookup-hyphenation-pattern! @spelling @word)}]])

(defn hyphenation-ui []
  (let [label "Corrected Hyphenation"
        klass (if (hyphenation-valid? @hyphenation @word) "form-group" "form-group has-error")]
    [:div
     {:class klass}
     [:label {:for "hyphenationInput"} label]
     [:input.form-control
      {:type "text"
       :placeholder label
       :value @hyphenation
       :on-change #(reset! hyphenation (-> % .-target .-value string/lower-case))}]]))

(defn- hyphenation-add-ui []
  [:div.form-group

(defn- hyphenation-pattern-edit-ui
  [word new-hyphenation stop save]
  (let [valid? (hyphenation-valid? @new-hyphenation word)
        klass (when-not valid? "has-error")
        help-text (when-not valid? "The hyphenation is not valid")]
    [:tr
     [:td word]
     [:td
      [:div.form-group
       {:class klass}
       [:input.form-control
        {:type "text"
         :auto-focus true
         :aria-describedby "hyphenationEditHelp"
         :on-change #(reset! new-hyphenation (-> % .-target .-value))
         :on-key-down #(case (.-which %)
                         27 (stop)
                         nil)
         :value @new-hyphenation}]
       (when help-text
         [:span#hyphenationEditHelp.help-block help-text])]]
     [:td
      [:div.btn-group
       [:button.btn.btn-default
