Created
January 1, 2021 14:21
-
-
Save skuzzymiglet/b3aa389a641d88a152569dd6d4838a57 to your computer and use it in GitHub Desktop.
extract digraphs as json from vim's display (old)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
f = open("raw", "r") | |
d = {} | |
for l in f.readlines(): | |
fields = l.split(" ") | |
for f in fields: | |
f = f.split(" ") | |
try: | |
d[f[0]] = f[1] | |
except IndexError: | |
#print("wtf", f) | |
pass | |
print(d) | |
s = json.dumps(d, ensure_ascii=False) | |
o = open("dig.json", "w") | |
o.write(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment