Skip to content

Commit

Permalink
Readme: add usage instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
stscoundrel committed Jun 18, 2022
1 parent 6e62445 commit 6a31ff7
Showing 1 changed file with 77 additions and 0 deletions.
77 changes: 77 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,83 @@ As Maven dependency.

For alternative install methods, see the [Maven Central Repo](https://search.maven.org/artifact/io.github.stscoundrel/riimut)

### Usage

Text to runes:
```java
// Ships four runic dialects under Riimut namespace.
import io.github.stscoundrel.riimut.dialects.YoungerFuthark;
import io.github.stscoundrel.riimut.dialects.ElderFuthark;
import io.github.stscoundrel.riimut.dialects.MedievalFuthork;
import io.github.stscoundrel.riimut.dialects.Futhorc;

// They all implement common "Dialect" interface
import io.github.stscoundrel.riimut.dialects.Dialect;

// From Old Groms runestone.
String content = "auk tani karþi kristna";
Dialect youngerFuthark = new YoungerFuthark();
String result = YoungerFuthark.lettersToRunes(content);
System.out.println(result); // ᛅᚢᚴ:ᛏᛅᚾᛁ:ᚴᛅᚱᚦᛁ:ᚴᚱᛁᛋᛏᚾᛅ

// From 4th century axe in Jutland
String content = "wagagastiz alu wihgu sikijaz aiþalataz";
String elderFuthark = ElderFuthark.lettersToRunes(content);
System.out.println(result); // ᚹᚨᚷᚨᚷᚨᛋᛏᛁᛉ:ᚨᛚᚢ:ᚹᛁᚻᚷᚢ:ᛋᛁᚲᛁᛃᚨᛉ:ᚨᛁᚦᚨᛚᚨᛏᚨᛉ

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

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

```

Runes to text:
```java

// All four dialects contain runesToLetters method.
import io.github.stscoundrel.riimut.dialects.YoungerFuthark;

YoungerFuthark youngerFuthark = new YoungerFuthark();
String runicText = "ᛅᚢᚴ:ᛏᛅᚾᛁ:ᚴᛅᚱᚦᛁ:ᚴᚱᛁᛋᛏᚾᛅ";
String latinText = youngerFuthark.runesToLetters(runicText);

System.out.println(latinText); // "auk tani karþi kristna"

```

Rune variants in Younger Futhark:

Younger Futhark comes with long branch (Danish) and short twig (Norwegian & Swedish) variants.
```java

import io.github.stscoundrel.riimut.dialects.YoungerFuthark;

String letters = "aábcdðeéfghiíjklmnoópqrstþuúvwxyýzåäæöøǫþ";
YoungerFuthark youngerFuthark = new YoungerFuthark();

// Comes with named methods per style.
String longBranch = youngerFuthark.lettersToLongBranchRunes(letters)
String shortTwig = youngerFuthark.lettersToShortTwigRunes(letters)

System.out.println(longBranch); // ᛅᛅᛒᛋᛏᚦᛁᛁᚠᚴᚼᛁᛁᛁᚴᛚᛘᚾᚢᚢᛒᚴᚱᛋᛏᚦᚢᚢᚢᚢᛋᚢᚢᛋᚢᛅᛅᚢᚢᚢᚦ"
System.out.println(shortTwig); // ᛆᛆᛒᛌᛐᚦᛁᛁᚠᚴᚽᛁᛁᛁᚴᛚᛘᚿᚢᚢᛒᚴᚱᛌᛐᚦᚢᚢᚢᚢᛌᚢᚢᛌᚢᛆᛆᚢᚢᚢᚦ

// Instance can also be created with default style. Then lettersToRunes will use that style.
YoungerFuthark youngerFutharkLongBranch = new YoungerFuthark(YoungerFuthark.Variant.LONG_BRANCH);
YoungerFuthark youngerFutharkShortTwig = new YoungerFuthark(YoungerFuthark.Variant.SHORT_TWIG);

// Or you can switch the style of instance at will.
youngerFutharkLongBranch.useShortTwig();
youngerFutharkShortTwig.useLongBranch();

```

#### What's in the name?

"Riimut" is the Finnish word for "runes".

0 comments on commit 6a31ff7

Please sign in to comment.