Naraguna:Bennylin/trans-toba.js: Béda antara owahan

tanpa ringkesan besutan
/* rules for some cluster like ngg- that have different behaviour depending if it's the start of a word or not.
TODO: find more elegant solution */
if (str2.indexOf("nggrngg") == 0) { //nggrngg-
if (vowelPrev) konsonan = "ꦁ​ꦒꦿᯰᯎ";//<vowel>nggrngg-, e.g. panggrahitatunggal
//else if (matrakonsonan = "ᯰᯎ");//<nonvowel>ngg-, i.e. nggambar
else konsonan = "ꦔ꧀ꦒꦿ";//<nonvowel>nggr-, i.e. nggronjal
} else if (str2.indexOf("nggl") == 0) { //nggl-, e.g. ngglantung
konsonan = "ꦔ꧀ꦒ꧀ꦭ";
} else if (str2.indexOf("nggw") == 0) { //nggw-, e.g. munggwing
konsonan = "ꦔ꧀ꦒ꧀ꦮ";
} else if (str2.indexOf("nggy") == 0) { //nggy-, e.g. anggyat
konsonan = "ꦔ꧀ꦒꦾ";
} else if (str2.indexOf("ngg") == 0) { //ngg-
if (vowelPrev) konsonan = "ꦁ​ꦒ";//<vowel>ngg-, e.g. tunggal
//else if (spacePrev) konsonan = "​ꦔ꧀";//<space>ngg-, e.g. ditinggal nggambar (it has a zws)
else konsonan = "ꦔ꧀ꦒ";//<nonvowel>ngg-, i.e. nggambar
//for cluster longer than 4 consonants, such as "ditinggalnggambar",
//need to separate it by a space, "ditinggal nggambar" to be correct
 
} else if (str2core_sound.indexOf("rlx")CoreSound == 0'ᯱ' && matra == "᯲") { //r lx, e.g. pasarlxgiwignyan
konsonan = "ꦂꦊ"; matra = "";//ha
} else if (str2core_sound.indexOf("rrx")CoreSound == 0'ᯱ' && matra != "᯲") { //r rxwignyan
konsonan = "ꦂꦉ"; matra = "";//ha
} else if (str2core_sound.indexOf("hlx")CoreSound == 0'ᯰ​' && matra == "᯲") { //h lxcecak
if (vowelPrev) { konsonan = "ꦃꦊᯰ​"; matra = ""; }//cecak
} else konsonanif (core_sound.CoreSound == "ꦲ꧀ꦭꦼ";'ᯰ​' && matra != "";) { // cecak
} else if (str2.indexOf("hrx") =konsonan = 0) {"ᯝ"; //h rxnga
if (vowelPrev) { konsonan = "ꦃꦉ"; matra = ""; }
else konsonan = "ꦲꦽ"; matra = "";
} else if (str2.indexOf("qlx") == 0) { //just pasangan la + pepet
konsonan = "꧀ꦭꦼ"; matra = "";
} else if (str2.indexOf("qrx") == 0) { //just cakra keret
konsonan = "ꦽ"; matra = "";
 
} else if (core_sound.CoreSound == "ꦂꦂꦮ") { // -rw-
if (vowelPrev) konsonan = "ꦂꦮ";//-rw- -- arwana
else konsonan = "ꦫ꧀ꦮ";//rw- -- rwa/rwi/rwab
} else if (core_sound.CoreSound == "ꦃꦃꦭ") { // -hl-
if (vowelPrev) konsonan = "ꦃꦭ";//-hl-
else konsonan = "ꦲ꧀ꦭ";//hlam
} else if (core_sound.CoreSound == "ꦃꦃꦮ") { // -hw-
if (vowelPrev) konsonan = "ꦃꦮ";//-hw-
else konsonan = "ꦲ꧀ꦮ";//hwab,hwan
} else if (core_sound.CoreSound == "ꦃꦲꦾ") { // -hy-
if (vowelPrev) konsonan = "ꦃꦪ";//sembahyang
else konsonan = "ꦲꦾ";//hyang
/* rules for some characters that change depends on the matra/vowel (e.g. lx and rx, and -rx) */
 
} else if (findstr(core_sound.CoreSound,'ꦾ') && matra == "꧀") { // pengkal
konsonan = core_sound.CoreSound; matra = "";//-y-
} else if (findstr(core_sound.CoreSound,'ꦿ') && matra == "꧀") { // cakra
konsonan = core_sound.CoreSound; matra = "";//-r-
} else if (findstr(core_sound.CoreSound,'ꦿ') && matra == "ꦼ") { // cakra keret
if ((str[0] == "n" && str[1] == "y") || ((str[0] == "t" || str[0] == "d") && str[1] == "h")) {
konsonan = GetCoreSound(str[0]+str[1]).CoreSound + "ꦽ"; matra = "";//nyrê-, thrê-, dhrê-
} else if (str[0] == "n" && str[1] == "g") {
if (str[2] == "g") konsonan = "ꦔ꧀ꦒꦽ"; else konsonan = "ꦔꦽ"; matra = "";//nggrê-/ngrê-
} else { konsonan = GetCoreSound(str[0]).CoreSound + "ꦽ"; matra = "";//-rê-
}
} else if (findstr(core_sound.CoreSound, 'ꦭ') && matra == "ꦼ") { // nga lelet
if ((str[0] == "n" && str[1] == "y") || ((str[0] == "t" || str[0] == "d") && str[1] == "h")) {
konsonan = GetCoreSound(str[0]+str[1]).CoreSound + "꧀ꦭꦼ"; matra = "";//nylê-, thlê-, dhlê-
} else if (str[0] == "n" && str[1] == "g") {
if (str[2] == "g") konsonan = "ꦔ꧀ꦒ꧀ꦭꦼ"; else konsonan = "ꦔ꧀ꦭꦼ"; matra = "";//ngglê-/nglê-
} else if (str[0] == "l") {
konsonan = "ꦊ"; matra = "";//-lê-
} else { konsonan = GetCoreSound(str[0]).CoreSound + "꧀ꦭꦼ"; matra = "";//-lê-
}
 
} else if (core_sound.CoreSound == 'ꦃ' && matra == "꧀") { // wignyan - 12 April
konsonan = "ꦲ"; //ha
} else if (core_sound.CoreSound == 'ꦃ' && matra != "꧀") { // wignyan
konsonan = "ꦲ"; //ha
} else if (core_sound.CoreSound == 'ꦂ' && matra == "ꦼ") { // pa cerek
konsonan = "ꦉ"; matra = "";//rê
} else if (core_sound.CoreSound == 'ꦂ' && matra == "꧀") { // layar
konsonan = "ꦫ"; //ra
} else if (core_sound.CoreSound == 'ꦂ' && matra != "꧀") { // layar
konsonan = "ꦫ"; //ra
} else if (core_sound.CoreSound == 'ꦁ​' && matra == "꧀") { // cecak
konsonan = "ꦁ​"; matra = "";//cecak
} else if (core_sound.CoreSound == 'ꦁ​' && matra != "꧀") { // cecak
konsonan = "ꦔ"; //nga
} else {
konsonan = core_sound.CoreSound;
4.288

besutan