to roman
This commit is contained in:
parent
8c919a1a8b
commit
686b844233
67
main.js
67
main.js
@ -63,6 +63,73 @@ function stripWord(word) {
|
|||||||
return word.replace(/[^a-zA-Z]/g, "");
|
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() {
|
function loadDictionary() {
|
||||||
fetch("./wordlist.json").then((e) => {
|
fetch("./wordlist.json").then((e) => {
|
||||||
if (e.status === 200) {
|
if (e.status === 200) {
|
||||||
|
@ -1,15 +1,21 @@
|
|||||||
{
|
{
|
||||||
"a.bae": {
|
"": [
|
||||||
"translation": "young",
|
{
|
||||||
"type": "modifier"
|
"type": "noun",
|
||||||
},
|
"meaning": "snow",
|
||||||
"a.e mo?": {
|
"translation": "snow",
|
||||||
"translation": "isn't it right?",
|
"notes": "ari is cute",
|
||||||
"type": "expression"
|
"examples": {
|
||||||
},
|
" ": "i hope ari can see snow"
|
||||||
"a.ga.ka": {
|
}
|
||||||
"translation": "at, towards, for",
|
},
|
||||||
"type": "marker",
|
{
|
||||||
"notes": "also used like"
|
"type": "noun",
|
||||||
}
|
"meaning": "safety",
|
||||||
|
"translation": "sfkjdjdsf",
|
||||||
|
"examples": {
|
||||||
|
"im safe with ari": ":3"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user