From 2778e94dfff02e1d61843a2d6d129d64aa969a0e Mon Sep 17 00:00:00 2001 From: Sampo Silvennoinen Date: Sat, 27 Nov 2021 21:48:28 +0200 Subject: [PATCH] Add readme & usage examples --- README.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/README.md b/README.md index 1b75917..4219e76 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,75 @@ # Riimut Transform latin letters to runes & vice versa. Go version. + +Includes transformers for four main runic alphabets: + +- Elder Futhark +- Younger Futhark +- Medieval Futhork +- Futhorc (Anglo-Frisian runes) + + +## Usage + +Text to runes: +```go +package main + +// Ships four runic dialects under riimut module. +import ( + "fmt" + + "github.com/stscoundrel/riimut/elderfuthark" + "github.com/stscoundrel/riimut/futhorc" + "github.com/stscoundrel/riimut/medievalfuthork" + "github.com/stscoundrel/riimut/youngerfuthark" +) + +func main() { + // From Old Groms runestone. + const content = "auk tani karþi kristna" + youngerFuthark = youngerfuthark.LettersToRunes(content) + fmt.Println(youngerFuthark) // ᛅᚢᚴ:ᛏᛅᚾᛁ:ᚴᛅᚱᚦᛁ:ᚴᚱᛁᛋᛏᚾᛅ + + // From 4th century axe in Jutland + const content = "wagagastiz alu wihgu sikijaz aiþalataz" + elderFuthark = elderfuthark.LettersToRunes(content) + fmt.Println(elderFuthark) // ᚹᚨᚷᚨᚷᚨᛋᛏᛁᛉ:ᚨᛚᚢ:ᚹᛁᚻᚷᚢ:ᛋᛁᚲᛁᛃᚨᛉ:ᚨᛁᚦᚨᛚᚨᛏᚨᛉ + + // From Lord's Prayer, in Old Norse. + const content = "Faðer uor som ast i himlüm, halgað warðe þit nama" + medievalFuthork = medievalfuthork.LettersToRunes(content) + fmt.Println(medievalFuthork) // ᚠᛆᚦᚽᚱ:ᚢᚮᚱ:ᛋᚮᛘ:ᛆᛋᛏ:ᛁ:ᚼᛁᛘᛚᚢᛘ,:ᚼᛆᛚᚵᛆᚦ:ᚠᛆᚱᚦᚽ:ᚦᛁᛏ:ᚿᛆᛘᛆ + + // From 8th century Franks Casket, in late West Saxon. + const content = "fisc.flodu.ahofonferg | enberig |" + futhorc = futhorc.LettersToRunes(content) + fmt.Println(futhorc) // ᚠᛁᛋᚳ.ᚠᛚᚩᛞᚢ.ᚪᚻᚩᚠᚩᚾᚠᛖᚱᚷ:|:ᛖᚾᛒᛖᚱᛁᚷ:| +} +``` + +Runes to text: +```go +package main + +// All four dialects contain RunesToLetters method. +import ( + "fmt", + + "github.com/stscoundrel/riimut/youngerfuthark" +) + +func main() { + const runicText = "ᛅᚢᚴ:ᛏᛅᚾᛁ:ᚴᛅᚱᚦᛁ:ᚴᚱᛁᛋᛏᚾᛅ" + latinText = youngerfuthark.RunesToLetters(runicText) + + fmt.Println(latinText) // "auk tani karþi kristna" +} + +``` + + +#### What's in the name? + +"Riimut" is the Finnish word for "runes".