Last active
May 10, 2020 09:09
-
-
Save 7shi/2229f9197548068f1ea52e5162084743 to your computer and use it in GitHub Desktop.
[py] Novial dictionary converter (OBSOLETE!)
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
# extract tgz from http://www.blahedo.org/novial/nl.html | |
with open("novial.txt", "w", encoding="utf-8") as novial: | |
for i in range(ord("A"), ord("Z")): | |
with open("%c.txt" % i, encoding="iso-8859-1") as f: | |
lines = f.readlines() | |
texts = [] | |
for i, line in enumerate(lines): | |
line = line.strip() | |
if i > 1 and not line: | |
if texts: | |
novial.write(" ".join(texts) + "\n") | |
texts = [] | |
else: | |
texts += [line] | |
if texts: novial.write(" ".join(texts) + "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script is obsolete. Please use below:
https://gist.github.com/7shi/6a037b089eff7b14b7d8982d76ec9d08