                   (load-hyphenation-patterns! @spelling @word))
      :on-blur #(lookup-hyphenation-pattern! @spelling @word)}]])
 
-(defn- hyphenation-valid? [s]
-  (and (not (string/blank? s))
-       (string/includes? s "-")
-       (re-matches #"[a-z\xDF-\xFF-]+" s)))
-
 (defn hyphenation-field []
   (let [label "Corrected Hyphenation"
         valid? (or (string/blank? @hyphenation) (hyphenation-valid? @hyphenation))

      (for [[word pattern] (:hyphenations @app-state)]
        ^{:key word} [hyphenation-pattern pattern])]]]])

;; -------------------------
;; Views

(defn home-page []
  [hyphenation-list])

(defn about-page []
  [:div [:h2 "About hyphen-keeper"]
   [:div [:a {:href "/"} "go to the home page"]]])

(defn current-page []
  [:div [(session/get :current-page)]])

      (button "TU Chemnitz" (str "http://dict.tu-chemnitz.de/?query=" word) disabled)
      (button "PONS" (str "http://de.pons.eu/dict/search/results/?l=dede&q=" word) disabled)]]))

(defn- navbar [active]
  [:nav.navbar.navbar-default
   [:div.container-fluid
    [:div.navbar-header
     [:button.navbar-toggle.collapsed
      {:type "button"
       :data-toggle "collapse"
       :data-target "#navbar-collapse"
       :aria-expanded "false"}
      [:span.sr-only "Toggle navigation"]
      [:span.icon-bar]
      [:span.icon-bar]
      [:span.icon-bar]]
     [:a.navbar-brand {:href "/"} "Hyphenation"]]
    [:div#navbar-collapse.navbar-collapse.collapse
     [:ul.nav.navbar-nav.navbar-right
      [:li
       (if (= active :edit) {:class "active"} {})
       [:a {:href "/edit"} "Edit"]]]]]])

;; -------------------------
;; Views

(defn home-page []
  [:div.container
   [navbar :insert]
   [:h2 "Insert Hyphenations"]
   [:div.row
    [:div.col-md-6
     [new-hyphenation]]]
   [:h2 "Lookup"]
   [hyphenation-lookup @word]
   [:h2 "Similar words"]
   [:div.row
    [:table#hyphenations.table.table-striped
     [:thead [:tr [:th "Word"] [:th "Hyphenation"]]]
