commit 09acee34c890fcdfaf2460d7e2d24688e00828ab Author: zongor Date: Sat Sep 3 23:51:03 2022 -0400 first commit diff --git a/README.md b/README.md new file mode 100755 index 0000000..964cba1 --- /dev/null +++ b/README.md @@ -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) \ No newline at end of file diff --git a/futhark.py b/futhark.py new file mode 100755 index 0000000..f155972 --- /dev/null +++ b/futhark.py @@ -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)