     (swap! query-cursor assoc-in [:query] query)))
 
 (defn- on-phonetic-changed [event query-cursor]
-  (let [query (:query @query-cursor)
+  (let [query    (:query @query-cursor)
         checked? (aget event "target" "checked")
-        query (if checked?
-                (str/replace query "word=" "phon=")
-                (str/replace query "phon=" "word="))]
+        query    (if checked?
+                   (str/replace query "word=" "phon=")
+                   (str/replace query "phon=" "word="))]
     (swap! query-cursor assoc-in [:query] query)))
 
 (defn- on-key-down [event query-cursor]

            [reagent.core :as reagent]))

(defn- phrase->cqp [phrase phonetic?]
  (let [attr (if phonetic? "phon" "word")
        chinese-chars-range "[\u4E00-\u9FFF\u3400-\u4DFF\uF900-\uFAFF]"
        ; Surround every Chinese character by space when constructing a cqp query,
        ; to treat it as if it was an individual word:
        phrase (str/replace phrase (re-pattern (str "(" chinese-chars-range ")")) " $1 ")]
    (->> (str/split phrase #"\s")
         (map #(if (= % "")
                ""

  [:span])

(defn search-inputs [{:keys [search-view search-queries]} {:keys [corpus]}]
  (let [view          (case @search-view
                        :extended extended
                        :cqp cqp
                        simple)
        languages     (:langs @corpus)
        multilingual? (> (count languages) 1)]
    [:span
     [:div.row-fluid.search-input-links
