riimut

Crates.ioriimut
lib.rsriimut
version1.2.1
sourcesrc
created_at2021-07-21 11:09:48.178426
updated_at2022-11-21 17:22:39.557009
descriptionTransform latin letters to runes & vice versa.
homepage
repositoryhttps://github.com/stscoundrel/riimut-rs
max_upload_size
id425476
size42,072
Sampo Silvennoinen (stscoundrel)

documentation

README

Riimut

Transform latin letters to runes & vice versa.

Includes transformers for four main runic alphabets and common variations:

  • Elder Futhark
  • Younger Futhark
  • Medieval Futhork
  • Futhorc (Anglo-Frisian runes)
  • Staveless Futhark

Install

Add this to your Cargo.toml:

[dependencies]
riimut = "1.2.0"

Usage

Text to runes:

// Ships five dialects in separate modules.
use riimut::younger_futhark;
use riimut::elder_futhark;
use riimut::medieval_futhork;
use riimut::futhorc;
use riimut::staveless_futhark;

// From Old Groms runestone.
let younger_futhark = younger_futhark::letters_to_runes("auk tani karþi kristna");
println!(younger_futhark); // "ᛅᚢᚴ:ᛏᛅᚾᛁ:ᚴᛅᚱᚦᛁ:ᚴᚱᛁᛋᛏᚾᛅ"

// From 4th century axe in Jutland
let elder_futhark = elder_futhark::letters_to_runes("wagagastiz alu wihgu sikijaz aiþalataz");
println!(elder_futhark); // "ᚹᚨᚷᚨᚷᚨᛋᛏᛁᛉ:ᚨᛚᚢ:ᚹᛁᚻᚷᚢ:ᛋᛁᚲᛁᛃᚨᛉ:ᚨᛁᚦᚨᛚᚨᛏᚨᛉ"

// From Lord's Prayer, in Old Norse.
let medieval_futhork = medieval_futhork::letters_to_runes("Faðer uor som ast i himlüm, halgað warðe þit nama");
println!(medieval_futhork); // "ᚠᛆᚦᚽᚱ:ᚢᚮᚱ:ᛋᚮᛘ:ᛆᛋᛏ:ᛁ:ᚼᛁᛘᛚᚢᛘ,:ᚼᛆᛚᚵᛆᚦ:ᚠᛆᚱᚦᚽ:ᚦᛁᛏ:ᚿᛆᛘᛆ"

// From 8th century Franks Casket, in late West Saxon.
let futhorc = futhorc::letters_to_runes("fisc.flodu.ahofonferg | enberig |");
println!(futhorc); // "ᚠᛁᛋᚳ.ᚠᛚᚩᛞᚢ.ᚪᚻᚩᚠᚩᚾᚠᛖᚱᚷ:|:ᛖᚾᛒᛖᚱᛁᚷ:|"

// From Old Norse text in Hög runestone.
let staveless = staveless_futhark::letters_to_runes("kuþniutr þru sun lit rita stin þina ak bru kirþi aftiʀ bruþr sina asbiurn ak at kuþlaf");
println!(futhorc); // ᛍ╮ו⸜ᛁ╮⸍◟:ו◟╮:╵╮⸜:⸌ᛁ⸍:◟ᛁ⸍⸝:╵⸍ᛁ⸜:וᛁ⸜⸝:⸝ᛍ:ˏ◟╮:ᛍᛁ◟וᛁ:⸝ᛙ⸍ᛁʀ:ˏ◟╮ו◟:╵ᛁ⸜⸝:⸝╵ˏᛁ╮◟⸜:⸝ᛍ:⸝⸍:ᛍ╮ו⸌⸝ᛙ

Runes to text:


// All four dialects contain runes_to_letters function.
use riimut::younger_futhark;

let runic_text = "ᛅᚢᚴ:ᛏᛅᚾᛁ:ᚴᛅᚱᚦᛁ:ᚴᚱᛁᛋᛏᚾᛅ";
let latin_text = younger_futhark::runes_to_letters(runic_text);

println!(latin_text); // "auk tani karþi kristna"

Younger Futhark comes with long branch (Danish) and short twig (Norwegian & Swedish) variants. The default letters_to_runes uses long branch.

use riimut::younger_futhark;

let letters = "aábcdðeéfghiíjklmnoópqrstþuúvwxyýzåäæöøǫþ";

// Comes with named functions per style.
let long_branch = younger_futhark.letters_to_long_branch_runes(letters);
let short_twig = younger_futhark.letters_to_short_twig_runes(letters);

println!(long_branch); // ᛅᛅᛒᛋᛏᚦᛁᛁᚠᚴᚼᛁᛁᛁᚴᛚᛘᚾᚢᚢᛒᚴᚱᛋᛏᚦᚢᚢᚢᚢᛋᚢᚢᛋᚢᛅᛅᚢᚢᚢᚦ
println!(short_twig);  // ᛆᛆᛒᛌᛐᚦᛁᛁᚠᚴᚽᛁᛁᛁᚴᛚᛘᚿᚢᚢᛒᚴᚱᛌᛐᚦᚢᚢᚢᚢᛌᚢᚢᛌᚢᛆᛆᚢᚢᚢᚦ

What's in the name?

"Riimut" is the Finnish word for "runes". Most rune related cratenames were already taken, so just added some Finnish flavor to it.

Commit count: 52

cargo fmt