Skip to content

Commit

Permalink
Merge pull request #5
Browse files Browse the repository at this point in the history
Aldoni skribsistemojn
  • Loading branch information
salif authored Jan 2, 2024
2 parents c7b1581 + f91ddf5 commit ec7715e
Show file tree
Hide file tree
Showing 4 changed files with 166 additions and 80 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Esperanto alphabet converter
# alfabetoj

A tool for transliterating Esperanto text into other alphabets

## Links

* Homepage: [salif.github.io/alfabetoj](https://salif.github.io/alfabetoj/)
* Source code: [github.com/salif/alfabetoj](https://github.com/salif/alfabetoj)
* Source code: [codeberg.org/salif/alfabetoj](https://codeberg.org/salif/alfabetoj)
* Issues (Github): [github.com/salif/alfabetoj/issues](https://github.com/salif/alfabetoj/issues)
* Issues (Codeberg): [codeberg.org/salif/alfabetoj/issues](https://codeberg.org/salif/alfabetoj/issues)
* Discuss (Github): [github.com/salif/alfabetoj/discussions](https://github.com/salif/alfabetoj/discussions)
* Chat (Element/Matrix): [#salif-alfabetoj:mozilla.org](https://matrix.to/#/#salif-alfabetoj:mozilla.org)
* Source code: [Github](https://github.com/salif/alfabetoj), [Codeberg](https://codeberg.org/salif/alfabetoj)
* Issues: [Github](https://github.com/salif/alfabetoj/issues), [Codeberg](https://codeberg.org/salif/alfabetoj/issues)
* Discuss: [Github](https://github.com/salif/alfabetoj/discussions)
* [Matrix Chat](https://matrix.to/#/#salif-alfabetoj:mozilla.org): #salif-alfabetoj:mozilla.org

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Esperanto alphabet converter</title>
<meta name="robots" content="index, follow" />
<meta name="description" content="Esperanto alphabet converter" />
<meta name="description" content="A tool for transliterating Esperanto text into other alphabets" />
<meta name="author" content="Salif Mehmed" />
<link rel="canonical" href="https://salif.github.io/alfabetoj/" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
Expand Down
82 changes: 65 additions & 17 deletions konvertilo.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,54 @@ var konvertilo = {
"u": "უ", "ŭ": "ჳ", "v": "ვ", "z": "ზ"
}
},
armenian: {
to_esperanto: {
"Ա": "A", "Բ": "B", "Ծ": "C", "Ճ": "Ĉ", "Դ": "D", "է": "E",
"Ֆ": "F", "Գ": "G", "Ղ": "Ĝ", "Հ": "H", "Խ": "Ĥ", "Ի": "I",
"Յ": "J", "Ջ": "Ĵ", "Կ": "K", "Լ": "L", "Մ": "M", "Ն": "N",
"Ո": "O", "Պ": "P", "Ր": "R", "Ս": "S", "Շ": "Ŝ", "Տ": "T",
"Ւ": "U", "Ւ": "Ŭ", "Վ": "V", "Զ": "Z",
"ա": "a", "բ": "b", "ծ": "c", "ճ": "ĉ", "դ": "d", "ե": "e",
"ֆ": "f", "գ": "g", "ղ": "ĝ", "հ": "h", "խ": "ĥ", "ի": "i",
"յ": "j", "ջ": "ĵ", "կ": "k", "լ": "l", "մ": "m", "ն": "n",
"ո": "o", "պ": "p", "ր": "r", "ս": "s", "շ": "ŝ", "տ": "t",
"ւ": "u", "ւ": "ŭ", "վ": "v", "զ": "z",
},
from_esperanto: {
"A": "Ա", "B": "Բ", "C": "Ծ", "Ĉ": "Ճ", "D": "Դ", "E": "է",
"F": "Ֆ", "G": "Գ", "Ĝ": "Ղ", "H": "Հ", "Ĥ": "Խ", "I": "Ի",
"J": "Յ", "Ĵ": "Ջ", "K": "Կ", "L": "Լ", "M": "Մ", "N": "Ն",
"O": "Ո", "P": "Պ", "R": "Ր", "S": "Ս", "Ŝ": "Շ", "T": "Տ",
"U": "Ւ", "Ŭ": "Ւ", "V": "Վ", "Z": "Զ",
"a": "ա", "b": "բ", "c": "ծ", "ĉ": "ճ", "d": "դ", "e": "ե",
"f": "ֆ", "g": "գ", "ĝ": "ղ", "h": "հ", "ĥ": "խ", "i": "ի",
"j": "յ", "ĵ": "ջ", "k": "կ", "l": "լ", "m": "մ", "n": "ն",
"o": "ո", "p": "պ", "r": "ր", "s": "ս", "ŝ": "շ", "t": "տ",
"u": "ւ", "ŭ": "ւ", "v": "վ", "z": "զ"
}
},
// hebrew: {
// to_esperanto: {},
// from_esperanto: {}
// },
// greek: {
// to_esperanto: {},
// from_esperanto: {}
// },
korean: {
from_esperanto: {
"A": "ㅏ", "B": "ㅂ", "C": "ㅉ", "Ĉ": "ㅊ", "D": "ㄷ", "E": "ㅔ",
"F": "ㅍ", "G": "ㄱ", "Ĝ": "ㄲ", "H": "ㆆ", "Ĥ": "ㅎ", "I": "ㅣ",
"J": "ㅣ", "Ĵ": "ㅈ", "K": "ㅋ", "L": "ㄹ", "M": "ㅁ", "N": "ㄴ",
"O": "ㅗ", "P": "ㅃ", "R": "ㄹ", "S": "ㅅ", "Ŝ": "ㅆ", "T": "ㅌ",
"U": "ㅜ", "Ŭ": "으", "V": "ㅸ", "Z": "ㅿ",
"a": "ㅏ", "b": "ㅂ", "c": "ㅉ", "ĉ": "ㅊ", "d": "ㄷ", "e": "ㅔ",
"f": "ㅍ", "g": "ㄱ", "ĝ": "ㄲ", "h": "ㆆ", "ĥ": "ㅎ", "i": "ㅣ",
"j": "ㅣ", "ĵ": "ㅈ", "k": "ㅋ", "l": "ㄹ", "m": "ㅁ", "n": "ㄴ",
"o": "ㅗ", "p": "ㅃ", "r": "ㄹ", "s": "ㅅ", "ŝ": "ㅆ", "t": "ㅌ",
"u": "ㅜ", "ŭ": "으", "v": "ㅸ", "z": "ㅿ"
}
},
cyrillic_2: {
to_esperanto: {
"А": "A", "Б": "B", "Ц": "C", "Ч": "Ĉ", "Д": "D", "Е": "E",
Expand Down Expand Up @@ -163,29 +211,29 @@ var konvertilo = {
},
konverti: (function () {

function convert_replacing(input, skribsistemo) {
var output = input
var entries = Object.entries(skribsistemo)
for (var i = 0; i < entries.length; i++) {
var entry = entries[i]
output = output.replaceAll(entry[0], entry[1])
function convert_replacing(str_input, obj_skribsistemo) {
var str_output = str_input
var objs_entries = Object.entries(obj_skribsistemo)
for (var num_i = 0; num_i < objs_entries.length; num_i++) {
var objs_entry = objs_entries[num_i]
str_output = str_output.replaceAll(objs_entry[0], objs_entry[1])
}
return output
return str_output
}
return function (input, skribsistemo, use_replacing) {
if (input.length == 0) {
return function (str_input, obj_skribsistemo, bool_use_replacing) {
if (str_input.length == 0) {
return ""
}
if (use_replacing) {
return convert_replacing(input, skribsistemo)
if (bool_use_replacing) {
return convert_replacing(str_input, obj_skribsistemo)
}
var output = []
for (var i = 0; i < input.length; i++) {
var input_char = input.charAt(i)
var output_char = skribsistemo[input_char]
output.push(output_char != undefined ? output_char : input_char)
var strs_output = []
for (var num_i = 0; num_i < str_input.length; num_i++) {
var str_input_char = str_input.charAt(num_i)
var str_output_char = obj_skribsistemo[str_input_char]
strs_output.push(str_output_char != undefined ? str_output_char : str_input_char)
}
return output.join("")
return strs_output.join("")
}

})()
Expand Down
Loading

0 comments on commit ec7715e

Please sign in to comment.