-
Notifications
You must be signed in to change notification settings - Fork 0
/
AishaqAndTraining.html
271 lines (243 loc) · 9.12 KB
/
AishaqAndTraining.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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<!DOCTYPE html>
<html>
<!--
2022-05-29T14:35:00 Created.
2022-05-29T18:15:00 http://www.jqwidgets.com/community/topic/jqxgrid-delete-selected-rows-with-php-pdomysql/
2022-05-29T18:15:00 http://www.jqwidgets.com/community/topic/add-new-row-and-edit-jqxgrid/
2022-05-29T19:58:00 English language Isaac. Yoruba language Aishaq.
2022-05-29T19:58:00 English language Isaac. Yoruba language Isaaki.
2022-05-29T22:55:00 http://stackoverflow.com/questions/1723287/calling-a-javascript-function-named-in-a-variable
2022-05-29T23:08:00 http://en.wikipedia.org/wiki/Yoruba_language
2022-05-29T23:08:00 http://en.wikipedia.org/wiki/Calque
2022-05-29T23:08:00 http://en.wikipedia.org/wiki/Ajami_script
2022-05-30T08:20:00 I saw Lisa Hough coming out of her garage. I saw Kim Chan running. Data-Driven.
2023-03-21T22:27:00 http://github.s3.amazonaws.com/downloads/diveintomark/diveintopython3/dive-into-python3.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA5BA2674WEWV2CIOD%2F20230318%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230318T020658Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=efc66dc348eee2db537cd2064f19552950b3c37fd30b1b20b97e94ad20e7220c
The people of
Bougainville have the smallest alphabet in the world;
their Rotokas alphabet is composed of only 12 letters:
A, E, G, I, K, O, P, R, S, T, U, and V. O
2023-03-21T22:27:00 http://en.wikipedia.org/wiki/Rotokas_alphabet
-->
<head>
<title>Aishaq and training.</title>
<meta charset="UTF-8"/>
<meta name="description" content="Aishaq and training."/>
<meta name="keyword" content="Isaac, language, AlphabetSequence"/>
<meta name="robots" content="index, follow"/>
<meta name="author" content="Ken Adeniji"/>
<link rel="stylesheet" type="text/css" href="/WordEngineering/WordUnion/9432.css">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/jqwidgets/12.2.1/jqwidgets/styles/jqx.base.css" type="text/css" />
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jqwidgets/12.2.1/jqwidgets/jqx-all.min.js"></script>
</head>
<body>
<div align="center">
<table>
<tr>
<td><label for="defaultLanguage">Default Language</label></td>
<td><input id="defaultLanguage" type="text" autofocus/></td>
</tr>
<tr><td colspan="2" align="center"><input type="submit" id="submitQuery"/></td></tr>
<tr>
<td><label for="alphabetSequenceIndexAll">AlphabetSequenceIndex</label></td>
<td><label id="alphabetSequenceIndexAll"></label></td>
</tr>
</table>
<div id="resultSet"></div>
<div class="default">
<div id="jqxWidget" style="font-size: 13px; font-family: Verdana;">
<div id="jqxgridAlphabetSequence"></div>
</div>
</div>
</div>
<script>
var isPostBack = false;
const alphabetSequenceIndexAllElement = document.getElementById("alphabetSequenceIndexAll");
const defaultLanguageElement = document.getElementById("defaultLanguage");
const jqxgridAlphabetSequenceElement = document.getElementById("jqxgridAlphabetSequence");
const submitQueryElement = document.getElementById("submitQuery");
const resultSetElement = document.getElementById("resultSet");
function dataDriven(word, language)
{
word = word.toUpperCase();
var languageCurrent = -1;
for
(
var languageIndex = 0, languageLength = DataDriven.length / 2;
languageIndex <= languageLength;
++languageIndex
)
{
if ( DataDriven[languageIndex][0] === language )
{
languageCurrent = languageIndex;
break;
}
}
if ( languageCurrent === -1 )
{
return 0;
}
for
(
var index = 0, length = word.length, currentCode, alphabetSequence = 0, alphabetPosition;
index < length;
++index
)
{
currentCode = word[index];
for
(
var alphabetIndex = 1, alphabetLength = DataDriven[languageCurrent].length;
alphabetIndex < alphabetLength;
++alphabetIndex
)
{
alphabetPosition = DataDriven[languageCurrent][alphabetIndex].indexOf(currentCode);
if ( alphabetPosition > -1 )
{
alphabetSequence += alphabetIndex;
break;
}
}
}
return alphabetSequence;
}
function pageLoad()
{
if (isPostBack === false)
{
defaultLanguageElement.value = DefaultLanguage;
prepareTheData();
querySubmit();
isPostBack = true;
}
else
{
querySubmit();
}
}
function querySubmit()
{
var alphabetSequenceIndexWord = 0;
var alphabetSequenceIndexWords = 0;
var alphabetSequenceIndexLanguage;
var notANumber = 0;
var griddata = $("#jqxgridAlphabetSequence").jqxGrid("getdatainformation");
var rows = [];
var rowSet;
var word;
var language;
for (var rowIndex = 0; rowIndex < griddata.rowscount; rowIndex++)
{
rowSet = $("#jqxgridAlphabetSequence").jqxGrid("getrenderedrowdata", rowIndex);
word = rowSet["word"];
language = rowSet["language"];
notANumber = isNaN(word);
if (!notANumber)
{
alphabetSequenceIndexWord = Number.parseInt(word)
}
else
{
if (!language)
{
language = defaultLanguageElement.value;
}
language = language[0].toUpperCase() + language.substring(1).toLowerCase();
alphabetSequenceIndexWord = dataDriven(word, language);
}
$("#jqxgridAlphabetSequence").jqxGrid("setcellvalue", rowIndex, "alphabetSequenceIndex", alphabetSequenceIndexWord);
alphabetSequenceIndexWords += alphabetSequenceIndexWord;
}
alphabetSequenceIndexAllElement.textContent = alphabetSequenceIndexWords;
}
function prepareTheData()
{
var data = new Array();
for
(
var wordIndex = 0, wordLength = DefaultWords.length;
wordIndex < wordLength;
wordIndex++
)
{
var row = {};
row["word"] = DefaultWords[wordIndex][0];
row["language"] = DefaultWords[wordIndex][1] ? DefaultWords[wordIndex][1] : "";
row["alphabetSequenceIndex"] = 0;
data[wordIndex] = row;
}
var source =
{
localdata: data,
datatype: "array"
};
var dataAdapter = new $.jqx.dataAdapter(source, {
loadComplete: function (data) { },
loadError: function (xhr, status, error) { }
});
$("#jqxgridAlphabetSequence").jqxGrid
(
{
source: dataAdapter,
editable: true,
columns: [
{ text: "Word", datafield: "word", width: 200 },
{ text: "Language", datafield: "language", width: 200 },
{ text: "AlphabetSequenceIndex", datafield: "alphabetSequenceIndex", width: 200, cellsalign: "right", editable: false },
],
showstatusbar: true,
renderstatusbar: function (statusbar)
{
// appends buttons to the status bar.
var container = $("<div style='overflow: hidden; position: relative; margin: 5px;'></div>");
var addButton = $("<div style='float: left; margin-left: 5px;'><img style='position: relative; margin-top: 2px;' src='images/add.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Add</span></div>");
var deleteButton = $("<div style='float: left; margin-left: 5px;'><img style='position: relative; margin-top: 2px;' src='images/close.png'/><span style='margin-left: 4px; position: relative; top: -3px;'>Delete</span></div>"); container.append(addButton);
container.append(deleteButton);
statusbar.append(container);
addButton.jqxButton({ width: 60, height: 20 });
deleteButton.jqxButton({ width: 85, height: 20 });
// add new row.
addButton.click(function (event) {
$("#jqxgridAlphabetSequence").jqxGrid("addrow", null, {});
});
// delete selected row.
deleteButton.click(function (event) {
var selectedrowindex = $("#jqxgridAlphabetSequence").jqxGrid("getselectedrowindex");
var rowscount = $("#jqxgridAlphabetSequence").jqxGrid("getdatainformation").rowscount;
var id = $("#jqxgridAlphabetSequence").jqxGrid("getrowid", selectedrowindex);
$("#jqxgridAlphabetSequence").jqxGrid("deleterow", id);
});
}
}
)
}
submitQueryElement.addEventListener("click", querySubmit, false);
var body = document.getElementsByTagName("body")[0];
body.onkeydown = function (e) {
if (e.keyCode === 13) { //enter key code
querySubmit();
}
}
window.addEventListener("load", pageLoad, false);
DefaultLanguage = "English";
DefaultWords =
[
[
"Aishaq",
//"Arabic"
"English"
],
["and", null],
["training", null]
];
DataDriven =
[
["English", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"],
["Rotokas", "A", "E", "G", "I", "K", "O", "P", "R", "S", "T", "U", "V"],
["Yoruba", "AÁÀĀ", "B", "D", "EÉÈĒ", "ẸẸ́ ̀̀ ẸẸ̄", "F", "G", "Gb", "H", "IÍÌĪ", "J", "K", "L", "MḾM̀ M̄", "NŃǸN̄", "OÓÒŌ", "ỌỌ́Ọ̀Ọ̄", "P", "R", "S", "Ṣ", "T", "UÚÙŪ", "W", "Y"]
];
</script>
</body>
</html>