Skip to content

Commit

Permalink
Book Pahlavi
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyshantha committed Jul 9, 2024
1 parent fa4eac6 commit 5c51631
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions transliterate.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,17 +237,21 @@ function transliterate() {
*/
// Word End Marker ˈ
let resultBookPahlavi = "";
let textLa = (document.getElementById("textarea1").value != "") ? document.getElementById("textarea1").value : document.getElementById("textarea2").placeholder;
let textLa = document.getElementById("textarea1").value;
const latinToBookPahlavi = {"ʾ":"!","h":"!","<ʾ":"#","<h":"#","ʾ>":"$","h>":"$","<ʾ>":"%","<h>":"%","b":"*","_b":")","z":";","<z":":","l":"@","<l":"A","ł":"D","<ł":"C","łł":"b","Ļ":"F","k":"=","˜k":">","γ":"?","Ḥ":"L","Ḥ>":"M","p":"O","c":"c"," c ":"P","c>":"N","s2":"3","<s2":"j","š":"Q","<š":"R","t>":"T","t":"S","yk":"6","_yk":"p","x":"r","ḆYN":"U","χ":"V","åø":"W","":".","f":"\n","_":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":"","":""};

let lines = textLa.split("\n");
for (let i = 0; i < lines.length; i++) {
//resultBookPahlavi = resultBookPahlavi + lines[i].split("").reverse().join("") + "\n";
if (textLa[i].indexOf("\n") > -1) { // New Lines
if (textLa[i] && textLa[i].indexOf("\n") > -1) { // New Lines
resultBookPahlavi = resultBookPahlavi + "\n";
} else {
resultBookPahlavi = resultBookPahlavi + latinToBookPahlavi[textLa[i]];
}
}
if (resultBookPahlavi.indexOf("undefined") > -1) {
resultBookPahlavi = resultBookPahlavi.replaceAll("undefined","");
}
document.getElementById("textarea2").value = resultBookPahlavi;
document.getElementById("textarea2").innerHTML = resultBookPahlavi;
} else if (localStorage.getItem("direction") == null || localStorage.getItem("direction") == undefined || localStorage.getItem("direction") == "latin2avestan") {
Expand Down

0 comments on commit 5c51631

Please sign in to comment.