Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
Merge pull request #226 from stscoundrel/fix/letter-oe
Browse files Browse the repository at this point in the history
Letter mappings: add œ
  • Loading branch information
stscoundrel authored Oct 1, 2022
2 parents 4db0409 + 9ccd266 commit 4f01ed4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/mappings/letter-mapping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const getLettersToLongBranchRunesMapping = (): Map<string, string> => {
letterMapping.set('å', 'ᚢ');
letterMapping.set('ä', 'ᛅ');
letterMapping.set('æ', 'ᛅ');
letterMapping.set('œ', 'ᚢ');
letterMapping.set('ö', 'ᚢ');
letterMapping.set('ø', 'ᚢ');
letterMapping.set('ǫ', 'ᚢ');
Expand Down Expand Up @@ -83,6 +84,7 @@ export const getLettersToShortTwigRunesMapping = (): Map<string, string> => {
letterMapping.set('å', 'ᚢ');
letterMapping.set('ä', 'ᛆ');
letterMapping.set('æ', 'ᛆ');
letterMapping.set('œ', 'ᚢ');
letterMapping.set('ö', 'ᚢ');
letterMapping.set('ø', 'ᚢ');
letterMapping.set('ǫ', 'ᚢ');
Expand Down
18 changes: 9 additions & 9 deletions tests/letters-to-runes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,36 @@ describe('Letters to runes transformation tests', () => {
});

test('Transforms letters to runes (default)', () => {
const content = 'aábcdðeéfghiíjklmnoópqrstþuúvwxyýzåäæöøǫþ';
const expected = 'ᛅᛅᛒᛋᛏᚦᛁᛁᚠᚴᚼᛁᛁᛁᚴᛚᛘᚾᚢᚢᛒᚴᚱᛋᛏᚦᚢᚢᚢᚢᛋᚢᚢᛋᚢᛅᛅᚢᚢᚢᚦ';
const content = 'aábcdðeéfghiíjklmnoópqrstþuúvwxyýzåäæœöøǫþ';
const expected = 'ᛅᛅᛒᛋᛏᚦᛁᛁᚠᚴᚼᛁᛁᛁᚴᛚᛘᚾᚢᚢᛒᚴᚱᛋᛏᚦᚢᚢᚢᚢᛋᚢᚢᛋᚢᛅᛅᚢᚢᚢᚢᚦ';

const result = youngerFuthark.lettersToRunes(content);

expect(result).toBe(expected);
});

test('Transforms letters to runes (long branch)', () => {
const content = 'aábcdðeéfghiíjklmnoópqrstþuúvwxyýzåäæöøǫþ';
const expected = 'ᛅᛅᛒᛋᛏᚦᛁᛁᚠᚴᚼᛁᛁᛁᚴᛚᛘᚾᚢᚢᛒᚴᚱᛋᛏᚦᚢᚢᚢᚢᛋᚢᚢᛋᚢᛅᛅᚢᚢᚢᚦ';
const content = 'aábcdðeéfghiíjklmnoópqrstþuúvwxyýzåäæœöøǫþ';
const expected = 'ᛅᛅᛒᛋᛏᚦᛁᛁᚠᚴᚼᛁᛁᛁᚴᛚᛘᚾᚢᚢᛒᚴᚱᛋᛏᚦᚢᚢᚢᚢᛋᚢᚢᛋᚢᛅᛅᚢᚢᚢᚢᚦ';

const result = youngerFuthark.lettersToLongBranchRunes(content);

expect(result).toBe(expected);
});

test('Transforms letters to runes (short twig)', () => {
const content = 'aábcdðeéfghiíjklmnoópqrstþuúvwxyýzåäæöøǫþ';
const expected = 'ᛆᛆᛒᛌᛐᚦᛁᛁᚠᚴᚽᛁᛁᛁᚴᛚᛘᚿᚢᚢᛒᚴᚱᛌᛐᚦᚢᚢᚢᚢᛌᚢᚢᛌᚢᛆᛆᚢᚢᚢᚦ';
const content = 'aábcdðeéfghiíjklmnoópqrstþuúvwxyýzåäæœöøǫþ';
const expected = 'ᛆᛆᛒᛌᛐᚦᛁᛁᚠᚴᚽᛁᛁᛁᚴᛚᛘᚿᚢᚢᛒᚴᚱᛌᛐᚦᚢᚢᚢᚢᛌᚢᚢᛌᚢᛆᛆᚢᚢᚢᚢᚦ';

const result = youngerFuthark.lettersToShortTwigRunes(content);

expect(result).toBe(expected);
});

test('Transforms letters to runes with given variant', () => {
const content = 'aábcdðeéfghiíjklmnoópqrstþuúvwxyýzåäæöøǫþ';
const expectedLongBranch = 'ᛅᛅᛒᛋᛏᚦᛁᛁᚠᚴᚼᛁᛁᛁᚴᛚᛘᚾᚢᚢᛒᚴᚱᛋᛏᚦᚢᚢᚢᚢᛋᚢᚢᛋᚢᛅᛅᚢᚢᚢᚦ';
const expectedShortTwig = 'ᛆᛆᛒᛌᛐᚦᛁᛁᚠᚴᚽᛁᛁᛁᚴᛚᛘᚿᚢᚢᛒᚴᚱᛌᛐᚦᚢᚢᚢᚢᛌᚢᚢᛌᚢᛆᛆᚢᚢᚢᚦ';
const content = 'aábcdðeéfghiíjklmnoópqrstþuúvwxyýzåäæœöøǫþ';
const expectedLongBranch = 'ᛅᛅᛒᛋᛏᚦᛁᛁᚠᚴᚼᛁᛁᛁᚴᛚᛘᚾᚢᚢᛒᚴᚱᛋᛏᚦᚢᚢᚢᚢᛋᚢᚢᛋᚢᛅᛅᚢᚢᚢᚢᚦ';
const expectedShortTwig = 'ᛆᛆᛒᛌᛐᚦᛁᛁᚠᚴᚽᛁᛁᛁᚴᛚᛘᚿᚢᚢᛒᚴᚱᛌᛐᚦᚢᚢᚢᚢᛌᚢᚢᛌᚢᛆᛆᚢᚢᚢᚢᚦ';
const longBranchResult = youngerFuthark.lettersToRunes(content, Variant.LongBranch);
const shortTwigResult = youngerFuthark.lettersToRunes(content, Variant.ShortTwig);

Expand Down

0 comments on commit 4f01ed4

Please # to comment.