-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkumyk.html
169 lines (163 loc) · 5.04 KB
/
kumyk.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<html>
<head>
<title>Kumyk Text Converter</title>
<style>
body{
background-color: lightblue;
}
h1,h2{
text-align: center;
}
textarea{
margin-left: 5%;
margin-right: 5%;
width: 39%;
font-size: 24px;
height: 600px;
resize: none;
border-radius: 4px;
background-color: lightblue;
border: 5px solid black;
outline: none;
}
textarea::placeholder{
color: black;
}
*{
font-family: 'Verdana';
}
p{
padding-left: 20%;
padding-right: 20%;
}
#section div{
float: left;
border: 1px solid black;
border-radius: 2px;
margin: 3px;
padding: 3px;
font-size: 24px;
}
</style>
</head>
<body>
<h1>Kumyk Transliterator</h1>
<p>The goal of this website is to allow users to convert text between the Cyrillic and Latin alphabets of the Kumyk language. Hopefully this will allow for a greater exchange of communication and literature.</p>
<textarea id="cyrillic" placeholder="Write something in Qumuq here :)"></textarea>
<textarea direction="rtl" id="latin" placeholder="Or write something in Къумукъ here :)"></textarea>
<h1>Conversion Chart</h1>
<div id="section">
<div>a / а</div>
<div>b / б</div>
<div>c / дж</div>
<div>ç / ч</div>
<div>d / д</div>
<div>e / э </div>
<div>f / ф</div>
<div>g / г</div>
<div>ğ / гъ</div>
<div>h / гь</div>
<div>ı / ы</div>
<div>i / и</div>
<div>j / ж</div>
<div>k / к</div>
<div>l / л</div>
<div>m / м</div>
<div>n / н</div>
<div>ñ / нг</div>
<div>o / о</div>
<div>ö / оь</div>
<div>p / п</div>
<div>q / къ</div>
<div>r / р</div>
<div>s / с</div>
<div>ş / ш</div>
<div>şç / щ</div>
<div>t / т</div>
<div>ts / ц</div>
<div>u / у</div>
<div>ü / уь</div>
<div>v / в</div>
<div>w / у (after vowel)</div>
<div>x / х</div>
<div>y / й</div>
<div>ya / я</div>
<div>ye / е</div>
<div>yo / ё</div>
<div>yu / ю</div>
<div>z / з</div>
</div>
</body>
<script>
var typingTimer
var doneTypingInterval = 1000
var $cyrillic = document.getElementById("cyrillic")
var $latin = document.getElementById("latin")
$cyrillic.addEventListener('keyup', cyrillicFunction);
$latin.addEventListener('keyup', latinFunction);
function cyrillicFunction () {
cyrillic = $cyrillic.value
for(e of Object.keys(cyrillicKey)){
var myRegExp = new RegExp(e, 'g')
cyrillic = cyrillic.replace(myRegExp, cyrillicKey[e])
}
$latin.value = cyrillic
}
function latinFunction () {
latinText = $latin.value
for(e of Object.keys(latinKey)){
var myRegExp = new RegExp(e, 'g')
latinText = latinText.replace(myRegExp, latinKey[e])
}
$cyrillic.value = latinText
}
cyrillicKey = {
" е": " ye",
" э": " e",
"еу": "ew",
"дж": "c",
"къ": "q",
"уу": "uw",
"гъ": "ğ",
"я": "ya",
"нг": "ñ",
"гь": "h",
"ц": "ts",
"ё": "yo",
"ю": "yu",
"а": "a",
"б": "b",
"в": "v",
"ч": "ç",
"ж": "j",
"д": "d",
"ф": "f",
"г": "g",
"и": "i",
"й": "y",
"к": "k",
"л": "l",
"м": "m",
"н": "n",
"о": "o",
"п": "p",
"р": "r",
"с": "s",
"ш": "ş",
"щ": "şç",
"т": "t",
"у": "u",
"х": "x",
"з": "z",
"ы": "ı",
}
for(n of Object.keys(cyrillicKey)){
cyrillicKey[n[0].toUpperCase() + n.slice(1)] = cyrillicKey[n][0].toUpperCase() + cyrillicKey[n].slice(1)
}
console.log(cyrillicKey)
cyrillicKey["И"] = "İ"
cyrillicKey[" Э"] = " E"
const reverse = object => JSON.parse(`{${Object.entries(object).map(x => `"${x[1]}": "${x[0]}"`).join(",")}}`);
latinKey = reverse(cyrillicKey)
</script>
</html>