-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from stscoundrel/feature/staveless-futhark
Add Staveless Futhark
- Loading branch information
Showing
5 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package stavelessfuthark | ||
|
||
func getLetterMapping() map[string]string { | ||
return map[string]string{ | ||
"a": "⸝", | ||
"á": "⸝", | ||
"b": "ˏ", | ||
"c": "╵", | ||
"d": "⸍", | ||
"ð": "ו", | ||
"e": "ᛁ", | ||
"é": "ᛁ", | ||
"f": "ᛙ", | ||
"g": "ᛍ", | ||
"h": "ᚽ", | ||
"i": "ᛁ", | ||
"í": "ᛁ", | ||
"j": "ᛁ", | ||
"k": "ᛍ", | ||
"l": "⸌", | ||
"m": "⠃", | ||
"n": "⸜", | ||
"o": "ˎ", | ||
"ó": "ˎ", | ||
"p": "ˏ", | ||
"q": "ᛍ", | ||
"r": "◟", | ||
"R": "⡄", | ||
"s": "╵", | ||
"t": "⸍", | ||
"þ": "ו", | ||
"u": "╮", | ||
"ú": "╮", | ||
"v": "╮", | ||
"w": "╮", | ||
"x": "╵", | ||
"y": "╮", | ||
"ý": "╮", | ||
"z": "╵", | ||
"å": "ˎ", | ||
"ä": "⸝", | ||
"æ": "⸝", | ||
"ö": "ˎ", | ||
"ø": "ˎ", | ||
"ǫ": "ˎ", | ||
" ": ":", | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package stavelessfuthark | ||
|
||
func getRuneMapping() map[string]string { | ||
return map[string]string{ | ||
"ᛙ": "f", | ||
"╮": "u", | ||
"ו": "þ", | ||
"ˎ": "o", | ||
"◟": "r", | ||
"ᛍ": "k", | ||
"ᚽ": "h", | ||
"⸜": "n", | ||
"ᛁ": "i", | ||
"⸝": "a", | ||
"╵": "s", | ||
"⸍": "t", | ||
"ˏ": "b", | ||
"⠃": "m", | ||
"⸌": "l", | ||
"⡄": "R", | ||
":": " ", | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package stavelessfuthark | ||
|
||
import ( | ||
"github.com/stscoundrel/riimut-go/internal/transform" | ||
) | ||
|
||
func LettersToRunes(content string) string { | ||
letterMapping := getLetterMapping() | ||
return transform.Transform(content, letterMapping) | ||
} | ||
|
||
func RunesToLetters(content string) string { | ||
runeMapping := getRuneMapping() | ||
return transform.Transform(content, runeMapping) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package stavelessfuthark | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestTransformsLettersToRunes(t *testing.T) { | ||
const content = "aábcdðeéfghiíjklmnoópqrRstþuúvwxyýzåäæöøǫþ " | ||
const expected = "⸝⸝ˏ╵⸍וᛁᛁᛙᛍᚽᛁᛁᛁᛍ⸌⠃⸜ˎˎˏᛍ◟◟╵⸍ו╮╮╮╮╵╮╮╵ˎ⸝⸝ˎˎˎו:" | ||
result := LettersToRunes(content) | ||
|
||
if result != expected { | ||
t.Error("Did not transform letters to runes. Received", result, "expected ", expected) | ||
} | ||
} | ||
|
||
func TestTransformsRunesToletters(t *testing.T) { | ||
const content = "ᛙ╮וˎ⡄ᛍᚽ⸜ᛁ⸝╵⸍ˏ⠃⸌⡄:" | ||
const expected = "fuþoRkhniastbmlR " | ||
result := RunesToLetters(content) | ||
|
||
if result != expected { | ||
t.Error("Did not transform runes to letters. Received", result, "expected ", expected) | ||
} | ||
} |