Skip to content

Commit

Permalink
Devanagari Transliterate
Browse files Browse the repository at this point in the history
  • Loading branch information
Vyshantha committed Aug 29, 2023
1 parent 656fcc2 commit 66b7dd3
Showing 1 changed file with 122 additions and 2 deletions.
124 changes: 122 additions & 2 deletions transliterate.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,36 @@ function transliterate() {
ē̃: "ेँ",
õ: "ॊँ",
ō̃: "ोँ",
"āṁ":"ां",
"iṁ":"िं",
"īṁ":"ीं",
"uṁ":"ुं",
"ūṁ":"ूं",
"r̥ṁ":"ृं",
"r̥̄ṁ":"ॄं",
"l̥ṁ":"ॢं",
"l̥̄ṁ":"ॣं",
"eṁ":"ॆं",
"ēṁ":"ें",
"aiṁ":"ैं",
"oṁ":"ॊं",
"ōṁ":"ों",
"auṁ":"ौं",
"Āṁ":"ां",
"Iṁ":"िं",
"Īṁ":"ीं",
"Uṁ":"ुं",
"Ūṁ":"ूं",
"R̥ṁ":"ृं",
"Ṝṁ":"ॄं",
"L̥ṁ":"ॢं",
"L̥̄ṁ":"ॣं",
"Eṁ":"ॆं",
"Ēṁ":"ें",
"Aiṁ":"ैं",
"Oṁ":"ॊं",
"Ōṁ":"ों",
"Auṁ":"ौं"
};

if (localStorage.getItem("strict") == "false") {
Expand Down Expand Up @@ -506,6 +536,36 @@ function transliterate() {
ē̃: "ेँ",
õ: "ॊँ",
ō̃: "ोँ",
"āṁ":"ां",
"iṁ":"िं",
"īṁ":"ीं",
"uṁ":"ुं",
"ūṁ":"ूं",
"r̥ṁ":"ृं",
"r̥̄ṁ":"ॄं",
"l̥ṁ":"ॢं",
"l̥̄ṁ":"ॣं",
"eṁ":"ॆं",
"ēṁ":"ें",
"aiṁ":"ैं",
"oṁ":"ॊं",
"ōṁ":"ों",
"auṁ":"ौं",
"Āṁ":"ां",
"Iṁ":"िं",
"Īṁ":"ीं",
"Uṁ":"ुं",
"Ūṁ":"ूं",
"R̥ṁ":"ृं",
"Ṝṁ":"ॄं",
"L̥ṁ":"ॢं",
"L̥̄ṁ":"ॣं",
"Eṁ":"ॆं",
"Ēṁ":"ें",
"Aiṁ":"ैं",
"Oṁ":"ॊं",
"Ōṁ":"ों",
"Auṁ":"ौं"
};

if (localStorage.getItem("strict") == "false") {
Expand Down Expand Up @@ -832,6 +892,36 @@ function transliterate() {
Aṁ: "ं",
Aḥ: "ः",
: "ँ",
"āṁ":"ां",
"iṁ":"िं",
"īṁ":"ीं",
"uṁ":"ुं",
"ūṁ":"ूं",
"r̥ṁ":"ृं",
"r̥̄ṁ":"ॄं",
"l̥ṁ":"ॢं",
"l̥̄ṁ":"ॣं",
"eṁ":"ॆं",
"ēṁ":"ें",
"aiṁ":"ैं",
"oṁ":"ॊं",
"ōṁ":"ों",
"auṁ":"ौं",
"Āṁ":"ां",
"Iṁ":"िं",
"Īṁ":"ीं",
"Uṁ":"ुं",
"Ūṁ":"ूं",
"R̥ṁ":"ृं",
"Ṝṁ":"ॄं",
"L̥ṁ":"ॢं",
"L̥̄ṁ":"ॣं",
"Eṁ":"ॆं",
"Ēṁ":"ें",
"Aiṁ":"ैं",
"Oṁ":"ॊं",
"Ōṁ":"ों",
"Auṁ":"ौं"
};

if (localStorage.getItem("strict") == "false") {
Expand Down Expand Up @@ -1162,6 +1252,36 @@ function transliterate() {
Aṁ: "ं",
Aḥ: "ः",
: "ँ",
"āṁ":"ां",
"iṁ":"िं",
"īṁ":"ीं",
"uṁ":"ुं",
"ūṁ":"ूं",
"r̥ṁ":"ृं",
"r̥̄ṁ":"ॄं",
"l̥ṁ":"ॢं",
"l̥̄ṁ":"ॣं",
"eṁ":"ॆं",
"ēṁ":"ें",
"aiṁ":"ैं",
"oṁ":"ॊं",
"ōṁ":"ों",
"auṁ":"ौं",
"Āṁ":"ां",
"Iṁ":"िं",
"Īṁ":"ीं",
"Uṁ":"ुं",
"Ūṁ":"ूं",
"R̥ṁ":"ृं",
"Ṝṁ":"ॄं",
"L̥ṁ":"ॢं",
"L̥̄ṁ":"ॣं",
"Eṁ":"ॆं",
"Ēṁ":"ें",
"Aiṁ":"ैं",
"Oṁ":"ॊं",
"Ōṁ":"ों",
"Auṁ":"ौं"
};

if (localStorage.getItem("strict") == "false") {
Expand Down Expand Up @@ -1268,11 +1388,11 @@ function transliterate() {
) {
// Standalone 3-character Vowel
resultSa =
resultSa.slice(0, -1) +
resultSa.slice(0, -2) +
latinToDevanagari[textLa[u - 2] + textLa[u - 1] + textLa[u]];
} else {
resultSa =
resultSa.slice(0, -1) +
resultSa.slice(0, -2) +
diacritics[textLa[u - 2] + textLa[u - 1] + textLa[u]];
}
} else if (
Expand Down

0 comments on commit 66b7dd3

Please sign in to comment.