Naraguna:Bennylin/trans.js: Béda antara owahan
Konten dihapus Konten ditambahkan
v 1.5 big change |
1.51 adding zws (zero-width-space) after each layar/cecak/wignyan to produce line break for a very long sentence without comma |
||
Larik 13:
* 1 Juni 2016 - v 1.3
* 2020 - v 1.4
* 2021
*
*▼
** v 1.51 zws (zero-width-space) after each layar/cecak/wignyan to produce line break
* Derived with permission from Hindi Transliteration by Markandey Singh @markandey▼
for a very long sentence without comma, disable the Javanese "parentheses"
* http://www.purplegene.com/static/HindiTranslitration.html▼
*
* TOC
Larik 28:
* VIII. Function GetSound
* IX. Function DoTransliterate
▲*
▲* Derived with permission from Hindi Transliteration by Markandey Singh @markandey
▲* http://www.purplegene.com/static/HindiTranslitration.html (deadlink as of 2021)
* http://web.archive.org/web/20190113114955/http://www.purplegene.com/static/HindiTranslitration.html
*/
Baris 331 ⟶ 335:
/* murda block end */
} else if (str.indexOf("hh") == 0) { //wignyan + ha, e.g. root word ends with 'h' with suffix -i
return { "CoreSound": "
} else if (str.indexOf("rh") == 0) { //layar + ha
return { "CoreSound": "
} else if (str.indexOf("h") == 1) { //h (h di posisi karakter kedua)
return { "CoreSound": "" + GetCoreSound(str2[0]).CoreSound + "꧀ꦲ", "len": 2 };
Baris 358 ⟶ 362:
} else if (str.indexOf("ngn") == 0) { //cecak + na
if (str.indexOf("ngng") == 0) { //ngng
return { "CoreSound": "
} else {
return { "CoreSound": "
}
} else if (str.indexOf("ngh") == 0) { //cecak + ha
return { "CoreSound": "
} else if (str.indexOf("ngc") == 0) { //cecak + ca
return { "CoreSound": "
} else if (str.indexOf("ngj") == 0) { //cecak + ja
return { "CoreSound": "
} else if (str.indexOf("ngl") == 0) { //ngl, e.g. ngluwari
return { "CoreSound": "ꦔ꧀ꦭ", "len": 3 };
Baris 373 ⟶ 377:
return { "CoreSound": "ꦔ꧀ꦮ", "len": 3 };
} else {
return { "CoreSound": "
}
} else if (str.indexOf("gg") == 0) { //'gg', e.g. root word ends with 'g' with suffix -i
return { "CoreSound": "ꦒ꧀ꦒ", "len": 2 };
} else if (str.indexOf("hg") == 0) { //wignyan + ga, e.g. dahgene
return { "CoreSound": "
} else if (str.indexOf("rg") == 0) { //layar + ga, e.g. amarga
return { "CoreSound": "
} else if (str.indexOf("g") == 1) { //g (g di posisi karakter kedua)
return { "CoreSound": "" + GetCoreSound(str2[0]).CoreSound + "꧀ꦒ", "len": 2 };
Baris 404 ⟶ 408:
} else if (str2.indexOf("ry") == 0) { //layar + ya, e.g. Suryati, Wiryadi
if (str.indexOf("ryy") == 0) {
return { "CoreSound": "
} else {
return { "CoreSound": "
}/*
} else if (str.indexOf("yy") == 0) { //'yy', I don't think it's possible
Baris 422 ⟶ 426:
return { "CoreSound": "" + "ꦮꦿ", "len": 2 };
} else if (str.indexOf("rr") == 0) { //layar + ra (no cakra)
return { "CoreSound": "
} else if (str2.indexOf("qr") == 0) { //qr -- only pasangan ra
return { "CoreSound": "꧀ꦫ", "len": 1 };
Baris 434 ⟶ 438:
//panjingan -l
if (str.indexOf("hl") == 0) { //wignyan + la
return { "CoreSound": "
} else if (str.indexOf("rl") == 0) { //layar + la
return { "CoreSound": "
} else if (str.indexOf("ll") == 0) { //ll
return { "CoreSound": "ꦭ꧀ꦭ", "len": 2 };
Baris 447 ⟶ 451:
//panjingan -w
if (str.indexOf("hw") == 0) { //wignyan + ha
return { "CoreSound": "
} else if (str.indexOf("rw") == 0) { //layar + ha
return { "CoreSound": "
} else if (str.indexOf("ww") == 0) { //ww (wwang, pûrwwa) - terima kasih Mas Revo
return { "CoreSound": "ꦮ꧀ꦮ", "len": 2 };
Baris 468 ⟶ 472:
}
} else if (str.indexOf("hc") == 0) { //wignyan + ca
return { "CoreSound": "
} else if (str.indexOf("rc") == 0) { //layar + ca -- arca
return { "CoreSound": "
} else if (str.indexOf("cc") == 0) { //cc -- impossible combination in real text
return { "CoreSound": "ꦕ꧀ꦕ", "len": 2 };
Baris 488 ⟶ 492:
}
} else if (str.indexOf("hj") == 0) { //wignyan + ja
return { "CoreSound": "
} else if (str.indexOf("rj") == 0) { //layar + ja
return { "CoreSound": "
} else if (str.indexOf("jj") == 0) { //jj -- impossible combination in real text
return { "CoreSound": "ꦗ꧀ꦗ", "len": 2 };
Baris 529 ⟶ 533:
}
} else if (str.indexOf("hn") == 0) { //wignyan + na
return { "CoreSound": "
} else if (str.indexOf("rn") == 0) { //layar + na
return { "CoreSound": "
} else if (str.indexOf("nn") == 0) { //nn, e.g. root word ends with 'n' with suffix -i
if (str.indexOf("nng") == 0) { //
return { "CoreSound": "
} else if (str.indexOf("nng") == 0) { //
return { "CoreSound": "ꦤ꧀ꦚ꧀", "len": 3 };
Baris 641 ⟶ 645:
"f":"ꦥ꦳", //fa rekan
"g":"ꦒ", //ga
"h":"
"i":"ꦲꦶ", //hi
"j":"ꦗ", //ja
Baris 651 ⟶ 655:
"p":"ꦥ", //pa
"q":"꧀", //pangkon
"r":"
"s":"ꦱ", //sa
"t":"ꦠ", //ta
Baris 787 ⟶ 791:
TODO: find more elegant solution */
if (str2.indexOf("nggr") == 0) { //nggr-
if (vowelPrev) konsonan = "
//else if (matra = "")
else konsonan = "ꦔ꧀ꦒꦿ";//<nonvowel>nggr-, i.e. nggronjal
Baris 797 ⟶ 801:
konsonan = "ꦔ꧀ꦒꦾ";
} else if (str2.indexOf("ngg") == 0) { //ngg-
if (vowelPrev) konsonan = "
//else if (spacePrev) konsonan = "ꦔ꧀";//<space>ngg-, e.g. ditinggal nggambar (it has a zws)
else konsonan = "ꦔ꧀ꦒ";//<nonvowel>ngg-, i.e. nggambar
Baris 804 ⟶ 808:
} else if (str2.indexOf("rlx") == 0) { //r lx, e.g. pasarlxgi
konsonan = "
} else if (str2.indexOf("rrx") == 0) { //r rx
konsonan = "
} else if (str2.indexOf("hlx") == 0) { //h lx
if (vowelPrev) { konsonan = "
else konsonan = "ꦲ꧀ꦭꦼ"; matra = "";
} else if (str2.indexOf("hrx") == 0) { //h rx
if (vowelPrev) { konsonan = "
else konsonan = "ꦲꦽ"; matra = "";
} else if (str2.indexOf("qlx") == 0) { //just pasangan la + pepet
Baris 818 ⟶ 822:
konsonan = "ꦽ"; matra = "";
} else if (core_sound.CoreSound == "
if (vowelPrev) konsonan = "
else konsonan = "ꦫ꧀ꦮ";//rw- -- rwa/rwi/rwab
} else if (core_sound.CoreSound == "
if (vowelPrev) konsonan = "
else konsonan = "ꦲ꧀ꦭ";//hlam
} else if (core_sound.CoreSound == "
if (vowelPrev) konsonan = "
else konsonan = "ꦲ꧀ꦮ";//hwab,hwan
} else if (core_sound.CoreSound == "
if (vowelPrev) konsonan = "
else konsonan = "ꦲꦾ";//hyang
/* rules for somoe characters that change depends on the matra/vowel (e.g. lx and rx, and -rx) */
Baris 853 ⟶ 857:
}
} else if (core_sound.CoreSound == '
konsonan = "ꦲ"; //ha
} else if (core_sound.CoreSound == '
konsonan = "ꦲ"; //ha
} else if (core_sound.CoreSound == '
konsonan = "ꦉ"; matra = "";//rê
} else if (core_sound.CoreSound == '
konsonan = "ꦫ"; //ra
} else if (core_sound.CoreSound == '
konsonan = "ꦫ"; //ra
} else if (core_sound.CoreSound == '
konsonan = "
} else if (core_sound.CoreSound == '
konsonan = "ꦔ"; //nga
} else {
Baris 928 ⟶ 932:
} else if (!cecakFlag && GetSound(str.substring(pi, i)) == "ꦁ") {
cecakFlag = true;
ret += "
} else {
cecakFlag = false;
Baris 960 ⟶ 964:
} else if (str[i] == '|') {
ret += "꧋"; pi = i + 1;
/* comment out, not really a good way to do brackets
} else if (str[i] == '(') {
ret += "꧌"; pi = i + 1;
} else if (str[i] == ')') {
ret += "꧍"; pi = i + 1;// with zws
*/
} else if (str[i] == '-') {//tanda hubung
ret += ""; pi = i + 1;
|