first commit

This commit is contained in:
zongor 2022-09-03 23:51:03 -04:00
commit 09acee34c8
2 changed files with 50 additions and 0 deletions

1
README.md Executable file
View File

@ -0,0 +1 @@
This translates an input file from ascii to [tolkiens english mode for anglo saxon futhark](http://std.dkuug.dk/jtc1/sc2/wg2/docs/n4013.pdf)

49
futhark.py Executable file
View File

@ -0,0 +1,49 @@
#!/usr/bin/python3
import sys
import fileinput
futhark_tolkien = [["ee", ""],
["oo", ""],
["ea", ""],
["eo", ""],
["ng", ""],
["st", ""],
["th", ""],
["sh", ""],
["a", ""],
["b", ""],
["c", ""],
["d", ""],
["e", ""],
["f", ""],
["g", ""],
["h", ""],
["i", ""],
["j", ""],
["k", ""],
["l", ""],
["m", ""],
["n", ""],
["o", ""],
["p", ""],
["q", "ᚳᚹ"],
["r", ""],
["s", ""],
["t", ""],
["u", ""],
["v", ""],
["w", ""],
["x", ""],
["y", ""],
["z", ""],
[".", ""],
[",", ""],
["?",":"]]
with open(sys.argv[1], 'r') as f1 :
with open(sys.argv[2], 'w') as f2:
for line in f1:
replaced = line
for rune in futhark_tolkien:
replaced = replaced.replace(rune[0], rune[1])
f2.write(replaced)