-
Notifications
You must be signed in to change notification settings - Fork 0
/
entry.pl.html
245 lines (235 loc) · 14.3 KB
/
entry.pl.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="utf-8">
<meta name="vieport" content="">
<title>Hasło | Słownik Języków Zagrożonych Wymarciem</title>
<link rel="stylesheet" href="/Endangered-Languages-Dictionary/styles.css">
<script src="/Endangered-Languages-Dictionary/dictionary.js"></script>
<script src="/Endangered-Languages-Dictionary/langs.js"></script>
<script src="/Endangered-Languages-Dictionary/search.js"></script>
</head>
<body>
<div class="header">
<h1 id="website-header">Słownik Języków Zagrożonych Wymarciem</h1>
<div class="nav">
<nav class="nav-header">
<a href="/Endangered-Languages-Dictionary/index.pl.html">Strona główna</a>
| <a href="/Endangered-Languages-Dictionary/search.pl.html">Wyszukaj</a>
| <a href="/Endangered-Languages-Dictionary/about.pl.html">O stronie</a>
| Wybierz język:
<select name="langs" title="Wybierz język">
<option value="pl">Polski</option>
<option value="en">English</option>
<option value="de">Deutsch</option>
<option value="es">Español</option>
</select>
<button type="submit" id="lang-submit" onclick="changeLang('pl');">Zatwierdź</button>
</nav>
</div>
</div>
<form id="search">
<input type="number" id="query-elasticity" name="elasticity" min="0" max="10" value="2" />
<input type="text" id="query-text" name="text" placeholder="Wpisz szukany tekst" />
<select id="query-dictionary" name="dictionary" title="Wybierz słownik">
<optgroup label="Kaszubski (Kaszëbsczi)">
<option value="pl_csb">Polski - Kaszubski (Kaszëbsczi)</option>
<option value="csb_pl">Kaszubski (Kaszëbsczi) - Polski</option>
</optgroup>
<optgroup label="Dolnołużycki (Dolnoserbski)">
<option value="pl_dsb">Polski - Dolnołużycki (Dolnoserbski)</option>
<option value="dsb_pl">Dolnołużycki (Dolnoserbski) - Polski</option>
</optgroup>
<optgroup label="Górnołużycki (Hornjoserbsce)">
<option value="pl_hsb">Polski - Górnołużycki (Hornjoserbsce) </option>
<option value="hsb_pl">Górnołużycki (Hornjoserbsce) - Polski</option>
</optgroup>
<optgroup label="Wilamowski (Wymysiöeryś)">
<option value="pl_wym">Polski - Wilamowski (Wymysiöeryś)</option>
<option value="wym_pl">Wilamowski (Wymysiöeryś) - Polski</option>
</optgroup>
<optgroup label="Rusiński">
<option value="pl_rue">Polski - Rusiński</option>
<option value="rue_pl">Rusiński - Polski</option>
</optgroup>
<optgroup label="Kashubian (Kaszëbsczi)">
<option value="en_csb">English - Kashubian (Kaszëbsczi)</option>
<option value="csb_en">Kashubian (Kaszëbsczi) - English</option>
</optgroup>
<optgroup label="Lower Sorbian (Dolnoserbski)">
<option value="en_dsb">English - Lower Sorbian (Dolnoserbski)</option>
<option value="dsb_en">Lower Sorbian (Dolnoserbski) - English</option>
</optgroup>
<optgroup label="Upper Sorbian (Hornjoserbsce)">
<option value="en_hsb">English - Upper Sorbian (Hornjoserbsce)</option>
<option value="hsb_en">Upper Sorbian (Hornjoserbsce) - English</option>
</optgroup>
<optgroup label="Vilamovian (Wymysiöryś)">
<option value="en_wym">English - Vilamovian (Wymysiöeryś)</option>
<option value="wym_en">Vilamovian (Wymysiöeryś) - English</option>
</optgroup>
<optgroup label="Rusyn">
<option value="en_rue">English - Rusyn</option>
<option value="rue_en">Rusyn - English</option>
</optgroup>
</select>
<button type="submit" id="query-submit">Wyszukaj</button>
</form>
<strong>Hasło: </strong><br>
<div id="phrase"></div>
<strong>tłumaczenia</strong><br>
<ul id="translations"></ul>
<span id="part-of-speech">Część mowy: <em></em></span><br>
<span id="IPA"><a href="pl.wikipedia.org/wiki/Międzynarodowy_alfabet_fonetyczny">MAF</a>: </span>
<span id="Kirshenbaum"><a href="pl.wikipedia.org/wiki/Kirshenbaum">Kirshenbaum</a>: </span>
<span id="SPA"><a href="pl.wiktionary.org/wiki/Aneks:Język_polski_-_wymowa_-_głoski">AS</a>: </span>
<span id="UPA"><a href="en.wikipedia.org/wiki/Uralic_Phonetic_Alphabet">UPA</a>: </span>
<hr>
<strong>antonimy</strong><br>
<span id="antonyms"></span><br>
<strong>hiponimy</strong><br>
<span id="hyponyms"></span><br>
<strong>hiperonimy</strong><br>
<span id="hyperonyms"></span><br>
<strong>frazy powiązane</strong><br>
<span id="related"></span>
<hr>
<strong>Przykładowe zdania:</strong><br>
<ul id="sentences"></ul>
<span id="lackof-sentences">brak</span>
<script>
const URLQuery = new URLSearchParams(window.location.search);
console.log(URLQuery);
if(URLQuery.has("elasticity")) {
window.location.replace("https://ankiedos.github.io/Endangered-Languages-Dictionary/search.pl.html?elasticity=" + URLQuery.get("elasticity") + "&text=" + URLQuery.get("text") + "&dictionary=" + URLQuery.get("dictionary"));
}
else {
var phrase = URLQuery.get("q");
var dict = URLQuery.get("dict");
var entry = dictionaries[dict].find(obj => obj.phrase == phrase);
console.log(entry);
// phrase
var phraseDiv = document.querySelector("#phrase");
phraseDiv.appendChild(document.createTextNode(phrase));
// IPA
var IPASpan = document.querySelector("#IPA");
IPASpan.appendChild(document.createTextNode(entry.pronounciation.IPA));
// SPA
var SPASpan = document.querySelector("#SPA");
if(entry.pronounciation.SPA.length == 0) {
SPASpan.removeChild(SPASpan.lastChild);
SPASpan.removeChild(SPASpan.lastChild);
}
else SPASpan.appendChild(document.createTextNode(entry.pronounciation.SPA));
// UPA
var UPASpan = document.querySelector("#UPA");
if(entry.pronounciation.UPA.length == 0) {
UPASpan.removeChild(UPASpan.lastChild);
UPASpan.removeChild(UPASpan.lastChild);
}
else UPASpan.appendChild(document.createTextNode(entry.pronounciation.UPA));
// Kirshenbaum
var KirshenbaumSpan = document.querySelector("#Kirshenbaum");
KirshenbaumSpan.appendChild(document.createTextNode(entry.pronounciation.Kirshenbaum));
// translations
var translationsList = document.querySelector("#translations");
for(var trans = 0; trans < entry.translations.length; trans++) {
var li = document.createElement("li");
var a = document.createElement("a");
a.href = "/Endangered-Languages-Dictionary/entry.pl.html?q=" + entry.translations[trans] + "&dict=" + reverseDict(dict);
a.appendChild(document.createTextNode(entry.translations[trans]));
li.appendChild(a);
translationsList.appendChild(li);
}
var antonymsSpan = document.querySelector("#antonyms");
var hyponymsSpan = document.querySelector("#hyponyms");
var hyperonymsSpan = document.querySelector("#hyperonyms");
if(entry.pos[0] == "S") { // 'S' like 'substance' (a noun or an adjective)
// antonyms
if(entry.antonyms.length > 0) {
for(var ant = 0; ant < entry.antonyms.length - 1; ant++) {
var a = document.createElement("a");
a.href = "/Endangered-Languages-Dictionary/entry.pl.html?q=" + entry.antonyms[ant] + "&dict=" + dict;
a.appendChild(document.createTextNode(entry.antonyms[ant]));
antonymsSpan.appendChild(a);
antonymsSpan.appendChild(document.createTextNode(", "));
}
var a = document.createElement("a");
a.href = "/Endangered-Languages-Dictionary/entry.pl.html?q=" + entry.antonyms[entry.antonyms.length - 1] + "&dict=" + dict;
a.appendChild(document.createTextNode(entry.antonyms[entry.antonyms.length - 1]));
antonymsSpan.appendChild(a);
}
else antonymsSpan.appendChild(document.createTextNode("brak"));
// hyponyms
if(entry.hyponyms.length > 0) {
for(var hyp = 0; hyp < entry.hyponyms.length - 1; hyp++) {
var a = document.createElement("a");
a.href = "/Endangered-Languages-Dictionary/entry.pl.html?q=" + entry.hyponyms[hyp] + "&dict=" + dict;
a.appendChild(document.createTextNode(entry.hyponyms[hyp]));
hyponymsSpan.appendChild(a);
hyponymsSpan.appendChild(document.createTextNode(", "));
}
var a = document.createElement("a");
a.href = "/Endangered-Languages-Dictionary/entry.pl.html?q=" + entry.hyponyms[entry.hyponyms.length - 1] + "&dict=" + dict;
a.appendChild(document.createTextNode(entry.hyponyms[entry.hyponyms.length - 1]));
hyponymsSpan.appendChild(a);
}
else hyponymsSpan.appendChild(document.createTextNode("brak"));
// hyperonyms
if(entry.hyperonyms.length > 0) {
for(var hyper = 0; hyper < entry.hyperonyms.length - 1; hyper++) {
var a = document.createElement("a");
a.href = "/Endangered-Languages-Dictionary/entry.pl.html?q=" + entry.hyperonyms[hyper] + "&dict=" + dict;
a.appendChild(document.createTextNode(entry.hyperonyms[hyper]));
hyperonymsSpan.appendChild(a);
hyperonymsSpan.appendChild(document.createTextNode(", "));
}
var a = document.createElement("a");
a.href = "/Endangered-Languages-Dictionary/entry.pl.html?q=" + entry.hyperonyms[entry.hyperonyms.length - 1] + "&dict=" + dict;
a.appendChild(document.createTextNode(entry.hyperonyms[entry.hyperonyms.length - 1]));
hyperonymsSpan.appendChild(a);
}
else hyperonymsSpan.appendChild(document.createTextNode("brak"));
}
else {
antonymsSpan.appendChild(document.createTextNode("brak"));
hyponymsSpan.appendChild(document.createTextNode("brak"));
hyperonymsSpan.appendChild(document.createTextNode("brak"));
}
// related
var relatedSpan = document.querySelector("#related");
if(entry.related.length > 0) {
for(var rel = 0; rel < entry.related.length - 1; rel++) {
var a = document.createElement("a");
a.href = "/Endangered-Languages-Dictionary/entry.pl.html?q=" + entry.related[rel] + "&dict=" + dict;
a.appendChild(document.createTextNode(entry.related[rel]));
relatedSpan.appendChild(a);
relatedSpan.appendChild(document.createTextNode(", "));
}
var a = document.createElement("a");
a.href = "/Endangered-Languages-Dictionary/entry.pl.html?q=" + entry.related[entry.related.length - 1] + "&dict=" + dict;
a.appendChild(document.createTextNode(entry.related[entry.related.length - 1]));
relatedSpan.appendChild(a);
}
else relatedSpan.appendChild(document.createTextNode("brak"));
// Part of Speech
var posSpan = document.querySelector("#part-of-speech").querySelector("em");
for(var i = 0; i < entry.pos.length; i++) {
posSpan.appendChild(document.createTextNode(translatePOS(entry.pos[i][0] == 'S' ? entry.pos[i].substring(1) : entry.pos[i], "pl")));
}
// example sentences
var sentencesList = document.querySelector("#sentences");
if(entry.sentences.length > 0 && entry.sentences[0] != "") {
for(var sent = 0; sent < entry.sentences.length; sent++) {
var li = document.createElement("li");
li.appendChild(document.createTextNode(entry.sentences[sent]));
sentencesList.appendChild(li);
}
var sent_lack = document.querySelector("#lackof-sentences");
sent_lack.remove();
}
//else sentencesList.appendChild(document.createElement("li").appendChild(document.createTextNode("brak")));
}
</script>
</body>
</html>