ae59041
Pinchord · pinchord.git · Tickets · Changelog
Branches > build-process > ae59041 > files / plover_pinchord / dictionaries
Update Plover plugin to v28.0 for testing
Commit: ae59041ced4510c1a7dbfc2cd247e8a1aaeb008b
Parent: c466e55
8 changed files:
chords.edn view file
@@ -1,4 +1,4 @@-{:version "v27.0"+{:version "v28.0" :banks {:prefixes "#+" :initials "TSPWHR&" :vowels "AOIU^"@@ -20,6 +20,7 @@ "TWH" "thw" "PWHR" "bl" "SPWHR" "cl"+ "SPWHR&" "chl" "TS" "st" "TSH" "sth" "TS&" "ts"@@ -28,6 +29,7 @@ "HR" "l" "HR&" "ll" "WH" "wh"+ "WH&" "hw" ; The two hwat? "TW" "tw" "S" "s" "SR" "v"@@ -61,6 +63,7 @@ "TH" "th" "WR" "wr" "SPWR" "cr"+ "SPWR&" "chr" "SPH" "sm" "TSW" "k" "SPHR" "spl"@@ -73,7 +76,9 @@ "TSPW" "g" "W" "w" "SP" "sp"+ "SP&" "sph" "TSPH" "sn"+ "TSPHR" "scl" "TPH" "n" "TPH&" "mn" "TPW" "d"@@ -126,6 +131,7 @@ "LP" "lp" "LP*" "pl" "LRP" "mp"+ "LRP*" "mpl" "RP" "rp" "PK" "b" "LPK" "lb"@@ -147,13 +153,14 @@ "F" "f" "F*" "ff" "LF" "lf"+ "LF8" "fl" "LRF" "nf" "LRF*" "fn" ;; :garfsmie: "RF" "rf" "PFT" "y" "PFT*" "yy" "LPFT" "ly"- "RPFT*" "nly"+ "RPFT*" "rry" ; TODO this was wrong update it spooglypop "LRPFT*" "nny" "LPFT*" "lly" "RPFT" "ry"@@ -183,8 +190,10 @@ "LKST" "lxt" "LRKST" "nxt" "KF" "ch"+ "KF&" "q" "LKF" "lch" "LRKF" "nch"+ "LRKF&" "nsion" "RKF" "rch" "K" "k" "K*" "ck"@@ -201,8 +210,10 @@ "PS" "m" "LPS" "lm" "LRPS" "mn"+ "LRPS&" "gm" "RPS" "rm" "PFS" "z"+ "PFS*" "zz" "LPFS" "lz" "LRPFS" "nz" "RPFS" "rz"@@ -221,21 +232,32 @@ "LRPT" "npt" "RPT" "rpt" - "KT" "kt"- "KT*" "h"+ "KT*" "kt"+ "KT" "h" "PKT*" "ph" "PKT" "hp" ; :p- "LKT" "lkt"- "LRKT" "nkt"- "RKT" "rkt"+ "LKT" "hl"generate-dictionary.clj view file
@@ -20,6 +20,7 @@ (defn mask [s1 s2] (apply str (remove (set s1) s2))) +; TODO make this make all chords that aren't in chords.edn map to themself :D (let [chords (-> (edn/read-string (slurp "chords.edn")) (update :finals finalize) (update :suffix finalize))plover_pinchord/dictionaries/pinchord-v27.0.1.py view file
@@ -1,353 +0,0 @@-## Pinchord Plover python dictionary-import re--## Longest valid outline, Pinchord only needs one stroke outlines :)-LONGEST_KEY = 1--## TODO move this into the dict, or just wait until chords.edn is the dictionary format?-BANKS = ["prefixes", "initials", "vowels", "finals", "suffixes"]--## Specified by 'chords.edn' (https://grahp.dev/pinchord.git/chords.edn)-## Unlike Shrimple, Pinchord enumerates all bank chords!-DICT = {- "prefixes": {- "+": "{^}",- "#": "{-|}",- "#+": "{^}{-|}",- "": "{}",- },-- "initials": {- "T": "t",- "TSP&": "sk",- "TP": "f",- "TP&": "ph",- "TSWR": "kr",- "THR": "thr",- "TPR": "fr",- "PWR": "br",- "SH&": "sch",- "TSPR": "scr",- "TSPR&": "skr",- "TSWH": "kn",- "TWH": "thw",- "PWHR": "bl",- "SPWHR": "cl",- "TS": "st",- "TS&": "ts",- "TSH": "sth",- "SPR": "spr",- "SHR&": "shr",- "HR": "l",- "HR&": "ll",- "WH": "wh",- "TW": "tw",- "S": "s",- "SR": "v",- "SR&": "vr",- "TPWR": "dr",- "TPWH": "x",- "H": "h",- "PR": "pr",- "TSPWR": "gr",- "SHR": "sl",- "SW": "sw",- "SW&": "sv",- "SWR": "y",- "TSPWH": "gh",- "R": "r",- "R&": "rh",- "SWHR": "squ",- "TSR": "str",- "TSR&": "tz",- "TWHR": "j",- "SH": "sh",- "PH": "m",- "TSP": "sc",- "TR": "tr",- "P": "p",- "WHR": "qu",- "WHR&": "q",- "TPHR": "fl",- "TPHR&": "phl",- "TPR&": "phr",- "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",- "TPH&": "mn",- "TPW": "d",- "PW": "b",- },-- "vowels": {- "OU": "ou",- "AU": "au",- "AOI": "ei",plover_pinchord/dictionaries/pinchord-v28.0.json plover_pinchord/dictionaries/pinchord-v27.0.1.json view file
plover_pinchord/dictionaries/pinchord-v28.0.py view file
@@ -0,0 +1,350 @@+## Pinchord Plover python dictionary+import re++## Longest valid outline, Pinchord only needs one stroke outlines :)+LONGEST_KEY = 1++## TODO move this into the dict, or just wait until chords.edn is the dictionary format?+BANKS = ["prefixes", "initials", "vowels", "finals", "suffixes"]++## Specified by and generated from 'chords.edn' (https://grahp.dev/pinchord.git/chords.edn)+## Unlike Shrimple, Pinchord enumerates all bank chords!+DICT = {"initials": {"": "{^}",+ "WH&": "hw",+ "T": "t",+ "TSP&": "sk",+ "TS&": "ts",+ "TSPHR": "scl",+ "TP": "f",+ "TSWR": "kr",+ "THR": "thr",+ "TPR": "fr",+ "HR&": "ll",+ "PWR": "br",+ "TSPR": "scr",+ "TSWH": "kn",+ "TWH": "thw",+ "SHR&": "shr",+ "TP&": "ph",+ "PWHR": "bl",+ "TPH&": "mn",+ "TPR&": "phr",+ "SPWHR&": "chl",+ "SPWHR": "cl",+ "TS": "st",+ "SW&": "sv",+ "SPR": "spr",+ "SWHR": "squ",+ "HR": "l",+ "WH": "wh",+ "TW": "tw",+ "S": "s",+ "SR": "v",+ "TPWR": "dr",+ "TSH": "sth",+ "H": "h",+ "PR": "pr",+ "TSPWR": "gr",+ "SHR": "sl",+ "TSR&": "tz",+ "SW": "sw",+ "SWH": "z",+ "TSPWH": "gh",+ "TSPR&": "skr",+ "R": "r",+ "TPWH": "x",+ "TSR": "str",+ "TWHR": "j",+ "SH": "sh",+ "SPWR&": "chr",+ "PH": "m",+ "TSP": "sc",+ "TR": "tr",+ "P": "p",+ "SH&": "sch",+ "TPHR": "fl",+ "TPHR&": "phl",+ "TH": "th",+ "WR": "wr",+ "SP&": "sph",+ "SPWR": "cr",+ "SPH": "sm",+ "TSW": "k",+ "SR&": "vr",+ "SPHR": "spl",+ "TSPWHR": "gl",+ "SWR": "y",+ "TSWHR": "kl",+ "SPW": "c",+ "WHR&": "q",+ "PHR": "pl",+ "SPWH": "ch",+ "TSPW": "g",+ "W": "w",+ "R&": "rh",+ "SP": "sp",+ "TSPH": "sn",+ "TPH": "n",+ "TPW": "d",+ "WHR": "qu",+ "PW": "b"},+ "vowels": {"OU": "ou",+ "AU": "au",+ "AOI": "ei",+ "AU^": "ua",+ "IU": "e",+ "AOU^": "iu",+ "IU^": "ee",+ "AIU": "ea",+ "AO^": "ao",+ "O^": "oo",+ "A^": "aa",+ "U^": "ue",+ "I^": "eu",+ "AOU": "ui",+ "OI^": "io",+ "U": "u",+ "AI^": "ia",+ "O": "o",+ "AO": "oa",+ "A": "a",+ "AIU^": "ae",+ "I": "i",+ "OIU^": "oe",+ "OIU": "eo",+ "AOI^": "ie",+ "OI": "oi",+ "^": "y",+ "AI": "ai"},+ "finals": {"RPF*": "rw",+ "T": "t",+ "RPKS*": "rsc",+ "PKT*": "ph",+ "LPF*": "wl",+ "LPKF": "ld",+ "LKT": "hl",+ "LRK*": "nck",+ "K": "k",+ "RPT": "rpt",+ "LRKS*": "nsk",+ "T*": "tt",+ "LF8": "fl",+ "LRPKFST": "ncy",+ "LPS": "lm",+ "KFS*": "gh",+ "LRPKF*": "ddl",+ "LPKS": "lc",+ "RPS": "rm",+ "KFT&": "ction",+ "PKFS": "g",+ "LRS": "ns",+ "RT": "rt",+ "KS*": "sk",+ "LPKFST": "lcy",+ "LR*": "rly",+ "PFS": "z",+ "KFS": "sh",+ "LRPKFT": "nky",+ "RPKF*": "rld",+ "LK*": "lck",+ "RPKF": "rd",+ "RKFT&": "stian",+ "KF": "ch",+ "LFST*": "lfth",+ "LRPFS": "nz",+ "RPF": "rn",+ "K*": "ck",+ "ST*": "ts",+ "LPFT": "ly",+ "RPKFS*": "dg",+ "RFT*": "stion",+ "PKT": "hp",+ "F*": "ff",+ "LRKF&": "nsion",+ "L": "l",+ "LKST": "lxt",+ "RT*": "rty",+ "LRFS": "nv",+ "LRPKST": "nct",+ "PFS*": "zz",+ "LRKT": "hn",+ "PKF*": "dd",+ "RPKS": "rc",+ "LP*": "pl",+ "LRKFS": "nsh",+ "PKS": "c",+ "RKFS": "rsh",+ "KT*": "kt",+ "LRST": "nst",+ "RKST*": "rj",+ "LRPFT": "ny",+ "LS": "ls",+ "PFT*": "yy",+ "PS*": "sp",+ "KT": "h",+ "LT": "lt",+ "LST": "lst",+ "S*": "ss",+ "PK": "b",+ "PT": "pt",+ "LRKT*": "nkt",+ "PKS*": "sc",+ "PF": "n",+ "RPK": "rb",+ "LRFST*": "ndth",+ "LRPFT*": "nny",+ "RFS": "rv",+ "S": "s",+ "LFT": "lft",+ "LRKST*": "nj",+ "KST*": "j",+ "LKS*": "lsk",+ "LF": "lf",+ "LRF": "nf",+ "R*": "rr",+ "RPKST": "rct",+ "LRKF": "nch",+ "LPKFS": "lg",+ "RKT*": "rkt",+ "LRK": "nk",+ "LRP*": "mpl",+ "FT": "ft",+ "PKFST": "cy",+ "LPFT*": "lly",+ "R": "r",+ "LRFST": "nth",+ "F": "f",+ "LKT*": "lkt",+ "LRKFT": "ntch",+ "FST*": "fth",+ "RF": "rf",+ "LRFT*": "ntion",+ "LRPK": "mb",+ "RPFS": "rz",+ "LRT": "nt",+ "LP": "lp",+ "RPKFT": "rky",+ "LRKFT&": "nction",+ "LFS": "lv",+ "LKFT&": "sion",+ "KFST*": "ght",+ "LRPS": "mn",+ "LK": "lk",+ "LPT": "lpt",+ "PS": "m",+ "RKF": "rch",+ "RK*": "rck",+ "FT*": "tion",+ "LPF": "ln",+ "LR": "rl",+ "P": "p",+ "LRPKFS": "ng",+ "LRPF": "nn",+ "RKS": "rx",+ "LKFS": "lsh",+ "RK": "rk",+ "LT*": "ttl",+ "LFT*": "ltion",+ "LRFT": "nft",+ "RKS*": "rsk",+ "LKST*": "lj",+ "LRP": "mp",+ "LPK": "lb",+ "LPKFT": "lky",+ "LRPT": "npt",+ "KFT": "tch",+ "LRPK*": "bbl",+ "PKFST*": "sy",+ "KS": "x",+ "PF*": "w",+ "RP": "rp",+ "RKST": "rxt",+ "LPKFT*": "lcky",+ "LRPKS": "nc",+ "RFT": "rft",+ "LPKST": "lct",+ "PKST": "ct",+ "FS": "v",+ "PKFS*": "gg",+ "PKFT*": "cky",+ "RPKFS": "rg",+ "RPFT*": "rry",+ "RST": "rst",+ "LRPKF": "nd",+ "FST": "th",+ "FS*": "vv",+ "ST": "st",+ "LPKF*": "ndl",+ "LPKS*": "lsc",+ "RPKFT*": "rcky",+ "KF&": "q",+ "KST": "xt",+ "LKFT": "ltch",+ "LRF*": "fn",+ "LRPKFS*": "gn",+ "RPFT": "ry",+ "LRKS": "nx",+ "PKFT": "ky",+ "PKF": "d",+ "RFST*": "rmth",+ "LPKFS*": "gl",+ "RKFT": "rtch",+ "LRPF*": "wn",+ "RFST": "rth",+ "LKS": "lx",+ "PFT": "y",+ "LRPS&": "gm",+ "P*": "pp",+ "LKF": "lch",+ "RKT": "hr",+ "L*": "ll",+ "LPK*": "bl",+ "RS": "rs",+ "LRPKS*": "nsc",+ "LRKST": "nxt",+ "RPKFST": "rcy",+ "LPFS": "lz",+ "LRPKFT*": "ncky",+ "LFST": "lth"},+ "suffixes": {"e": "e",+ "s": "s",+ "es": "es"},+ "prefixes": {"+": "{^}",+ "#": "{-|}",+ "#+": "{^}{-|}",+ "": "{}"}}++BANK_SPLITTING_REGEX = r"(#?\+?)(T?S?P?W?H?R?&?)(A?O?I?U?\^?\-?)(L?R?P?K?F?S?T?\*?)(e?s?)"++EMTPY_TRANSLATION = ""++def banks(stroke):+ match = re.match(BANK_SPLITTING_REGEX, stroke)+ if match:+ ## Due to javelin limitations I think making these banks extensible would be tricky, actually+ ## The regex definitely should be though.+ prefix, initials, vowels, finals, suffixes = match.groups()+ return {"prefixes": prefix, "initials": initials, "vowels": vowels, "finals": finals, "suffixes": suffixes}+ else:+ return None++def build_translation(stroke_banks):+ translation = ""+ for bank in BANKS:+ keys = stroke_banks.get(bank) or ""+ translation += DICT[bank].get(keys, "")+ return translation++def lookup_stroke(stroke):+ stroke_banks = banks(stroke)+ if stroke_banks:+ return build_translation(stroke_banks)+ else:+ return EMTPY_TRANSLATION++def lookup(outline):+ if len(outline) > LONGEST_KEY:+ return EMTPY_TRANSLATION+ else:+ stroke = outline[0]+ return lookup_stroke(stroke)plover_pinchord/system.py view file
@@ -17,7 +17,7 @@ UNDO_STROKE_STENO = "-LR" DICTIONARIES_ROOT = "asset:plover_pinchord:dictionaries"-DEFAULT_DICTIONARIES = ("user.json", "pinchord-v27.0.1.json", "pinchord-v27.0.1.py")+DEFAULT_DICTIONARIES = ("user.json", "pinchord-v28.0.json", "pinchord-v28.0.py") KEYMAPS = { "Keyboard": {pythonify.clj view file
@@ -0,0 +1,30 @@+(defn stringifyify [x]+ (str \" (name x) \"))++(defn pythonify [x]+ (cond+ (map? x) (str "{"+ (str/join ",\n"+ (map (fn [[k v]]+ (str (stringifyify k) ": " (pythonify v)))+ x))+ "}")+ (string? x) (stringifyify x)+ :else (str x)))++ ; "prefixes": {+ ; "+": "{^}",+ ; "#": "{-|}",+ ; "#+": "{^}{-|}",+ ; "": "{}",+ ; },++(def plover-prefixes {"+" "{^}"+ "#" "{-|}"+ "#+" "{^}{-|}"+ "" "{}"})++(comment+ (spit "pythontest.py" (pythonify (assoc (select-keys (edn/read-string (slurp "chords.edn"))+ [:initials :vowels :finals :suffixes])+ :prefixes plover-prefixes))))setup.cfg view file
@@ -1,6 +1,6 @@ [metadata] name = Pinchord-version = v27.0+version = v28.0 description = Chorded Typing System long_description = file:plover-description.md long_description_content_type = text/markdown