mirror of
https://github.com/plasmaofthedawn/fcitx5-toki-pona.git
synced 2026-04-24 04:02:50 -06:00
made emoji and UCSUR creation better
This commit is contained in:
17
combine.py
17
combine.py
@@ -1,14 +1,25 @@
|
|||||||
import subprocess
|
import subprocess
|
||||||
import os
|
import os
|
||||||
|
from collections import defaultdict
|
||||||
|
|
||||||
header = """KeyCode=mnptkswljiueoaAR
|
|
||||||
|
|
||||||
|
|
||||||
|
headers = defaultdict(lambda: """KeyCode=mnptkswljiueoaAR
|
||||||
|
Length=16
|
||||||
|
Prompt=
|
||||||
|
ConstructPhrase=
|
||||||
|
[Data]
|
||||||
|
""")
|
||||||
|
|
||||||
|
headers["UCSUR"] = """KeyCode=mnptkswljiueoa()[]{}^*.:"
|
||||||
Length=16
|
Length=16
|
||||||
Prompt=
|
Prompt=
|
||||||
ConstructPhrase=
|
ConstructPhrase=
|
||||||
[Data]
|
[Data]
|
||||||
"""
|
"""
|
||||||
|
|
||||||
ucscr_header = """KeyCode=mnptkswljiueoa()[]{}^*.: -"
|
headers["nasin pi sitelen jelo"] = """KeyCode=mnptkswljiueoa[]"
|
||||||
Length=16
|
Length=16
|
||||||
Prompt=
|
Prompt=
|
||||||
ConstructPhrase=
|
ConstructPhrase=
|
||||||
@@ -70,7 +81,7 @@ for n, fn, d in zip(names, filenames, data.split("---")):
|
|||||||
print(n, fn)
|
print(n, fn)
|
||||||
|
|
||||||
with open(f"raw_tables/{fn}.txt", "w") as f:
|
with open(f"raw_tables/{fn}.txt", "w") as f:
|
||||||
f.write(header if n != "UCSUR" and n != "nasin pi sitelen jelo" else ucscr_header)
|
f.write(headers[n])
|
||||||
f.write(d.strip())
|
f.write(d.strip())
|
||||||
|
|
||||||
subprocess.Popen(["libime_tabledict", f"raw_tables/{fn}.txt", f"table/{fn}.dict"])
|
subprocess.Popen(["libime_tabledict", f"raw_tables/{fn}.txt", f"table/{fn}.dict"])
|
||||||
|
|||||||
Reference in New Issue
Block a user