This commit is contained in:
remi 2022-06-08 22:28:59 +02:00
parent 8c919a1a8b
commit 686b844233
2 changed files with 86 additions and 13 deletions

67
main.js
View File

@ -63,6 +63,73 @@ function stripWord(word) {
return word.replace(/[^a-zA-Z]/g, "");
}
heonianVowels = {
"-1": "",
"0": "",
"1": "a",
"2": "e",
"3": "i",
"4": "o",
"5": "u",
"a": "a",
"b": "e",
"c": "i",
"d": "o",
"e": "u"
}
heonianVowelsSeparate = {
"0": "a",
"1": "e",
"2": "i",
"3": "o",
"4": "u",
"a": "a",
"b": "e",
"c": "i",
"d": "o",
"e": "u"
}
heonianConsonants = {
"00": "",
"01": "g",
"02": "sh",
"03": "r",
"04": "ny",
"05": "ch",
"06": "m",
"07": "j",
"07": "y",
"08": "f",
"09": "t",
"0a": "k",
"0b": "w",
"0c": "l",
"0d": "p",
"0e": "b",
"0f": "d",
"10": "h",
};
function heonianToRoman(text) {
let roman = "";
for (let i = 0; i < text.length; i++) {
let h = text.codePointAt(i);
if (h >= 57344 && h <= 57606) {
h = text.codePointAt(i).toString(16).split("");
if (h[1] == 0 && h[2] == 0) {
roman += heonianVowelsSeparate[h[3]];
} else {
roman += heonianConsonants[h[1]+""+h[2]]+heonianVowels[h[3]-1];
}
} else {
roman += text.charAt(i);
}
}
return roman;
}
function loadDictionary() {
fetch("./wordlist.json").then((e) => {
if (e.status === 200) {

View File

@ -1,15 +1,21 @@
{
"a.bae": {
"translation": "young",
"type": "modifier"
},
"a.e mo?": {
"translation": "isn't it right?",
"type": "expression"
},
"a.ga.ka": {
"translation": "at, towards, for",
"type": "marker",
"notes": "also used like"
}
"": [
{
"type": "noun",
"meaning": "snow",
"translation": "snow",
"notes": "ari is cute",
"examples": {
"     ": "i hope ari can see snow"
}
},
{
"type": "noun",
"meaning": "safety",
"translation": "sfkjdjdsf",
"examples": {
"im safe with ari": ":3"
}
}
]
}