whitespace and simplify "vino"

whitespace and simplify "vino"

--- src/babel/italiano/lexicon.cljc
+++ src/babel/italiano/lexicon.cljc
@@ -56,7 +56,7 @@
               :subcat {:1 {:cat :noun
                            :sem {:city true}}
                        :2 '()}}}
-
+
     ;; "a mezzogiorno"
     {:synsem {:cat :prep
               :sem {:pred :a}
@@ -540,18 +540,16 @@
    "cantare" {:synsem {:cat :verb
                        :sem {:pred :sing
                              :subj {:human true}}}}
-  "camicia"
-  {:synsem {:agr {:gender :fem}
-            :cat :noun
-            :sem {:pred :camicia
-                  ;; (although an exception would be tshirts with writing on them):
-                  :legible false
-                  :clothing true}}}
-
-    "camminare"
-    {:synsem {:sem {:pred :walk}
-              :cat :verb}}
-
+   "camicia"
+   {:synsem {:agr {:gender :fem}
+             :cat :noun
+             :sem {:pred :camicia
+                   ;; (although an exception would be tshirts with writing on them):
+                   :legible false
+                   :clothing true}}}
+   "camminare"
+   {:synsem {:sem {:pred :walk}
+             :cat :verb}}
    "cane"
    {:synsem {:agr {:gender :masc}
              :cat :noun
@@ -582,16 +580,16 @@
               :subcat '()}}
     ]

-    "cattivo"
-     (unify adjective
-            {:synsem {:cat :adjective
-                      :sem {:pred :cattivo
-                            :comparative false
-                            :human true;; TODO:should not need this because child => human.
-                            :child true}}
-             :italiano {:cat :adjective}})
-
-      ;; working on: "mi sono comprato un nuovo cellulare"
+   "cattivo"
+   (unify adjective
+          {:synsem {:cat :adjective
+                    :sem {:pred :cattivo
+                          :comparative false
+                          :human true;; TODO:should not need this because child => human.
+                          :child true}}
+           :italiano {:cat :adjective}})
+
+   ;; working on: "mi sono comprato un nuovo cellulare"
    "cellulare"
    {:synsem {:agr {:gender :masc}
              :cat :noun
@@ -602,13 +600,13 @@
                    :place false
                    :speakable false}}}

-     "cenare" {:synsem {:cat :verb
+   "cenare" {:synsem {:cat :verb
                       :essere false
                       :sem {:subj {:human true}
                             :pred :have-dinner}}}

-     "chiacchierare" {:synsem {:cat :verb
-                               :sem {:pred :chat}}}
+   "chiacchierare" {:synsem {:cat :verb
+                             :sem {:pred :chat}}}

    "chiamarsi" (let [subject-semantics (atom {:animate true})
                      called-semantics (atom :top)
@@ -639,10 +637,10 @@
                                         :sem called-semantics
                                         :cat :noun
                                         :subcat '()}}}})
-     "chiedere" {:synsem {:cat :verb
-                          :sem {:subj {:human true}
-                                :pred :chiedere}}
-                 :italiano {:passato "chiesto"}}
+   "chiedere" {:synsem {:cat :verb
+                        :sem {:subj {:human true}
+                              :pred :chiedere}}
+               :italiano {:passato "chiesto"}}

    "chiudere" {:synsem {:cat :verb
                         :sem {:subj {:human true}
@@ -660,43 +658,43 @@
 ;                     :elective-existential true}
 ;               :subcat '()}}

-      "ci"
-      {:synsem {:cat :noun
-                :pronoun true
-                :case pronoun-acc
-                :agr {:person :1st
-                      :number :plur}
-                :sem {:human true
-                      :pred :noi}
-                :subcat '()}
-       :italiano {:initial true
-                  :cat :noun
-                  :case pronoun-acc}}
-
-  "cipolla"
-  {:synsem {:agr {:gender :fem}
-            :cat :noun
-            :sem {:pred :cipolla
-                  :edible true
-                  :animate false
-                  :artifact false}}}
+   "ci"
+   {:synsem {:cat :noun
+             :pronoun true
+             :case pronoun-acc
+             :agr {:person :1st
+                   :number :plur}
+             :sem {:human true
+                   :pred :noi}
+             :subcat '()}
+    :italiano {:initial true
+               :cat :noun
+               :case pronoun-acc}}
+
+   "cipolla"
+   {:synsem {:agr {:gender :fem}
+             :cat :noun
+             :sem {:pred :cipolla
+                   :edible true
+                   :animate false
+                   :artifact false}}}

-      "cercare" {:synsem {:cat :verb
-                          :essere false
-                          :sem {:activity true
-                                :discrete false
-                                :pred :cercare
-                                :subj {:animate true}}}}
-  "città"
-  {:synsem {:agr {:gender :fem}
-            :cat :noun
-            :sem {:artifact true
-                  :buyable false  ;; can't buy a city (unless you're a billionaire like Mike Bloomberg)
-                  :city true
-                  :place true
-                  :pred :città}
-            :subcat {:1 {:cat :det
-                         :def :def}}}} ;; TODO: why must :def be specifically :def here?
+   "cercare" {:synsem {:cat :verb
+                       :essere false
+                       :sem {:activity true
+                             :discrete false
+                             :pred :cercare
+                             :subj {:animate true}}}}
+   "città"
+   {:synsem {:agr {:gender :fem}
+             :cat :noun
+             :sem {:artifact true
+                   :buyable false  ;; can't buy a city (unless you're a billionaire like Mike Bloomberg)
+                   :city true
+                   :place true
+                   :pred :città}
+             :subcat {:1 {:cat :det
+                          :def :def}}}} ;; TODO: why must :def be specifically :def here?

    "cittadino" {:synsem {:cat :adjective
                          :sem {:pred :local}}}
@@ -731,98 +729,96 @@
                    :buyable false
                    :artifact true}}}

-      "commentare"  {:synsem {:cat :verb
-                              :sem {:pred :comment}}}
-
-      "comprare" {:synsem {:cat :verb
-                           :essere false
-                           :sem {:pred :comprare
-                                 :subj {:human true}
-                                 :obj {:buyable true}}}}
+   "commentare"  {:synsem {:cat :verb
+                           :sem {:pred :comment}}}
+
+   "comprare" {:synsem {:cat :verb
+                        :essere false
+                        :sem {:pred :comprare
+                              :subj {:human true}
+                              :obj {:buyable true}}}}
+
+   "condividere"  {:synsem {:cat :verb
+                            :sem {:pred :share}}}
+
+   "conservare" [{:synsem {:cat :verb
+                           :sem {:pred :conserve}}}
+                 {:synsem {:cat :verb
+                           :sem {:pred :preserve}}}]
+
+   "considerare"  {:synsem {:cat :verb
+                            :sem {:pred :consider}}}
+
+   "contare" {:synsem {:sem {:pred :count}
+                       :cat :verb}}

-      "condividere"  {:synsem {:cat :verb
-                               :sem {:pred :share}}}
-
-      "conservare" [{:synsem {:cat :verb
-                              :sem {:pred :conserve}}}
-                    {:synsem {:cat :verb
-                              :sem {:pred :preserve}}}]
-
-
-      "considerare"  {:synsem {:cat :verb
-                               :sem {:pred :consider}}}
-
-      "contare" {:synsem {:sem {:pred :count}
-              :cat :verb}}
-
-      "contento"
-      [(let [complement-complement-sem (atom {:human true})
-             complement-sem (atom {:pred :di
-                                  :mod complement-complement-sem})
-             subject-sem (atom {:place true})]
-         (unify adjective
-                comparative
-                {:synsem {:sem {:pred :contento
-                                :arg1 subject-sem
-                                :arg2 complement-complement-sem}
-                        :subcat {:1 {:cat :noun
-                                     :sem subject-sem}
-                                 :2 {:cat :prep
-                                     :sem complement-sem}}}})
-
-         ;; non-comparative
-         (unify adjective
-                {:synsem {:cat :adjective
-                          :sem {:pred :contento
-                                :comparative false
-                                :human true}}}))]
-
-      "contraccambiare" {:synsem {:sem {:pred :reciprocate}
-                                  :cat :verb}}
-
-      "correre"  {:italiano {:passato "corso"}
-                  :synsem {:cat :verb
-                           :sem {:pred :run}}}
-
-      "corrispondere"  {:synsem {:cat :verb
-                                 :sem {:pred :correspond}}}
-
-      "corto"
-      [(let [complement-complement-sem (atom {:human true}) ;; only humans can be short.
-             complement-sem (atom {:pred :di
-                                  :mod complement-complement-sem})
-             subject-sem (atom {:human true})] ;; only humans can be short.
-        (unify adjective
-               comparative
-               {:synsem {:sem {:pred :corto
-                               :arg1 subject-sem
-                               :arg2 complement-complement-sem}
-                         :subcat {:1 {:cat :noun
-                                      :sem subject-sem}
-                                  :2 {:cat :prep
-                                      :sem complement-sem}}}}))
-
-       ;; non-comparative
-       (unify adjective
-              {:synsem {:cat :adjective
-                        :sem {:pred :corto
-                              :comparative false
-                              :human true}}
-               :italiano {:cat :adjective}})]
-
-      "creare"  {:synsem {:cat :verb
-                          :sem {:pred :create}}}
-
-      "controllare" {:synsem {:sem {:pred :check}
-                              :cat :verb}}
+   "contento"
+   [(let [complement-complement-sem (atom {:human true})
+          complement-sem (atom {:pred :di
+                                :mod complement-complement-sem})
+          subject-sem (atom {:place true})]
+      (unify adjective
+             comparative
+             {:synsem {:sem {:pred :contento
+                             :arg1 subject-sem
+                             :arg2 complement-complement-sem}
+                       :subcat {:1 {:cat :noun
+                                    :sem subject-sem}
+                                :2 {:cat :prep
+                                    :sem complement-sem}}}})
+
+      ;; non-comparative
+      (unify adjective
+             {:synsem {:cat :adjective
+                       :sem {:pred :contento
+                             :comparative false
+                             :human true}}}))]
+
+   "contraccambiare" {:synsem {:sem {:pred :reciprocate}
+                               :cat :verb}}
+
+   "correre"  {:italiano {:passato "corso"}
+               :synsem {:cat :verb
+                        :sem {:pred :run}}}
+
+   "corrispondere"  {:synsem {:cat :verb
+                              :sem {:pred :correspond}}}
+
+   "corto"
+   [(let [complement-complement-sem (atom {:human true}) ;; only humans can be short.
+          complement-sem (atom {:pred :di
+                                :mod complement-complement-sem})
+          subject-sem (atom {:human true})] ;; only humans can be short.
+      (unify adjective
+             comparative
+             {:synsem {:sem {:pred :corto
+                             :arg1 subject-sem
+                             :arg2 complement-complement-sem}
+                       :subcat {:1 {:cat :noun
+                                    :sem subject-sem}
+                                :2 {:cat :prep
+                                    :sem complement-sem}}}}))
+    ;; non-comparative
+    (unify adjective
+           {:synsem {:cat :adjective
+                     :sem {:pred :corto
+                           :comparative false
+                           :human true}}
+            :italiano {:cat :adjective}})]
+
+   "creare"  {:synsem {:cat :verb
+                       :sem {:pred :create}}}
+
+   "controllare" {:synsem {:sem {:pred :check}
+                           :cat :verb}}

-      ;; TODO: account for "dare" being ditransitive.
-      "dare"  {:synsem {:cat :verb
-                        :sem {:pred :give}}
-               :italiano {:present {:2sing "dai"
-                                    :3plur "danno"}
-                          :future-stem "dar"}}
+   ;; TODO: account for "dare" being ditransitive.
+   "dare"  {:synsem {:cat :verb
+                     :sem {:pred :give}}
+            :italiano {:present {:2sing "dai"
+                                 :3plur "danno"}
+                       :future-stem "dar"}}

 ;; TODO: something wrong here with respect to passato: probably the :essere=false is causing a problem.
 ;        :synsem {:cat :verb
@@ -832,97 +828,97 @@
 ;                      :iobj {:animate true}
 ;                       :obj {:buyable true}}}})

-      "decidere"  {:synsem {:cat :verb
-                            :essere false
-                            :sem {:pred :decide}}
-                   :italiano {:passato "deciso"}}
-
-      "del"
-      {:synsem {:cat :det
-                :def :partitivo
-                :agr {:number :sing
-                      :gender :masc}}}
-      "dei"
-      {:synsem {:cat :det
-                :def :partitivo
-                :agr {:number :plur
-                      :gender :masc}}}
-      "della"
-      {:synsem {:cat :det
-                :def :partitivo
-                :agr {:number :sing
-                      :gender :fem}}}
-      "delle"
-      {:synsem {:cat :det
-                :def :partitivo
-                :agr {:number :plur
-                      :gender :fem}}}
-      "deludere"
-       {:italiano {:passato "deluso"}
-        :synsem {:cat :Verb
-                 :essere false
-                 :sem {:deliberate false
-                       :discrete true
-                       :activity false
-                       :pred :deludere
-                       :subj {:human true}
-                       :obj {:human true}}}}
-
-      "desiderare"  {:synsem {:cat :verb
-                              :sem {:pred :desire}}}
-
-      "dettare" {:synsem {:cat :verb
-                         :sem {:pred :dictate}}}
-
-      "di"
-      {:synsem {:cat :prep
-                :sem {:pred :di
-                      :comparative true}
-                :subcat {:1 {:cat :noun
-                             :subcat '()
-                             :def {:not :partitivo} ;; avoid alliteration like "di delle ragazze (of some women)"
-                             :case :disj ;; pronouns must be disjunctive (me/te/lui/lei...etc)
-                           ;; non-pronouns will unify with this constraint.
-                             }
-                         :2 '()}}
-       :italiano {:initial true}}
-
-      "di la"
-      {:synsem {:cat :det
-                :def :partitivo
-                :agr {:number :sing
-                      :gender :fem}
-                :mass true}}
-      "di le"
-      {:synsem {:cat :det
-                :def :partitivo
-                :agr {:number :plur
-                      :gender :fem}}}
-      "di il"
-      {:synsem {:cat :det
-                :def :partitivo
-                :mass true
-                :agr {:number :sing
-                      :gender :masc}}}
-      "difficile"
-      ;; non-comparative
-      ;; TODO: add comparative
-      (unify adjective
-             {:synsem {:cat :adjective
-                       :sem {:pred :difficile
-                             :comparative false
-                             ;; "difficile" has a very specific list of things it can modify:
-                             :drinkable false
-                             :human false
-                             :animate false
-                             :buyable false
-                             :legible true
-;                             :activity true ;; TODO: cannot declare this as an activity because of some semantic implicature..
-                             :artifact true
-                             :physical-object true
-                             :edible false}}
-              :italiano {:cat :adjective
-                         :fem {:sing "difficile"}}})
+   "decidere"  {:synsem {:cat :verb
+                         :essere false
+                         :sem {:pred :decide}}
+                :italiano {:passato "deciso"}}
+
+   "del"
+   {:synsem {:cat :det
+             :def :partitivo
+             :agr {:number :sing
+                   :gender :masc}}}
+   "dei"
+   {:synsem {:cat :det
+             :def :partitivo
+             :agr {:number :plur
+                   :gender :masc}}}
+   "della"
+   {:synsem {:cat :det
+             :def :partitivo
+             :agr {:number :sing
+                   :gender :fem}}}
+   "delle"
+   {:synsem {:cat :det
+             :def :partitivo
+             :agr {:number :plur
+                   :gender :fem}}}
+   "deludere"
+   {:italiano {:passato "deluso"}
+    :synsem {:cat :Verb
+             :essere false
+             :sem {:deliberate false
+                   :discrete true
+                   :activity false
+                   :pred :deludere
+                   :subj {:human true}
+                   :obj {:human true}}}}
+
+   "desiderare"  {:synsem {:cat :verb
+                           :sem {:pred :desire}}}
+
+   "dettare" {:synsem {:cat :verb
+                       :sem {:pred :dictate}}}
+
+   "di"
+   {:synsem {:cat :prep
+             :sem {:pred :di
+                   :comparative true}
+             :subcat {:1 {:cat :noun
+                          :subcat '()
+                          :def {:not :partitivo} ;; avoid alliteration like "di delle ragazze (of some women)"
+                          :case :disj ;; pronouns must be disjunctive (me/te/lui/lei...etc)
+                          ;; non-pronouns will unify with this constraint.
+                          }
+                      :2 '()}}
+    :italiano {:initial true}}
+
+   "di la"
+   {:synsem {:cat :det
+             :def :partitivo
+             :agr {:number :sing
+                   :gender :fem}
+             :mass true}}
+   "di le"
+   {:synsem {:cat :det
+             :def :partitivo
+             :agr {:number :plur
+                   :gender :fem}}}
+   "di il"
+   {:synsem {:cat :det
+             :def :partitivo
+             :mass true
+             :agr {:number :sing
+                   :gender :masc}}}
+   "difficile"
+   ;; non-comparative
+   ;; TODO: add comparative
+   (unify adjective
+          {:synsem {:cat :adjective
+                    :sem {:pred :difficile
+                          :comparative false
+                          ;; "difficile" has a very specific list of things it can modify:
+                          :drinkable false
+                          :human false
+                          :animate false
+                          :buyable false
+                          :legible true
+                                        ;                             :activity true ;; TODO: cannot declare this as an activity because of some semantic implicature..
+                          :artifact true
+                          :physical-object true
+                          :edible false}}
+           :italiano {:cat :adjective
+                      :fem {:sing "difficile"}}})

    "dipingere" {:synsem {:cat :verb
                          :sem {:pred :paint}}
@@ -941,32 +937,32 @@
                     {:synsem {:sem {:pred :tell}}})])

-      "diventare" {:synsem {:essere true
-                            :cat :verb
-                            :sem {:pred :become}}}
+   "diventare" {:synsem {:essere true
+                         :cat :verb
+                         :sem {:pred :become}}}

-      "divertirsi" (let [subject-semantics (atom {:human true})
-                         subject-agr (atom :top)]
-                     {:synsem {:cat :verb
-                               :essere true
-                               :sem {:pred :have-fun
-                                     :reflexive true
-                                     :subj subject-semantics
-                                     :obj subject-semantics}
-                               :subcat {:1 {:agr subject-agr
-                                            :sem subject-semantics}
-                                        :2 {:agr subject-agr
-                                            :pronoun true
-                                            :reflexive true
-                                            :sem subject-semantics}}}})
-      "domani"
-      (unify sentential-adverb
-             {:synsem {:cat :sent-modifier
-                       :sem {:pred :domani}
-                       :subcat {:1 {:infl :future
-                                    :sem {:tense :future}
-                                    :subcat '()}}}
-              :italiano "domani"})
+   "divertirsi" (let [subject-semantics (atom {:human true})
+                      subject-agr (atom :top)]
+                  {:synsem {:cat :verb
+                            :essere true
+                            :sem {:pred :have-fun
+                                  :reflexive true
+                                  :subj subject-semantics
+                                  :obj subject-semantics}
+                            :subcat {:1 {:agr subject-agr
+                                         :sem subject-semantics}
+                                     :2 {:agr subject-agr
+                                         :pronoun true
+                                         :reflexive true
+                                         :sem subject-semantics}}}})
+   "domani"
+   (unify sentential-adverb
+          {:synsem {:cat :sent-modifier
+                    :sem {:pred :domani}
+                    :subcat {:1 {:infl :future
+                                 :sem {:tense :future}
+                                 :subcat '()}}}
+           :italiano "domani"})

    "donna"
    {:synsem {:agr {:gender :fem}
@@ -974,7 +970,7 @@
              :sem {:human true
                    :pred :donna
                    :child false}}}
-  "dopo"
+   "dopo"
    (let [time (atom {:time true})]
      {:synsem {:cat :prep
                :sem {:pred :after
@@ -983,158 +979,158 @@
                             :subcat '()
                             :sem time}
                         :2 '()}}})
-      "dopodomani"
-      (unify sentential-adverb
-              {:synsem {:cat :sent-modifier
-                        :sem {:pred :dopodomani}
-                        :subcat {:1 {:infl :future
-                                     :sem {:tense :future}
-                                     :subcat '()}}}})
-      "dormire"
-      {:synsem {:cat :verb
-                :essere false
-                :sem {:subj {:animate true}
-                      :discrete false
-                      :pred :sleep}}}
-
-      "dovere" {:synsem {:cat :verb
-                         :sem {:pred :have-to}}
-                :italiano {:future-stem "dovr"
-                           :drop-e true
-                           :present {:1sing "devo"
-                                     :2sing "devi"
-                                     :3sing "deve"
-                                     :1plur "dobbiamo"
-                                     :2plur "dovete"
-                                     :3plur "devono"}}}
-
-      "entrare" {:synsem {:cat :verb
-                          :essere true
-                          :sem {:pred :enter}}}
-
-      "esistere" {:synsem {:cat :verb
-                           :essere true
-                           :sem {:pred :exist}}
-                  :italiano {:passato "esistito"}}
-
-      "esprimere" {:italiano {:passato "espresso"}
-                   :synsem {:cat :verb
-                            :sem {:pred :express}}}
-
-      "essere"
-      (let [essere-common
-            (let [infl (atom :top)
-                  agr (atom :top)]
-              {:synsem {:agr agr
-                        :cat :verb
+   "dopodomani"
+   (unify sentential-adverb
+          {:synsem {:cat :sent-modifier
+                    :sem {:pred :dopodomani}
+                    :subcat {:1 {:infl :future
+                                 :sem {:tense :future}
+                                 :subcat '()}}}})
+   "dormire"
+   {:synsem {:cat :verb
+             :essere false
+             :sem {:subj {:animate true}
+                   :discrete false
+                   :pred :sleep}}}
+
+   "dovere" {:synsem {:cat :verb
+                      :sem {:pred :have-to}}
+             :italiano {:future-stem "dovr"
+                        :drop-e true
+                        :present {:1sing "devo"
+                                  :2sing "devi"
+                                  :3sing "deve"
+                                  :1plur "dobbiamo"
+                                  :2plur "dovete"
+                                  :3plur "devono"}}}
+
+   "entrare" {:synsem {:cat :verb
+                       :essere true
+                       :sem {:pred :enter}}}
+
+   "esistere" {:synsem {:cat :verb
                         :essere true
-                        :infl infl
-                        :subcat {:1 {:agr agr}}}
-               :italiano {:agr agr
-                          :future-stem "sar"
-                          :infinitive "essere"
-                          :infl infl
-                          :present {:1sing "sono"
-                                    :2sing "sei"
-                                    :3sing "è"
-                                    :1plur "siamo"
-                                    :2plur "siete"
-                                    :3plur "sono"}
-                          :passato "stato"
-                          :imperfect {:1sing "ero"
-                                      :2sing "eri"
-                                      :3sing "era"
-                                      :1plur "eravamo"
-                                      :2plur "eravate"
-                                      :3plur "erano"}
-                          :future {:1sing "sarò"
-                                   :2sing "sarai"
-                                   :3sing "sarà"
-                                   :1plur "saremo"
-                                   :2plur "sarete"
-                                   :3plur "saranno"}
-
-                          :conditional {:1sing "sarei"
-                                        :2sing "saresti"
-                                        :3sing "sarebbe"
-                                        :1plur "saremmo"
-                                        :2plur "sareste"
-                                        :3plur "sarebbero"}}})]
-        [;; essere: adjective
-         ;; TODO: unify essere-adjective, essere-prepositional-phrase
-         ;; and essere-intensifier into one lexical entry.
-         (let [gender (atom :top)
-               number (atom :top)]
-           (unify
-            essere-common
-            {:notes "essere-adjective"
-             :synsem {:cat :verb
-                      :sem {:pred :be
-                            :subj :top
-                            :obj :top}
-                      :subcat {:1 {:cat :noun
-                                   :agr {:gender gender
-                                         :number number}}
-                               :2 {:cat :adjective
-                                   :sem {:comparative false}
-                                   :subcat {:1 :top
-                                            :2 '()}
-                                   :agr {:gender gender
-                                         :number number}}}}}))
-
-         ;; essere: prepositional phrase
-         (let [gender (atom :top)
-               number (atom :top)
-               obj (atom {:pred :top
-                          :place true})
-               pred (atom :top)]
-           (unify
-            essere-common
-            {:notes "essere-prepositional-phrase"
-             :synsem {:cat :verb
-                      :aux false
-                      :sem {:pred pred
-                            :obj obj}
-                      ;; TODO: should not need agreement: should be covered by
-                      ;; essere-common.
-                      :subcat {:1 {:cat :noun
-                                   :agr {:gender gender
-                                         :number number}}
-                               :2 {:cat :prep
-                                   :subcat '()
-                                   :sem {:pred pred
-                                         :obj obj}}
-                               :3 '()}}}))
+                        :sem {:pred :exist}}
+               :italiano {:passato "esistito"}}
+
+   "esprimere" {:italiano {:passato "espresso"}
+                :synsem {:cat :verb
+                         :sem {:pred :express}}}
+
+   "essere"
+   (let [essere-common
+         (let [infl (atom :top)
+               agr (atom :top)]
+           {:synsem {:agr agr
+                     :cat :verb
+                     :essere true
+                     :infl infl
+                     :subcat {:1 {:agr agr}}}
+            :italiano {:agr agr
+                       :future-stem "sar"
+                       :infinitive "essere"
+                       :infl infl
+                       :present {:1sing "sono"
+                                 :2sing "sei"
+                                 :3sing "è"
+                                 :1plur "siamo"
+                                 :2plur "siete"
+                                 :3plur "sono"}
+                       :passato "stato"
+                       :imperfect {:1sing "ero"
+                                   :2sing "eri"
+                                   :3sing "era"
+                                   :1plur "eravamo"
+                                   :2plur "eravate"
+                                   :3plur "erano"}
+                       :future {:1sing "sarò"
+                                :2sing "sarai"
+                                :3sing "sarà"
+                                :1plur "saremo"
+                                :2plur "sarete"
+                                :3plur "saranno"}
+
+                       :conditional {:1sing "sarei"
+                                     :2sing "saresti"
+                                     :3sing "sarebbe"
+                                     :1plur "saremmo"
+                                     :2plur "sareste"
+                                     :3plur "sarebbero"}}})]
+     [;; essere: adjective
+      ;; TODO: unify essere-adjective, essere-prepositional-phrase
+      ;; and essere-intensifier into one lexical entry.
+      (let [gender (atom :top)
+            number (atom :top)]
+        (unify
+         essere-common
+         {:notes "essere-adjective"
+          :synsem {:cat :verb
+                   :sem {:pred :be
+                         :subj :top
+                         :obj :top}
+                   :subcat {:1 {:cat :noun
+                                :agr {:gender gender
+                                      :number number}}
+                            :2 {:cat :adjective
+                                :sem {:comparative false}
+                                :subcat {:1 :top
+                                         :2 '()}
+                                :agr {:gender gender
+                                      :number number}}}}}))
+
+      ;; essere: prepositional phrase
+      (let [gender (atom :top)
+            number (atom :top)
+            obj (atom {:pred :top
+                       :place true})
+            pred (atom :top)]
+        (unify
+         essere-common
+         {:notes "essere-prepositional-phrase"
+          :synsem {:cat :verb
+                   :aux false
+                   :sem {:pred pred
+                         :obj obj}
+                   ;; TODO: should not need agreement: should be covered by
+                   ;; essere-common.
+                   :subcat {:1 {:cat :noun
+                                :agr {:gender gender
+                                      :number number}}
+                            :2 {:cat :prep
+                                :subcat '()
+                                :sem {:pred pred
+                                      :obj obj}}
+                            :3 '()}}}))

-         ;; TODO: do we need this? maybe remove?
-         (unify essere-common {:notes "be"
-                               :synsem {:sem {:pred :be}}})
-
-         ;; essere: copula ;; note that we don't enforce agreement the same here as we do in essere-adjective: TODO: try to make more consistent.
-         (let [gender (atom :top)
-               number (atom :top)
-               human (atom :top)]
-           (unify
-            transitive
-            essere-common
-            {:notes "copula" ;; significant only for debugging.
-             :synsem {:cat :verb
-                      :subcat {:1 {:cat :noun
-                                   :agr {:gender gender
-                                         :number number}}
-                               :2 {:cat :noun
-                                   :pronoun {:not true} ;; accusative pronouns cause unbounded depth-first searches on the subject side. (TODO: not sure if this problem is still present)
-                                   :def {:not :demonstrativo}
-                                   :agr {:gender gender
-                                         :number number}}}
-                      :sem {:pred :be
-                            :activity false
-                            :discrete false
-                            :subj {:human human}
-                            :obj {:human human}}}}))
-
-           ;; essere: intensifier
-           ;; this is for e.g "essere più alto di quelle donne belle (to be taller than those beautiful women)"
+      ;; TODO: do we need this? maybe remove?
+      (unify essere-common {:notes "be"
+                            :synsem {:sem {:pred :be}}})
+
+      ;; essere: copula ;; note that we don't enforce agreement the same here as we do in essere-adjective: TODO: try to make more consistent.
+      (let [gender (atom :top)
+            number (atom :top)
+            human (atom :top)]
+        (unify
+         transitive
+         essere-common
+         {:notes "copula" ;; significant only for debugging.
+          :synsem {:cat :verb
+                   :subcat {:1 {:cat :noun
+                                :agr {:gender gender
+                                      :number number}}
+                            :2 {:cat :noun
+                                :pronoun {:not true} ;; accusative pronouns cause unbounded depth-first searches on the subject side. (TODO: not sure if this problem is still present)
+                                :def {:not :demonstrativo}
+                                :agr {:gender gender
+                                      :number number}}}
+                   :sem {:pred :be
+                         :activity false
+                         :discrete false
+                         :subj {:human human}
+                         :obj {:human human}}}}))
+
+      ;; essere: intensifier
+      ;; this is for e.g "essere più alto di quelle donne belle (to be taller than those beautiful women)"
 ;           (let [gender (atom :top)
 ;                 number (atom :top)
 ;                 subject (atom {:agr {:gender gender
@@ -1159,60 +1155,60 @@
 ;                              :intensified true
 ;                              :obj comp-sem}}}))

-           (unify essere-common
-                   verb-aux
-                   verb-subjective
-                   {:notes "essere-aux"
-                    :italiano {:notes "essere-aux"}})])
+      (unify essere-common
+             verb-aux
+             verb-subjective
+             {:notes "essere-aux"
+              :italiano {:notes "essere-aux"}})])

-      "evitare"  {:synsem {:cat :verb
-                           :sem {:pred :avoid}}}
-      "fare"
-      (let [shared-part-of-fare
-            {:synsem {:cat :verb}
-             :italiano {:italiano "fare"
-                        :drop-e false
-                        :passato "fatto"
-                        :future-stem "far"
-                        :imperfect {:1sing "facevo"
-                                     :2sing "facevi"
-                                     :3sing "faceva"
-                                     :1plur "facevamo"
-                                     :2plur "facevate"
-                                     :3plur "facevano"}
-                        :present {:1sing "faccio"
-                                  :2sing "fai"
-                                  :3sing "fa"
-                                  :1plur "facciamo"
-                                  :2plur "fate"
-                                  :3plur "fanno"}}}]
-        [(merge shared-part-of-fare
-                {:synsem {:sem {:pred :do}}})
-         (merge shared-part-of-fare
-                {:synsem {:sem {:pred :make}}})
-         (merge shared-part-of-fare
-                (let [subject-semantics (atom {:human true})
-                      subject-agr (atom :top)]
-                  {:synsem {:cat :verb
-                            :essere true
-                            :sem {:pred :hurt-oneself
-                                  :reflexive true
-                                  :subj subject-semantics
-                                  :obj subject-semantics}
-                            :subcat {:1 {:agr subject-agr
-                                         :sem subject-semantics}
-                                     :2 {:agr subject-agr
-                                         :pronoun true
+   "evitare"  {:synsem {:cat :verb
+                        :sem {:pred :avoid}}}
+   "fare"
+   (let [shared-part-of-fare
+         {:synsem {:cat :verb}
+          :italiano {:italiano "fare"
+                     :drop-e false
+                     :passato "fatto"
+                     :future-stem "far"
+                     :imperfect {:1sing "facevo"
+                                 :2sing "facevi"
+                                 :3sing "faceva"
+                                 :1plur "facevamo"
+                                 :2plur "facevate"
+                                 :3plur "facevano"}
+                     :present {:1sing "faccio"
+                               :2sing "fai"
+                               :3sing "fa"
+                               :1plur "facciamo"
+                               :2plur "fate"
+                               :3plur "fanno"}}}]
+     [(merge shared-part-of-fare
+             {:synsem {:sem {:pred :do}}})
+      (merge shared-part-of-fare
+             {:synsem {:sem {:pred :make}}})
+      (merge shared-part-of-fare
+             (let [subject-semantics (atom {:human true})
+                   subject-agr (atom :top)]
+               {:synsem {:cat :verb
+                         :essere true
+                         :sem {:pred :hurt-oneself
+                               :reflexive true
+                               :subj subject-semantics
+                               :obj subject-semantics}
+                         :subcat {:1 {:agr subject-agr
+                                      :sem subject-semantics}
+                                  :2 {:agr subject-agr
+                                      :pronoun true
                                       :reflexive true
-                                         :sem subject-semantics}
-                                     :3 {:cat :adverb
-                                         :sem {:pred :bad}}}}}))])
+                                      :sem subject-semantics}
+                                  :3 {:cat :adverb
+                                      :sem {:pred :bad}}}}}))])

    "finire"  {:italiano {:boot-stem1 "finisc"
                          :boot-stem2 "fin"}
               :synsem {:cat :verb
                        :sem {:pred :finish}}}
-
+
    "formare"  {:synsem {:cat :verb
                         :sem {:pred :form}}}

@@ -1223,10 +1219,10 @@
 ;      "frequentare"  {:synsem {:cat :verb
 ;                               :sem {:pred :frequentare}}}

-      "funzionare" {:synsem {:cat :verb
-                             :essere false
-                             :sem {:pred :work-nonhuman
-                                   :subj {:human false}}}}
+   "funzionare" {:synsem {:cat :verb
+                          :essere false
+                          :sem {:pred :work-nonhuman
+                                :subj {:human false}}}}

    "gatto"
    {:synsem {:agr {:gender :masc}
@@ -1234,70 +1230,70 @@
              :sem {:pred :gatto
                    :pet true}}}

-      "gestire" {:italiano {:boot-stem1 "gestisc"
-                            :boot-stem2 "gest"}
-                 :synsem {:sem {:pred :manage}
-                          :cat :verb}}
-
-      "giocare"  {:synsem {:cat :verb
-                           :sem {;:obj {:games true}
+   "gestire" {:italiano {:boot-stem1 "gestisc"
+                         :boot-stem2 "gest"}
+              :synsem {:sem {:pred :manage}
+                       :cat :verb}}
+
+   "giocare"  {:synsem {:cat :verb
+                        :sem {;:obj {:games true}
+                              :subj {:human true}
+                              :pred :giocare}}
+               :italiano {:future-stem "giocher"}}
+
+   "Giovanni e io"
+   [{:synsem {:cat :noun
+              :pronoun true
+              :case :nom
+              :agr {:gender :masc
+                    :person :1st
+                    :number :plur}
+              :sem {:human true
+                    :pred :giovanni-and-i}
+              :subcat '()}}]
+
+   "gridare" {:synsem {:cat :verb
+                       :sem {:subj {:human true}
+                             :pred :yell}}}
+
+   "guadagnare"  {:synsem {:cat :verb
+                           :sem {:pred :earn
                                  :subj {:human true}
-                                 :pred :giocare}}
-                  :italiano {:future-stem "giocher"}}
-
-      "Giovanni e io"
-      [{:synsem {:cat :noun
-                 :pronoun true
-                 :case :nom
-                 :agr {:gender :masc
-                       :person :1st
-                       :number :plur}
-                 :sem {:human true
-                       :pred :giovanni-and-i}
-                 :subcat '()}}]
-
-      "gridare" {:synsem {:cat :verb
-                          :sem {:subj {:human true}
-                                :pred :yell}}}
-
-      "guadagnare"  {:synsem {:cat :verb
-                              :sem {:pred :earn
-                                    :subj {:human true}
-                                    :obj {:human false}}}}
-
-      "guidare"  {:synsem {:cat :verb
-                           :sem {:pred :guidare}}}
-      "i"
-      (unify determiner
-             {:synsem {:cat :det
-                       :def :def
-                       :agr {:gender :masc
-                             :number :plur}}})
-      "il"
-      (unify determiner
-              {:synsem {:cat :det
-                        :def :def
-                        :agr {:gender :masc
-                              :number :sing}}})
-
-      "imparare"  {:synsem {:cat :verb
-                            :sem {:pred :learn}}}
-
-      "impegnare" {:synsem {:cat :verb
-                            :sem {:pred :engage}}}
-
-      "incontrare"  {:synsem {:cat :verb
-                              :sem {:pred :incontrare}}}
-
-      "indossare"  {:synsem {:cat :verb
-                             :sem {:pred :wear}}}
-
-      "insegnare"  {:synsem {:cat :verb
-                             :sem {:pred :teach}}}
-
-      "interrompere" {:italiano {:passato "interrotto"}
-                      :synsem {:cat :verb
-                               :sem {:pred :interrupt}}}
+                                 :obj {:human false}}}}
+
+   "guidare"  {:synsem {:cat :verb
+                        :sem {:pred :guidare}}}
+   "i"
+   (unify determiner
+          {:synsem {:cat :det
+                    :def :def
+                    :agr {:gender :masc
+                          :number :plur}}})
+   "il"
+   (unify determiner
+          {:synsem {:cat :det
+                    :def :def
+                    :agr {:gender :masc
+                          :number :sing}}})
+
+   "imparare"  {:synsem {:cat :verb
+                         :sem {:pred :learn}}}
+
+   "impegnare" {:synsem {:cat :verb
+                         :sem {:pred :engage}}}
+
+   "incontrare"  {:synsem {:cat :verb
+                           :sem {:pred :incontrare}}}
+
+   "indossare"  {:synsem {:cat :verb
+                          :sem {:pred :wear}}}
+
+   "insegnare"  {:synsem {:cat :verb
+                          :sem {:pred :teach}}}
+
+   "interrompere" {:italiano {:passato "interrotto"}
+                   :synsem {:cat :verb
+                            :sem {:pred :interrupt}}}

 ;; commenting out until discussed with Franco
 ;;      "" ;; empty pronominal subject e.g. "mangio" = "io mangio".
@@ -1309,86 +1305,86 @@
 ;;                 :sem {:human true}
 ;;                 :subcat '()}}]

-      "io"
-      [{:synsem {:cat :noun
-                 :pronoun true
-                 :case :nom
-                 :agr {:gender :fem
-                       :person :1st
-                       :number :sing}
-                 :sem {:pred :I
-                       :human true}
-                 :subcat '()}}
-
-       {:synsem {:cat :noun
-                 :pronoun true
-                 :case :nom
-                 :agr {:gender :masc
-                       :person :1st
-                       :number :sing}
-                 :sem {:pred :I
-                       :human true}
-                 :subcat '()}}]
-      "la"
+   "io"
+   [{:synsem {:cat :noun
+              :pronoun true
+              :case :nom
+              :agr {:gender :fem
+                    :person :1st
+                    :number :sing}
+              :sem {:pred :I
+                    :human true}
+              :subcat '()}}
+
+    {:synsem {:cat :noun
+              :pronoun true
+              :case :nom
+              :agr {:gender :masc
+                    :person :1st
+                    :number :sing}
+              :sem {:pred :I
+                    :human true}
+              :subcat '()}}]
+   "la"
    ;; as with "lo", do we need both of these "lo" entries? try to get by with just one.
    ;; TODO: refactor commonalities
-      ;; 1. pronoun: human
-      [{:synsem {:cat :noun
-                 :pronoun true
-                 :case pronoun-acc
-                 :reflexive false
-                 :agr {:gender :fem
-                       :person :3rd
-                       :number :sing}
-                 :sem {:human true
-                       :pred :lei}
-                 :subcat '()}
-        :italiano {:initial true   ;; TODO: verify that 'la' above and this below are being unified correctly.
-                   :cat :noun
-                   :case pronoun-acc}}
-
-       ;; 2. pronoun: non-human
-       {:synsem {:cat :noun
-                 :pronoun true
-                 :case pronoun-acc
-                 :reflexive false
-                 :agr {:gender :fem
-                       :person :3rd
-                       :number :sing}
-                 :sem {:human false
-                       :place false ;; "they go to it (loro vanna a la)" sounds strange
-                       :pred :lei}
-                 :subcat '()}
-        :italiano {:initial true
-                   :cat :noun
-                   :case pronoun-acc}}
-
-       ;; 3. article
-       {:synsem {:cat :det
-                 :def :def
-                 :agr {:gender :fem
-                       :number :sing}}}]
-      "la loro"
-      {:synsem {:cat :det
-                :def :possessive
-                :agr {:gender :fem
-                      :number :sing}
-                :sem {:number :plur
-                      :person :3rd}}}
-      "la mia"
-      {:synsem {:cat :det
-                :def :possessive
-                :agr {:gender :fem
-                      :number :sing}
-                :sem {:number :sing
-                      :person :1st}}}
-      "la nostra"
-      {:synsem {:cat :det
-                :def :possessive
-                :agr {:gender :fem
-                      :number :sing}
-                :sem {:number :plur
-                      :person :1st}}}
+   ;; 1. pronoun: human
+   [{:synsem {:cat :noun
+              :pronoun true
+              :case pronoun-acc
+              :reflexive false
+              :agr {:gender :fem
+                    :person :3rd
+                    :number :sing}
+              :sem {:human true
+                    :pred :lei}
+              :subcat '()}
+     :italiano {:initial true   ;; TODO: verify that 'la' above and this below are being unified correctly.
+                :cat :noun
+                :case pronoun-acc}}
+
+    ;; 2. pronoun: non-human
+    {:synsem {:cat :noun
+              :pronoun true
+              :case pronoun-acc
+              :reflexive false
+              :agr {:gender :fem
+                    :person :3rd
+                    :number :sing}
+              :sem {:human false
+                    :place false ;; "they go to it (loro vanna a la)" sounds strange
+                    :pred :lei}
+              :subcat '()}
+     :italiano {:initial true
+                :cat :noun
+                :case pronoun-acc}}
+
+    ;; 3. article
+    {:synsem {:cat :det
+              :def :def
+              :agr {:gender :fem
+                    :number :sing}}}]
+   "la loro"
+   {:synsem {:cat :det
+             :def :possessive
+             :agr {:gender :fem
+                   :number :sing}
+             :sem {:number :plur
+                   :person :3rd}}}
+   "la mia"
+   {:synsem {:cat :det
+             :def :possessive
+             :agr {:gender :fem
+                   :number :sing}
+             :sem {:number :sing
+                   :person :1st}}}
+   "la nostra"
+   {:synsem {:cat :det
+             :def :possessive
+             :agr {:gender :fem
+                   :number :sing}
+             :sem {:number :plur
+                   :person :1st}}}

    ;; TODO for below: add pronominal "la sua" (translated in English as "his" and "hers", depending on gender of the owner of the referent).
    ;; e.g. "I gatti sono i suoi. (The cats are hers) (if talking about a female owner) or (The cats are his) (if talking about a male owner).
@@ -1615,26 +1611,26 @@
                :sem {:human true}
                :subcat '()}}

-    "migliorare" {:synsem {:cat :verb
-                           :sem {:pred :improve}}} ;; c.f. english: "ameliorate"
+   "migliorare" {:synsem {:cat :verb
+                          :sem {:pred :improve}}} ;; c.f. english: "ameliorate"

-    "misurare" {:synsem {:cat :verb
-                         :sem {:pred :measure}}}
-
-    "mostrare" {:synsem {:cat :verb
-                         :sem {:pred :show}}}
+   "misurare" {:synsem {:cat :verb
+                        :sem {:pred :measure}}}
+
+   "mostrare" {:synsem {:cat :verb
+                        :sem {:pred :show}}}
+
+   "moltiplicare" {:synsem {:cat :verb
+                            :sem {:pred :multiply}}}

-    "moltiplicare" {:synsem {:cat :verb
-                             :sem {:pred :multiply}}}
-
-    "muovere" {:synsem {:cat :verb
-                        :sem {:pred :move}}}
+   "muovere" {:synsem {:cat :verb
+                       :sem {:pred :move}}}

    "nascere" {:synsem {:cat :verb
-                      :essere true
-                      :sem {:pred :be-born}}
-             :italiano {:passato "nato"}}
-
+                       :essere true
+                       :sem {:pred :be-born}}
+              :italiano {:passato "nato"}}
+
    "neonato"
    {:synsem {:agr {:gender :masc}
              :cat :noun
@@ -1654,27 +1650,27 @@

    "noi"
    [{:synsem {:cat :noun
-             :pronoun true
-             :case :nom
-             :agr {:gender :fem
-                   :person :1st
-                   :number :plur}
+              :pronoun true
+              :case :nom
+              :agr {:gender :fem
+                    :person :1st
+                    :number :plur}
               :sem {:pred :noi
                     :human true}
-             :subcat '()}}
+              :subcat '()}}
     {:synsem {:cat :noun
               :pronoun true
               :case :nom
-             :agr {:gender :masc
-                   :person :1st
-                   :number :plur}
+              :agr {:gender :masc
+                    :person :1st
+                    :number :plur}
               :sem {:pred :noi
                     :human true}
               :subcat '()}}]

    "osservare" {:synsem {:cat :verb
                          :sem {:pred :observe}}}
-
+
    "ostana" {:synsem {:cat :noun
                       :propernoun true
                       :sem {:pred :ostana
@@ -1682,12 +1678,12 @@

    "ottenere" {:synsem {:cat :verb
                         :sem {:pred :obtain}}
-              :italiano {:passato "ottenuto"
-                         :present {:1sing "ottengo"
-                                   :2sing "ottieni"
-                                   :3sing "ottiene"
-                                   :3plur "ottengono"}
-                         :future-stem "otterr"}}
+               :italiano {:passato "ottenuto"
+                          :present {:1sing "ottengo"
+                                    :2sing "ottieni"
+                                    :3sing "ottiene"
+                                    :3plur "ottengono"}
+                          :future-stem "otterr"}}
    "pane"
    ;; inherently singular.
    {:synsem {:agr {:gender :masc}
@@ -1711,26 +1707,26 @@
       (unify common1 transitive
              {:synsem {:sem {:obj {:speakable true}}}})
       (unify common1 intransitive intransitive-unspecified-obj)
-
+
       (unify common2 intransitive intransitive-unspecified-obj)))
-
-    "partire" {:synsem {:essere true
-                        :cat :verb
-                        :sem {:pred :leave}}}
-    "pensare"
-    {:synsem {:cat :verb
-              :essere false
-              :sem {:pred :think
-                    :activity false
-                    :discrete false
-                    :subj {:human true}}}}
+
+   "partire" {:synsem {:essere true
+                       :cat :verb
+                       :sem {:pred :leave}}}
+   "pensare"
+   {:synsem {:cat :verb
+             :essere false
+             :sem {:pred :think
+                   :activity false
+                   :discrete false
+                   :subj {:human true}}}}

    "piangere" {:italiano {:passato "pianto"}
-            :synsem {:cat :verb
-                     :sem {:pred :cry}}}
+               :synsem {:cat :verb
+                        :sem {:pred :cry}}}

    "piegare" {:synsem {:cat :verb
-                      :sem {:pred :fold}}}
+                       :sem {:pred :fold}}}

    "portare"  [{:synsem {:cat :verb
                          :sem {:pred :carry}}}
@@ -2002,8 +1998,8 @@
                :cat :noun
                :case pronoun-acc}}
    "tirare"
-             {:synsem {:cat :verb
-                      :sem {:pred :throw}}}
+   {:synsem {:cat :verb
+             :sem {:pred :throw}}}

    "tornare"
    {:synsem {:cat :verb
@@ -2035,6 +2031,7 @@
               :sem {:pred :tu
                     :human true}
               :subcat '()}}]
+
    "un" [{:synsem {:cat :det
                    :def :indef
                    :mass false
@@ -2128,13 +2125,12 @@
                         :sem {:pred :win
                               :subj {:human true}
                               :obj {:human false}}}}
-   "vino"
-   (unify drinkable-noun
-          agreement-noun
-          masculine-noun
-          {:synsem {:sem {:pred :vino
-                          :artifact true}}})
-
+   "vino" {:synsem {:agr {:gender :masc}
+                    :cat :noun
+                    :pred :vino
+                    :sem {:artifact true
+                          :drinkable true
+                          :pred :vino}}}
    "vivere"
    ;; FIXME: this is simply a duplicate apparently?
    [{:synsem {:cat :verb


+"first" as adjective

+"first" as adjective

--- src/babel/english/lexicon.cljc
+++ src/babel/english/lexicon.cljc
@@ -558,6 +558,10 @@

    "finish" {:synsem {:cat :verb
                       :sem {:pred :finish}}}
+
+   "first" (unify adjective
+                  {:sem {:mod {:pred :first}
+                         :comparative false}})

    "fold" {:synsem {:cat :verb
                     :sem {:pred :fold}}}


call (fo 'expression') rather than (fo (get-in tree [:italiano]))

--- src/babel/italiano/grammar.clj
+++ src/babel/italiano/grammar.clj
@@ -387,11 +387,11 @@
        (filter #(not (fail? %))
                grammar)))

-;; TODO: move to italiano/morphology
+;; TODO: move to italiano/morphology or higher (language-universal)
 (defn morph-walk-tree [tree]
   (log/debug (str "morph-walk-tree: " (fo tree)))
   (merge
-   {:surface (fo (get-in tree [:italiano]))}
+   {:surface (fo tree)}
    (if (get-in tree [:comp])
      {:comp (morph-walk-tree (get-in tree [:comp]))}
      {})


Remove unused local

Remove unused local

--- src/cljs/cglossa/search_views/cwb/shared.cljs
+++ src/cljs/cglossa/search_views/cwb/shared.cljs
@@ -30,8 +30,7 @@
                               (update query :query
                                       str/replace #"\bphon=\"([^0-9\"]+)\"" "phon=\"$1[1-4]?\""))
                             ;; For other languages, leave the queries unmodified
-                            queries)
-            search-engine (:search-engine corpus "cwb")]
+                            queries)]
         (go (let [{:keys [status success] :as response}
                   (<! (http/post "/search"
                                  {:json-params {:corpus-id (:rid @corpus)


simplify channel piping

simplify channel piping

--- src/cljs/clj_money/api/transaction_items.cljs
+++ src/cljs/clj_money/api/transaction_items.cljs
@@ -1,6 +1,6 @@
 (ns clj-money.api.transaction-items
   (:refer-clojure :exclude [update])
-  (:require [cljs.core.async :refer [chan pipeline]]
+  (:require [cljs.core.async :refer [chan pipe]]
             [clj-money.api :as api]
             [clj-money.util :refer [parse-date]]))

@@ -23,14 +23,11 @@

 (defn search-a
   [criteria options result-chan error-chan]
-  (let [c (chan)]
+  (let [c (chan 100 (map after-read))]
     (api/get-resources-a (api/path :transaction-items)
                          criteria
                          options
                          c
                          error-chan)
     ; TODO move pipeline logic to api/get-resources-a so we can simply pass in a transducer
-    (pipeline 1
-              result-chan
-              (map after-read)
-              c)))
+    (pipe c result-chan)))


WIP: make sidebar groups draggable

WIP: make sidebar groups draggable

currently can't click into a group though and some issues with order of
dragging

--- src/braid/ui/views/sidebar.cljs
+++ src/braid/ui/views/sidebar.cljs
@@ -1,13 +1,54 @@
 (ns braid.ui.views.sidebar
   (:require [clojure.string :as string]
             [reagent.core :as r]
-            [chat.client.views.helpers :refer [id->color location]]
+            [reagent.ratom :include-macros true :refer-macros [reaction]]
+            [chat.client.dispatcher :refer [dispatch!]]
+            [chat.client.views.helpers :refer [id->color location element-offset
+                                               get-style]]
             [chat.client.routes :as routes]
             [chat.client.reagent-adapter :refer [subscribe]]
-            [braid.ui.styles.sidebar :as side-style]
+            [braid.ui.styles.vars :as style-vars]
             [goog.events :as events]
             [goog.style :as gstyle])
   (:import [goog.events EventType]))
+
+(def v- (partial mapv -))
+
+(def v+ (partial mapv +))
+
+(defn px->n [px]
+  (-> (string/replace px #"px$" "")
+      (js/parseInt 10)))
+
+(defn css->str
+  [css-unit]
+  (str (:magnitude css-unit) (name (:unit css-unit))))
+
+(defn index-of
+  [col e]
+  (some (fn [[idx e']] (when (= e' e) idx)) (map-indexed vector col)))
+
+(defn clamp
+  [bot x top]
+  {:pre [(< bot top)]}
+  (max bot (min x top)))
+
+(defn move-idx
+  [v old-i new-i]
+  {:post [(= (count %) (count v))]}
+  (let [[old-i new-i] (map #(clamp 0 % (dec (count v))) [old-i new-i])]
+    (if (= old-i new-i)
+      v
+      (let [em (nth v old-i)]
+        (reduce (fn [v' [idx e]]
+                  (cond
+                    (= idx old-i) v'
+                    (= idx new-i) (if (< old-i new-i)
+                                    (conj v' e em)
+                                    (conj v' em e))
+                    :else (conj v' e)))
+                []
+                (map-indexed vector v))))))

 (defn badge-view [group-id]
   (let [cnt (subscribe [:group-unread-count group-id])]
@@ -20,55 +61,110 @@
   (let [groups (subscribe [:groups])
         active-group (subscribe [:active-group])
         group-order (subscribe [:user-preference :groups-order])
-        dragging-elt (r/atom nil)
-        listeners (r/atom nil)
-        drag-start (r/atom nil)
-        drag-move (fn [elt e])
-        drag-end (fn [elt e]
-                   (reset! dragging-elt nil)
-                   (let [[up move] @listeners]
+        ordered-groups (reaction (if (nil? @group-order)
+                                   @groups
+                                   (let [ordered? (comp boolean (set @group-order) :id)
+                                         {ord true unord false} (group-by ordered? @groups)
+                                         by-id (group-by :id @groups)]
+                                     (concat
+                                       (map (comp first by-id) @group-order)
+                                       unord))))
+        move-group-by (fn [group by]
+                        (let [current-groups (mapv :id @ordered-groups)
+                              old-idx (index-of current-groups (group :id))
+                              new-idx (+ old-idx by)
+                              new-groups (move-idx current-groups old-idx new-idx)]
+                          (println current-groups)
+                          (println new-groups)
+                          (dispatch! :set-preference [:groups-order new-groups])))
+        drag-state (r/atom {:grp nil
+                            :elt-height 0
+                            :listeners nil
+                            :start nil
+                            :location nil
+                            :offset nil})
+        drag-move (fn [grp evt]
+                    (.preventDefault evt)
+                    (when (= grp (@drag-state :grp))
+                      (swap! drag-state assoc
+                             :location (v+ (location evt)
+                                           (:offset @drag-state)))))
+        drag-end (fn [grp evt]
+                   (when-let [[up move] (@drag-state :listeners)]
                      (doto js/window
-                       (events/listen EventType.MOUSEUP up)
-                       (events/listen EventType.MOUSEMOVE move))))
-        drag-start (fn [elt e]
-                     (reset! dragging-elt elt)
-                     (reset! drag-start (location (.-target e)))
-                     (let [up (partial drag-end elt)
-                           move (partial drag-move elt)]
-                       (reset! listeners [up move])
+                       (events/unlisten EventType.MOUSEUP up)
+                       (events/unlisten EventType.MOUSEMOVE move)))
+                   (let [moved (-> (v- (@drag-state :location)
+                                       (@drag-state :start))
+                                   second
+                                   (/ (@drag-state :elt-height))
+                                   js/Math.round)]
+                     (move-group-by grp moved))
+                   (swap! drag-state assoc
+                          :grp nil
+                          :listeners nil))
+        drag-start (fn [grp evt]
+                     (let [loc (location evt)
+                           elt (loop [elt (.-target evt)]
+                                 (if (= "A" (.-tagName elt))
+                                   elt
+                                   (recur (.-parentElement elt))))
+                           offset (element-offset elt)
+                           elt-height (+ (.-clientHeight elt)
+                                         (-> elt
+                                             (get-style "margin-bottom")
+                                             px->n))
+                           up (partial drag-end grp)
+                           move (partial drag-move grp)]
+                       (swap! drag-state assoc
+                              :grp grp
+                              :start loc
+                              :elt-height elt-height
+                              :location offset
+                              :offset (v- offset loc)
+                              :listeners [up move])
                        (doto js/window
                          (events/listen EventType.MOUSEUP up)
                          (events/listen EventType.MOUSEMOVE move))))]
     (fn []
       [:div.groups
-       (let [ordered-groups (if (nil? @group-order)
-                              @groups
-                              (let [ordered? (comp (set @group-order) :id)
-                                    {ord true unord false} (group-by ordered? @groups)
-                                    by-id (group-by :id @groups)]
-                                (concat
-                                  (map by-id @group-order)
-                                  unord)))]
-         (doall
-           (for [group ordered-groups]
-             ^{:key (group :id)}
-             [:a.group.option
-              {:class (when (= (:id @active-group) (:id group)) "active")
-               :style (merge
-                        {:background-color (id->color (group :id))}
-                        (when-let [avatar (group :avatar)]
-                          {:background-image (str "url(" avatar ")")
-                           :background-position "center"
-                           :background-size "100%"}))
-               :title (group :name)
-               :href (routes/page-path {:group-id (group :id)
-                                        :page-id "inbox"})
-               :on-mouse-down (partial drag-start group)
-               :on-mouse-up (partial drag-end group)
-               :on-mouse-move (partial drag-move group)}
-              (when-not (group :avatar)
-                (string/join "" (take 2 (group :name))))
-              [badge-view (group :id)]])))])))
+       (doall
+         (for [group @ordered-groups]
+           ^{:key (group :id)}
+           [:a.group.option
+            {:class (when (= (:id @active-group) (:id group)) "active")
+             :style (merge
+                      {:background-color (id->color (group :id))}
+                      (when-let [avatar (group :avatar)]
+                        {:background-image (str "url(" avatar ")")
+                         :background-position "center"
+                         :background-size "100%"})
+                      (when (= group (@drag-state :grp))
+                        {:opacity 0.2}))
+             :title (group :name)
+             :href (routes/page-path {:group-id (group :id)
+                                      :page-id "inbox"})
+             :on-mouse-down (partial drag-start group)
+             :on-mouse-up (partial drag-end group)
+             :on-mouse-move (partial drag-move group)}
+            (when-not (group :avatar)
+              (string/join "" (take 2 (group :name))))
+            [badge-view (group :id)]]))
+       (when-let [drag-grp (@drag-state :grp)]
+         [:a.group.option
+          {:style (merge {:background-color (id->color (drag-grp :id))
+                          :position "absolute"
+                          :left (css->str style-vars/pad)
+                          :top (second (@drag-state :location))
+                          :z-index 1000
+                          :width (css->str style-vars/top-bar-height)
+                          :height (css->str style-vars/top-bar-height)}
+                         (when-let [avatar (drag-grp :avatar)]
+                           {:background-image (str "url(" avatar ")")
+                            :background-position "center"
+                            :background-size "100%"}))}
+          (when-not (drag-grp :avatar)
+            (string/join "" (take 2 (drag-grp :name))))])])))

 (defn new-group-view []
  (let [page (subscribe [:page])]


Rewrite model.recaptcha.

Rewrite model.recaptcha.

--- src/cadence/model/recaptcha.clj
+++ src/cadence/model/recaptcha.clj
@@ -1,13 +1,11 @@
 (ns cadence.model.recaptcha
-  (:require [cadence.config :as config])
-  (:use [noir.request :only [ring-request]])
+  (:require [cadence.config :as config]
+            [noir.request :refer [*request*]])
   (:import (net.tanesha.recaptcha ReCaptcha ReCaptchaFactory)))

-
 (def ^:dynamic *recaptcha*
-  (let [rconf (:recaptcha config/tokens)
-        recap (ReCaptchaFactory/newSecureReCaptcha
-                (:public-key rconf) (:private-key rconf) true)]
+  (let [{:keys [public-key private-key]} (:recaptcha config/tokens)
+        recap (ReCaptchaFactory/newSecureReCaptcha public-key private-key true)]
     (.setRecaptchaServer recap "https://www.google.com/recaptcha/api")
     recap))

@@ -18,23 +16,19 @@

 (defn check
   "Checks whether the recaptcha response is correct or not."
-  ([^ReCaptcha recap
-    ^String challenge
-    ^String response]
-   (let [req (ring-request)]
-     (try (->
-            (.checkAnswer recap
-                          (get req :remote-addr)
-                          challenge response)
-            (.isValid))
-       (catch NullPointerException e
-         ;; TODO Replace with logging
-         (println "Issue with recaptcha answer checking: " (.getMessage e))
-         (println "\tChallenge,Response: " (str challenge "," response))
-         ;; Return false since we were not able to check.
-         false))))
-  ([^String challenge
-    ^String response] (check *recaptcha* challenge response)))
+  ([^ReCaptcha recap ^String challenge ^String response]
+   (try
+     (do (println *request*))
+     (-> recap
+       (.checkAnswer (:remote-addr *request*) challenge response)
+       (.isValid))
+     (catch NullPointerException e
+       ;; TODO Replace with logging
+       (println "Issue with recaptcha answer checking: " (.getMessage e))
+       (println "\tChallenge,Response: " (str challenge ", " response))
+       ;; Return false since we were not able to check.
+       false)))
+  ([^String challenge ^String response] (check *recaptcha* challenge response)))

 (defmacro with-recaptcha
   "Macro to rebind the default recaptcha with the given one."


Delay System/exit on shutdown for a 1/4 sec

--- src/cider_ci/utils/routing.clj
+++ src/cider_ci/utils/routing.clj
@@ -29,7 +29,8 @@

 (defn shutdown [request]
   (if (-> request :authenticated-service :username boolean)
-    (do (future (System/exit 0))
+    (do (future (Thread/sleep 250)
+                (System/exit 0))
       {:status 204 })
     {:status 403 :body ""}))


Implement Crisium Grid.

Implement Crisium Grid.

--- src/clj/game/cards-upgrades.clj
+++ src/clj/game/cards-upgrades.clj
@@ -53,6 +53,14 @@
                                                     {:req (req (= (:cid target) (:cid (:troubleshooter-target card))))
                                                      :effect (effect (ice-strength-bonus (:troubleshooter-amount card)))}
                                   :runner-turn-ends ct :corp-turn-ends ct}) card))}}
+
+   "Crisium Grid"
+   {:suppress {:successful-run {:req (req (and this-server (not= (:cid target) (:cid card))))}
+               :unsuccessful-run {:req (req (and this-server (not= (:cid target) (:cid card))))}}
+    :events {:successful-run {:req (req this-server)
+                              :effect (req (swap! state update-in [:run :run-effect] dissoc :replace-access)
+                                           (swap! state update-in [:run] dissoc :successful)
+                                           (swap! state update-in [:runner :register :successful-run] #(butlast %)))}}}

    "Cyberdex Virus Suite"
    {:access {:optional {:prompt "Purge viruses with Cyberdex Virus Suite?"


new routes

new routes

--- src/clj/salava/badge/routes.clj
+++ src/clj/salava/badge/routes.clj
@@ -332,8 +332,17 @@
                    :summary "Update endorsement status"
                    :auth-rules access/authenticated
                    :current-user current-user
-                   (ok (e/update-status! ctx (:id current-user) user_badge_id endorsement-id status))
-                   )
+                   (ok (e/update-status! ctx (:id current-user) user_badge_id endorsement-id status)))
+
+             (POST "endorsement/edit/:endorsement-id" []
+                   :return {:status (s/enum "success" "error")}
+                   :path-params [endorsement-id :- Long]
+                   :body-params [content :- s/Str
+                                 user_badge_id :- s/Str]
+                   :summary "Edit endorsement"
+                   :auth-rules access/authenticated
+                   :current-user current-user
+                   (ok (e/edit! ctx user_badge_id endorsement-id content (:id current-user))))

              (GET "/user/pending_endorsement" []
                   :auth-rules access/authenticated
@@ -341,4 +350,11 @@
                   :current-user current-user
                   (ok (e/received-pending-endorsements ctx (:id current-user)))
                   )
+
+             (GET "/user/endorsements" []
+                  :auth-rules access/authenticated
+                  :summary "Get all user's endorsements"
+                  :current-user current-user
+                  (ok (e/all-user-endorsements ctx (:id current-user)))
+                  )
              )))


verify badge logic

verify badge logic

--- src/clj/salava/badge/verify.clj
+++ src/clj/salava/badge/verify.clj
@@ -1,37 +1,68 @@
 (ns salava.badge.verify
   (:require [salava.badge.main :as b]
             [salava.core.http :as http]
-            [salava.core.time :refer [iso8601-to-unix-time unix-time]]))
+            [salava.core.time :refer [iso8601-to-unix-time unix-time]]
+            [clojure.tools.logging :as log]
+            #_[clj-http.client :as client]))
+
+(defn url? [s]
+  (not (clojure.string/blank? (re-find #"^http" (str s)))))

 (defn fetch-json-data [url]
-  #_(log/info "fetch-json-data: GET" url)
-  (http/http-get url {:as :json :accept :json :throw-entire-message? true}))
+  (log/info "fetch-badge-data: GET" url)
+  (http/http-get url {:as :json :accept :json :throw-entire-message? false}))
+
+(defn fetch-image [url]
+  (log/info "fetch image from " url)
+  (try
+    (http/http-req {:url url :method :get :throw-exceptions false :as :byte-array})
+    (catch Exception e
+      (log/error "failed to get image from " url " Message: " (.getMessage e))
+      {:status 500})))
+
+(defn fetch-url [url]
+  (log/info "fetch response from " url)
+  (try
+    (http/http-req {:url url :method :get :throw-exceptions false})
+    (catch Exception e
+      (log/error "failed to get response from " url " Message: " (.getMessage e))
+      {:status 500})))
+

 (defn- assertion [assertion-url]
-  (http/http-req {:socket-timeout 10000
-                  :conn-timeout   10000
-                  :method :get
-                  :url assertion-url
-                  :throw-exceptions false
-                  :as :json
-                  :accept :json}))
+  (try
+    (http/http-req  {:url assertion-url :as :json :method :get  :accept :json :throw-exceptions false })
+    (catch Exception e
+      (log/error "failed to get assertion url " assertion-url " Message: "(.getMessage e) )
+      {:status 500})))

-(defn verify-badge [ctx badge-id user-id]
-  (let [badge (b/get-badge ctx badge-id user-id)
-        assertion-url (:assertion_url badge)
-        asr-response (assertion assertion-url)
-        asr-data (:body asr-response)
-        assertion-badge-url (:badge asr-data)
-        badge-data (http/http-get assertion-badge-url {:as :json :accept :json :throw-entire-message? true})
-        ;criteria (if (map? (:criteria badge-data)) (fetch-json-data (get-in badge-data [:criteria :id])) (fetch-json-data (:criteria badge-data)))
-        revoked? (or (= (:status asr-response) 410) (:revoked asr-data))
-        expired? (and (:expires asr-data) (< (iso8601-to-unix-time (:expires asr-data)) (unix-time)))]
-   (prn (:criteria badge-data))
-  {:revoked revoked?
-   :expired expired?
-   :badge {
-            }
-   }
+(defn verify-badge [ctx asr user-id]
+  (log/info "Badge verification initiated:")
+  (let [asr-response (assertion asr)
+        result {}]
+    (case (:status asr-response)
+      410 (assoc result
+            :assertion-status 410
+            :revoked? true)
+      500 (assoc result :assertion-status 500
+            :badge-status "Broken url, badge can't be verified")
+      200 (let [asr-data (:body asr-response)
+                badge-data (fetch-json-data (:badge asr-data))
+                badge-image (if (map? (:image badge-data)) (fetch-image (get-in badge-data [:image :id])) (fetch-image (:image badge-data)))
+                badge-criteria (if (and (map? (:criteria badge-data))(contains? (:criteria badge-data) :id))
+                                 (fetch-url (get-in badge-data [:criteria :id]))
+                                 (if (url? (:criteria badge-data)) (fetch-url (:criteria badge-data)) {:status 800}))
+                badge-issuer (if (and (map? (:issuer badge-data)) (contains? (:issuer badge-data) :id))
+                               (fetch-url (get-in badge-data [:issuer :id]))
+                               (if (url? (:issuer badge-data)) (fetch-url (:issuer badge-data)) {:status 800}))
+                revoked? (or (= (:status asr-response) 410) (:revoked asr-data))
+                expired? (and (:expires asr-data) (< (iso8601-to-unix-time (:expires asr-data)) (unix-time)))]

-    )
-)
+            (assoc result :assertion-status 200
+              :assertion asr-data
+              :badge-image-status (:status badge-image)
+              :badge-criteria-status (:status badge-criteria)
+              :badge-issuer-status (:status badge-issuer)
+              :revoked? revoked?
+              :expired? expired?
+              )))))


Fix warnings from not-found route

Fix warnings from not-found route

--- src/clj/salava/core/handler.clj
+++ src/clj/salava/core/handler.clj
@@ -90,5 +90,5 @@

         (legacy-routes ctx)

-        (route/not-found "404 Not found")))))
+        (ANY "*" [] (route/not-found "404 Not found"))))))


Implementation of alternative slurp- implementation

--- src/clj_fileutils/fileutils.clj
+++ src/clj_fileutils/fileutils.clj
@@ -12,3 +12,22 @@

 (ns clj-fileutils.fileutils)

+(defn print-slurp-exception
+    "Print warning message to the standard output."
+    ([filename]
+        (println "Warning: cannot read content of the following file: " filename))
+    ([directory filename]
+        (println "Warning: cannot read content of the following file: " directory "/" filename)))
+
+(defn slurp-
+    "Alternative (slurp) implementation that does not throw an exception, but returns nil instead."
+    ([filename]
+        (try
+            (slurp filename)
+            (catch Exception e (print-slurp-exception filename))))
+    ([directory filename]
+        (try
+            (slurp (str directory "/" filename))
+            (catch Exception e (print-slurp-exception directory filename)))))
+
+


Remove old Om code

Remove old Om code

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -26,20 +26,6 @@
            ;; the client to focus on
            :build-id "dev"})

-;; (om/root
-;;  (fn [data owner]
-;;    (om/component
-;;     (dom/div nil
-;;              (dom/h1 nil (:heading data))
-;;              (when (:sites data)
-;;                (apply dom/ul nil
-;;                       (map (fn [{:keys [name url]}]
-;;                              (dom/li nil
-;;                                      (dom/a nil name)))
-;;                            (:sites data)))))))
-;;  app-state
-;;  {:target (. js/document (getElementById "main-area"))})
-
 (defonce app-state (atom {:heading "Comic Sites"}))

 (defn manga-site [site-data]


Put the loading image at bottom of comic images

--- src/cljs/comic_reader/main.cljs
+++ src/cljs/comic_reader/main.cljs
@@ -178,12 +178,12 @@
            [:h1 (titlize (:comic location)
                          :to-spaces #"(_|-)")]
            [:br]
-           (if comic-imgs
+           (when comic-imgs
              (map #(conj ^{:key (select-keys % [:chapter :page])}
                          [img-component site location]
                          %)
-                  comic-imgs)
-             [:img {:src "/img/loading.svg"}])])))))
+                  comic-imgs))
+           [:img {:src "/img/loading.svg"}]])))))

 (defn comic-reader []
   (let [page (rf/subscribe [:page])]


Research Grants - copy update

Research Grants - copy update

--- src/clj/game/cards-agendas.clj
+++ src/clj/game/cards-agendas.clj
@@ -305,7 +305,7 @@

    "Research Grant"
    {:req (req (not (empty? (filter #(= (:title %) "Research Grant") (all-installed state :corp)))))
-    :prompt "Choose to score another installed copy of Research Grant2 (optional)"
+    :prompt "Choose to score another installed copy of Research Grant (optional)"
     :choices {:req #(= (:title %) "Research Grant")}
     :effect (effect (score (assoc target :advance-counter (:advancementcost target))))
     :msg (msg "score another copy of Research Grant")


Fix per https://github.com/MastodonC/kixi.hecuba/pull/638#discussion_r39149819

--- src/cljs/kixi/hecuba/model.cljs
+++ src/cljs/kixi/hecuba/model.cljs
@@ -94,7 +94,6 @@
                             :heatmap-controls {:lcb    {:default 10}
                                                :ucb    {:default 30}
                                                :grads  {:default 20}}}
-                 :xyplot {}
                  :profiles {:alert {}}
                  :downloads {:files []}
                  :uploads {:files []


reduce cache refreshes in get-token->index function (#1306)

--- waiter/src/waiter/token.clj
+++ waiter/src/waiter/token.clj
@@ -276,17 +276,17 @@
     "Return a map of ALL token to token index entry. The token index entries also include the owner and token.
      Specifying :refresh true will refresh all owner/token indexes and get the most up to date map."
     [kv-store & {:keys [refresh] :or {refresh false}}]
-    (->> kv-store
-         list-token-owners
-         (reduce
-           (fn [outer-token->index owner]
-             (reduce
-               (fn [inner-token->index [token entry]]
-                 (->> (assoc entry :owner owner :token token)
-                      (assoc inner-token->index token)))
-               outer-token->index
-               (list-index-entries-for-owner kv-store owner :refresh refresh)))
-           {})))
+    (let [owner->owner-key (kv/fetch kv-store token-owners-key :refresh refresh)]
+      (reduce
+        (fn [outer-token->index [owner owner-key]]
+          (reduce
+            (fn [inner-token->index [token entry]]
+              (->> (assoc entry :owner owner :token token)
+                   (assoc inner-token->index token)))
+            outer-token->index
+            (kv/fetch kv-store owner-key :refresh refresh)))
+        {}
+        owner->owner-key)))

   (defn get-token-index
     "Given a token and owner, return the token index entry with the token and owner as added fields.


Remove trace output

Remove trace output

--- src/clj_money/partitioning.clj
+++ src/clj_money/partitioning.clj
@@ -43,11 +43,7 @@
 (defn- descending-periodic-seq
   ([end period-like]
    (let [period (.toPeriod period-like)]
-     (map (fn [i]
-
-            (log/debug "dbk descending-periodic-seq " end " index " i)
-
-            (t/minus end (.multipliedBy period i)))
+     (map #(t/minus end (.multipliedBy period %))
           (iterate inc 0))))
   ([start end period-like]
    (let [period (.toPeriod period-like)]


add paper

add paper

--- src/cljs/swarmpit/material.cljs
+++ src/cljs/swarmpit/material.cljs
@@ -22,6 +22,7 @@
 (def create-factory js/React.createFactory)
 (def make-selectable js/MaterialUI.makeSelectable)

+(def paper (create-factory js/MaterialUI.Paper))
 (def avatar (create-factory js/MaterialUI.Avatar))
 (def app-bar (create-factory js/MaterialUI.AppBar))
 (def drawer (create-factory js/MaterialUI.Drawer))


make output-component a real component again to make sure it isn't refreshed when nothing has changed (fixes #53)

--- src/cljs/lambdacd/ui_core.cljs
+++ src/cljs/lambdacd/ui_core.cljs
@@ -38,9 +38,9 @@
 (defn current-build-component [build-state-atom build-number step-id-to-display-atom output-details-visible pipeline-component output-component header-component]
   (if-not (nil? @build-state-atom)
     (list
-     (header-component build-number)
-     (pipeline-component build-number build-state-atom @step-id-to-display-atom)
-     (output-component @build-state-atom @step-id-to-display-atom output-details-visible))
+     [header-component build-number]
+     [pipeline-component build-number build-state-atom @step-id-to-display-atom]
+     [output-component @build-state-atom @step-id-to-display-atom output-details-visible])
     [commons/loading-screen]))

 (defn wired-current-build-component [build-state-atom build-number step-id-to-display-atom output-details-visible]


[n.u.mapping] Add values to :edit-text and define :progress-bar

--- src/clojure/neko/ui/mapping.clj
+++ src/clojure/neko/ui/mapping.clj
@@ -8,6 +8,7 @@
             ImageView ImageView$ScaleType RelativeLayout ScrollView FrameLayout
             Gallery]
            android.app.ProgressDialog
+           android.view.inputmethod.EditorInfo
            [android.view View ViewGroup$LayoutParams Gravity]))

 ;; This atom keeps all the relations inside the map.
@@ -34,7 +35,23 @@
     :frame-layout {:classname android.widget.FrameLayout
                    :inherits :view-group}
     :edit-text {:classname android.widget.EditText
-                :inherits :view}
+                :inherits :view
+                :values {:number      EditorInfo/TYPE_CLASS_NUMBER
+                         :datetime    EditorInfo/TYPE_CLASS_DATETIME
+                         :text        EditorInfo/TYPE_CLASS_TEXT
+                         :phone       EditorInfo/TYPE_CLASS_PHONE
+                         :go          EditorInfo/IME_ACTION_GO
+                         :done        EditorInfo/IME_ACTION_DONE
+                         :unspecified EditorInfo/IME_ACTION_UNSPECIFIED
+                         :send        EditorInfo/IME_ACTION_SEND
+                         :search      EditorInfo/IME_ACTION_SEARCH
+                         :previous    EditorInfo/IME_ACTION_PREVIOUS
+                         :next        EditorInfo/IME_ACTION_NEXT}}
+    :progress-bar {:classname android.widget.ProgressBar
+                   :inherits  :view
+                   :value-namespaces {:visibility android.view.View}}
+    :progress-bar-large {:inherits  :progress-bar
+                         :constructor-args [nil android.R$attr/progressBarStyleLarge]}
     :text-view {:classname android.widget.TextView
                 :inherits :view
                 :value-namespaces


Adding new item on page after first now moves there

--- src/cljs/modern_cljs/core.cljs
+++ src/cljs/modern_cljs/core.cljs
@@ -69,7 +69,9 @@
       (do
         (if (not (nil? pos))
           (updatedb [:data] (assoc data pos (dissoc doc :pos)))
-          (updatedb [:data] (into [doc] data)))
+          (do
+            (updatedb [:data] (into [doc] data))
+            (updatedb [:start] 0)))
         (clear)
         (println "Saved!" (str doc))))))


Sets SMTP server to not require client auth on the TLS level.

--- src/clojure/neveragain/core.clj
+++ src/clojure/neveragain/core.clj
@@ -5,6 +5,7 @@
       [common :refer :all]
       [settings :as settings]
       rfc auth tls x-cm-login)
+    (swiss [arrows :refer :all])
     (less.awful [ssl :as las]))

   (:import
@@ -83,14 +84,19 @@
     (println (str "Serving on port " (.getLocalPort serv-socket)))
     (while (= 1 1)
       (let [client-socket (.accept serv-socket)
-          conn (make-conn client-socket)]
+            conn (make-conn client-socket)]
         (.execute thread-pool (fn [] (handle-conn conn)))))))

 (defn -main [& args]
   (println settings/banner)
-  (def tls-server (future (serve-forever (las/server-socket (las/ssl-context
-                           (:key settings/keyfiles)
-                           (:cert settings/keyfiles)
-                           (:ca settings/keyfiles)) "localhost" settings/tls-smtp-port) settings/thread-count)))
-  (serve-forever (ServerSocket. settings/smtp-port) settings/thread-count)
-  (deref tls-server))
+  (let [reg-server (-> (ServerSocket. settings/smtp-port)
+                       (serve-forever settings/thread-count)
+                       (future))
+        ssl-server (-<> [(:key settings/keyfiles)
+                         (:cert settings/keyfiles)
+                         (:ca settings/keyfiles)]
+                        (apply las/ssl-context <>)
+                        (las/server-socket "localhost" settings/tls-smtp-port))]
+    (.setNeedClientAuth ssl-server false)
+    (serve-forever ssl-server settings/thread-count)
+    (deref reg-server)))


Add info for April and May

Add info for April and May

--- src/cornwalltechjam/layout.clj
+++ src/cornwalltechjam/layout.clj
@@ -97,7 +97,7 @@
             [:img {:src "/assets/img/meetup-logo.svg"}]]]]
          [:div {:class "dropdown animated fadeInDown animation-delay-11"}
           [:a {:href "/index.html", :class "dropdown-toggle", :data-toggle "dropdown"}
-           [:i {:class "fa fa-bullhorn"}] " Next Tech Jam: 11th Mar"]]]]]
+           [:i {:class "fa fa-bullhorn"}] " Next Tech Jam: 8th Apr"]]]]]

       [:nav {:class "navbar navbar-default navbar-header-full navbar-dark yamm navbar-static-top", :role "navigation", :id "header"}
        [:div {:class "container"}


Specs should use `vector?` pred and not `vector`.

--- src/day8/re_frame/http_fx.cljs
+++ src/day8/re_frame/http_fx.cljs
@@ -63,8 +63,8 @@
 ;(s/def ::headers map?)
 ;(s/def ::with-credentials boolean?)
 ;
-;(s/def ::on-success vector)
-;(s/def ::on-failure vector)
+;(s/def ::on-success vector?)
+;(s/def ::on-failure vector?)
 ;
 ;(s/def ::request-map (s/and (s/keys :req-un [::method ::uri ::response-format ::on-success ::on-failure]
 ;                                    :opt-un [::format ::timeout ::params ::headers ::with-credentials])


Add environment variables into the CLI

Add environment variables into the CLI

--- src/degasolv/cli.clj
+++ src/degasolv/cli.clj
@@ -890,8 +890,11 @@
               (as->
                selected-option-packs it
                (mapv available-option-packs it)
-               (into [subcommand-option-defaults] it)
-               (conj it (dissoc config :option-packs))
+               [
+                subcommand-option-defaults
+                it
+                (dissoc config :option-packs)
+                env-vars]
                (conj it (into {}
                               (filter
                                #(not (nil? (second %)))


fixed delay

fixed delay

--- src/cljs/swarmpit/component/service/form_deployment.cljs
+++ src/cljs/swarmpit/component/service/form_deployment.cljs
@@ -10,7 +10,7 @@
 (defn- form-parallelism [value]
   (comp/form-comp
     "PARALLELISM"
-    (comp/vtext-field
+    (comp/text-field
       {:name     "parallelism"
        :key      "parallelism"
        :type     "number"
@@ -22,7 +22,7 @@
 (defn- form-delay [value]
   (comp/form-comp
     "DELAY"
-    (comp/vtext-field
+    (comp/text-field
       {:name     "delay"
        :key      "delay"
        :type     "number"


Fixed health color issue.

Fixed health color issue.

--- src/cljs/wombats_web_client/components/game_ranking.cljs
+++ src/cljs/wombats_web_client/components/game_ranking.cljs
@@ -2,7 +2,7 @@

 (defn get-health-color [hp]
   (cond
-   (<= 70 hp 100) "healthy"
+   (<= 70 hp) "healthy"
    (<= 30 hp 69) "okay-health"
    (<= 1 hp 29) "dying"
    :else "none"))