a29c18b
Pinchord · pinchord.git · Tickets · Changelog
Branches > main > a29c18b > files
Split chords into chords.edn and update dictionary generation script
Commit: a29c18ba0bf99b2a0131ba75cdadef8c5e5e79ac
Parent: 9056192
4 changed files:
README.md view file
@@ -9,3 +9,11 @@ Everything is versioned with a suffix number. Thanks to Kate (https://codeberg.org/StrawberryTurtle, https://github.com/StrawberryTurtle) and Harri (https://github.com/StenoHarri) for help and influence :)++# Dictionary++Chords can be found in "chords.edn".++To generate the dictionary into a javelin dict, run `./generate-dict.clj` (requires babashka - https://babashka.org).++Or you can just edit the generated dictionary directly of coursechords.edn view file
@@ -0,0 +1,237 @@+{:version 13+ :initials {"T" "t",+ "TSP*" "sk"+ "TSPHR" "sv",+ "TP" "f",+ "TSWR" "kr",+ "THR" "thr",+ "TPR" "fr",+ "PWR" "br",+ "SH*" "sch",+ "TSPR" "scr",+ "TSWH" "kn",+ "TWH" "thw",+ "PWHR" "bl",+ "SPWHR" "cl",+ "TS" "st",+ "SPR" "spr",+ "SWHR" "shr",+ "HR" "l",+ "WH" "wh",+ "TW" "tw",+ "S" "s",+ "SR" "v",+ "TPWR" "dr",+ "H" "h",+ "PR" "pr",+ "TSPWR" "gr",+ "SHR" "sl",+ "SW" "sw",+ "SWR" "y",+ "TSPWH" "gh",+ "R" "r",+ "TSPR*" "squ",+ "TWR" "vr",+ "TSR" "str",+ "TWHR" "j",+ "SH" "sh",+ "PH" "m",+ "TSP" "sc",+ "TR" "tr",+ "P" "p",+ "WHR" "qu",+ "WHR*" "q",+ "TPHR" "fl",+ "TH" "th",+ "WR" "wr",+ "SPWR" "cr",+ "SPH" "sm",+ "TSW" "k",+ "SPHR" "spl",+ "TSPWHR" "gl",+ "TSWHR" "kl",+ "SPW" "c",+ "SWH" "z",+ "PHR" "pl",+ "SPWH" "ch",+ "TSPW" "g",+ "W" "w",+ "SP" "sp",+ "TSPH" "sn",+ "TPH" "n",+ "TPW" "d",+ "PW" "b"}++ :vowels {"OU" "ou",+ "AU" "au",+ "AOI" "ee",+ "AO^" "oa",+ "AU^" "ua",+ "AI^" "ia",+ "IU^" "ui",+ "IU" "e",+ "AIU" "ea",+ "OI^" "io",+ "AIU^" "ae",+ "AOU" "ei",+ "U^" "ue",+ "U" "u",+ "O" "o",+ "AO" "oo",+ "A" "a",+ "I" "i",+ "I^" "y",+ "AOIU" "",+ "OIU" "oe",+ "AOU^" "ie",+ "OI" "oi",+ "OIU^" "eo",+ "AI" "ai"}++ :finals {"FS" "v"+ "FS*" "vv"+ "LFS" "lv"+ "LRFS" "nv"+ "RFS" "rv"+ "KFS" "sh"+ "LKFS" "lsh"+ "LRKFS" "nsh"+ "RKFS" "rsh"+ "KFS*" "w"+ "LKFS*" "wl"+ "LRKFS*" "wn"+ "RKFS*" "rw"+ "L" "l"+ "LR" "rl"+ "R" "r"+ "P" "p"+ "LP" "lp"+ "LRP" "mp"+ "RP" "rp"+ "PK" "b"+ "LPK" "lb"+ "LRPK" "mb"+ "RPK" "rb"+ "PF" "n"+ "LPF" "ln"+ "LRPF" "nn"+ "RPF" "rn"+ "PKFS" "g"+ "LPKFS" "lg"+ "LRPKFS" "ng"+ "RPKFS" "rg"+ "RPKFS*" "gh"+ "RPKFST*" "ght"+ "F" "f"+ "F*" "ff"+ "LF" "lf"+ "LRF" "nf"+ "LRF*" "fn" ;; :garfsmie:+ "RF" "rf"+ "PFT" "y"+ "PFT*" "yy"+ "LPFT" "ly"+ "LPFT*" "nly"+ "RPFT" "ry"+ "RPFT*" "rly"+ "LRPFT" "ny"++ "PKST" "j"+ "LPKST" "lj"+ "LRPKST" "nj"+ "RPKST" "rj"++ "PKF" "d"+ "LPKF" "ld"+ "LRPKF" "nd"+ "RPKF" "rd"+ "RPKF*" "dg"+ "KS" "x"+ "RKS" "rx"+ "LKS" "lx"+ "LRKS" "nx"+ "KST" "xt"+ "RKST" "rxt"+ "LKST" "lxt"+ "LRKST" "nxt"+ "KF" "ch"+ "LKF" "lch"+ "LRKF" "nch"+ "RKF" "rch"+ "K" "k"+ "K*" "ck"+ "LK" "lk"+ "LRK" "nk"+ "RK" "rk"+ "S" "s"+ "LS" "ls"+ "LRS" "ns"+ "RS" "rs"+ "PS" "m"+ "LPS" "lm"+ "LRPS" "mn"+ "RPS" "rm"+ ;"P" * "S h"+ ;"PKF" * "S gh"+ ;"PKF" * "TS ght"+ "PFS" "z"+ "LPFS" "lz"+ "LRPFS" "nz"+ "RPFS" "rz"+ "T" "t"+ "LT" "lt"+ "LRT" "nt"+ "RT" "rt"+ "ST" "st"+ "LST" "lst"+ "LRST" "nst"+ "RST" "rst"+ "PT" "pt"+ "KT" "kt"+ "FT" "ft"+ "PKFT" "ky"+ "RPKFT" "cky"+ "L*" "ll"+ "R*" "rr"+ "P*" "pp"+ "PK*" "w"+ "LPK*" "bl"+ "LRPK*" "bbl"+ "PKFS*" "gg"+ "LRPFT*" "nny"+ "PKF*" "dd"+ "LPKF*" "ddl"+ "LRPKF*" "rld"+ "KS*" "sk"+ "RKS*" "rsk"+ "LKS*" "lsk"+ "LRKS*" "nsk"+ "KST*" "sc"+ "RKST*" "rsc"+ "LKST*" "lsc"+ "LRKST*" "nsc"+ "KF*" "tch"+ "PKS" "c"+ "LPKS" "lc"+ "LRPKS" "nc"+ "RPKS" "rc"+ "PKS*" "h"+ "S*" "ss"+ "PS*" "sp"+ ;"P*S*" "tion"+ ;"PKF*S*" "ction"+ ;"PKF*TS*" "nction"+ "PFS*" "zz"+ "T*" "tt"+ "LT*" "ttl"+ "ST*" "th"+ "LST*" "lth"+ "LRST*" "nth"+ "RST*" "rth"+ "KT*" "ct"+ "PKFT*" "cy"}+ :pre-prefixes {"+" "{^}"+ "_" "{^}_"+ "_+" "{^}_"}+ :prefixes {"#" "{-|}"}+ :suffixes {"E" "e"}}generate-dictionary.clj view file
@@ -0,0 +1,43 @@+#!/usr/bin/env bb+;; Dictionay generation script+(def priority+ "Priorities used for javelin orthospelling."+ (zipmap [::pre-prefixes ::prefixes ::initials ::vowels ::finals ::suffixes]+ (rest (range))))++(comment+ (def yaml-dict (yaml/parse-string (slurp "pinchord-javelin-dictionary.yaml")))++ (->> (:letters yaml-dict)+ (filter #(= (:order %) 2))+ (map (fn [m] [(:stroke m) (:data m)]))+ (into {})))++(defn finalize+ "Puts dashes before all the keys of m"+ [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)))}]++ (->> (yaml/generate-string dict)+ (spit (str "pinchord-javelin-dictionary-" version ".yaml")))))++(generate-dict!)+pinchord-dict.clj view file
@@ -1,291 +0,0 @@-;; Dictionay generation script-(def priority- "Priorities used for javelin orthospelling."- (zipmap [::pre-prefixes ::prefixes ::initials ::vowels ::finals ::suffixes]- (rest (range))))--(def version 13)--(comment- (def yaml-dict (yaml/parse-string (slurp "pinchord-javelin-dictionary.yaml")))-- (->> (:letters yaml-dict)- (filter #(= (:order %) 2))- (map (fn [m] [(:stroke m) (:data m)]))- (into {})))--(def initials {"T" "t",- "TSP*" "sk"- "TSPHR" "sv",- "TP" "f",- "TSWR" "kr",- "THR" "thr",- "TPR" "fr",- "PWR" "br",- "SH*" "sch",- "TSPR" "scr",- "TSWH" "kn",- "TWH" "thw",- "PWHR" "bl",- "SPWHR" "cl",- "TS" "st",- "SPR" "spr",- "SWHR" "shr",- "HR" "l",- "WH" "wh",- "TW" "tw",- "S" "s",- "SR" "v",- "TPWR" "dr",- "H" "h",- "PR" "pr",- "TSPWR" "gr",- "SHR" "sl",- "SW" "sw",- "SWR" "y",- "TSPWH" "gh",- "R" "r",- "TSPR*" "squ",- "TWR" "vr",- "TSR" "str",- "TWHR" "j",- "SH" "sh",- "PH" "m",- "TSP" "sc",- "TR" "tr",- "P" "p",- "WHR" "qu",- "WHR*" "q",- "TPHR" "fl",- "TH" "th",- "WR" "wr",- "SPWR" "cr",- "SPH" "sm",- "TSW" "k",- "SPHR" "spl",- "TSPWHR" "gl",- "TSWHR" "kl",- "SPW" "c",- "SWH" "z",- "PHR" "pl",- "SPWH" "ch",- "TSPW" "g",- "W" "w",- "SP" "sp",- "TSPH" "sn",- "TPH" "n",- "TPW" "d",- "PW" "b"})--(def vowels {"OU" "ou",- "AU" "au",- "AOI" "ee",- "AO^" "oa",- "AU^" "ua",- "AI^" "ia",- "IU^" "ui",- "IU" "e",- "AIU" "ea",- "OI^" "io",- "AIU^" "ae",- "AOU" "ei",- "U^" "ue",- "U" "u",- "O" "o",- "AO" "oo",- "A" "a",- "I" "i",- "I^" "y",- "AOIU" "",