caefa5d

Pinchord · pinchord.git · Tickets · Changelog

Branches > build-process > caefa5d > files / README.md

extract sections

Grahp, 2026-01-09

Commit: caefa5d80b9cb22e5fde1e0291b1d63c5fe6df7d
Parent: a29c18b

1 changed file:

generate-dictionary.clj modified (view file)

@@ -1,8 +1,11 @@ #!/usr/bin/env bb ;; Dictionay generation script++(def sections [:pre-prefixes :prefixes :initials :vowels :finals :suffixes])+ (def priority   "Priorities used for javelin orthospelling."-  (zipmap [::pre-prefixes ::prefixes ::initials ::vowels ::finals ::suffixes]+  (zipmap sections           (rest (range))))  (comment@@ -18,26 +21,15 @@   [m]   (update-keys m (partial str \-))) -(defn generate-dict! []-  (let [chords (edn/read-string (slurp "chords.edn"))-        {:keys [version pre-prefixes prefixes initials vowels finals suffixes]} chords-        layout {::pre-prefixes pre-prefixes-                ::prefixes prefixes-                ::initials initials-                ::vowels vowels-                ::finals (finalize finals)-                ::suffixes (finalize suffixes)}-        dict {:name "Pinchord"-              :maximumOutlineLength 1-              :starters [{:stroke "" :definition "" :mask ""}]-              :letters (->> (reduce (fn [acc [layout entries]]-                                      (into acc (mapv (fn [[stroke translation]] {:stroke stroke :data translation :order (priority layout)})-                                                      entries)))-                                    #{} layout)-                            (sort-by (comp - count :stroke)))}]+(let [chords (edn/read-string (slurp "chords.edn"))+      dict {:name "Pinchord"+            :maximumOutlineLength 1+            :starters [{:stroke "" :definition "" :mask ""}]+            :letters (->> (reduce (fn [acc [layout entries]]+                                    (into acc (mapv (fn [[stroke translation]] {:stroke stroke :data translation :order (priority layout)})+                                                    entries)))+                                  #{} (select-keys chords sections))+                          (sort-by (comp - count :stroke)))}] -    (->> (yaml/generate-string dict)-         (spit (str "pinchord-javelin-dictionary-" version ".yaml")))))--(generate-dict!)-+  (->> (yaml/generate-string dict)+       (spit (str "pinchord-javelin-dictionary-" (:version dict) ".yaml"))))