-
Notifications
You must be signed in to change notification settings - Fork 0
/
grammaranalysis.html
372 lines (312 loc) · 13.8 KB
/
grammaranalysis.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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Than Lwin Aung</title>
<link rel="stylesheet" href="./Content/font-awesome.min.css" />
<link rel="stylesheet" href="./Content/custom.css" />
<link rel="stylesheet" href="./Content/material-icons.css" type='text/css' media='all' />
<link href="./Content/style.css" rel="stylesheet" />
<link href="./Content/chosen.css" rel="stylesheet" />
<link href="./Content/railroad-diagrams.css" rel="stylesheet" />
<link href="./Content/jquery.webui-popover.css" rel="stylesheet" />
<script type='text/javascript' src="./Scripts/modernizr-2.6.2.js"></script>
<script type='text/javascript' src="./Scripts/jquery-1.10.2.js"></script>
<script type='text/javascript' src="./Scripts/bootstrap.js"></script>
<script type='text/javascript' src="./Scripts/railroad-diagrams.js"></script>
<script type='text/javascript' src="./Scripts/jquery.change.type.js"></script>
<script type='text/javascript' src="./Scripts/underscore.js"></script>
<script src="./Scripts/jquery.webui-popover.js"></script>
<script src="./Scripts/chosen.jquery.js"></script>
</head>
<body>
<header class="noo-header" id="noo-header">
<div class="navbar-wrapper">
<div class="navbar navbar-default fixed-top shrinkable">
<div class="container-boxed max">
<div class="navbar-header">
<h1 class="sr-only">Research Areas</h1>
<a class="navbar-toggle main-toggle collapsed" style="height:auto; line-height:50px;" title="Main Menu" data-toggle="collapse" data-target=".noo-navbar-collapse">
<span class="sr-only">Navigation</span>
<i style="font-size:20px;" class="fa fa-bars"></i>
</a>
</div>
<nav class="collapse navbar-collapse noo-navbar-collapse">
<ul class="navbar-nav sf-menu">
<li class="current-menu-item align-left">
<a href="./index.html">Home</a>
</li>
<li class="align-left">
<a href="./about.html">About Me</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</header>
<div id="main-body" class="container body-content">
<div class="container-wrap">
<div class="main-content offset" style="padding-top:20px !important;">
<br />
<br />
<div class="row box-3">
<div class="col-md-12">
<div>
<h3>Synatatic and Semantic Analysis of Language</h3>
<hr>
<p>
Actually, analysis of a Langauge consists of three primary aspects: words, structures and meanings. The syntatics defines the relationship between words and structures, while the semantics defines the relationships between syntax and meangings. Therefore, any spelling and grammar checking involves three aspects as well. It is to check the correctness of words, the correctness of structural relationships and finally the correctness of meanings.
</p>
<p>
"Colorless green ideas sleep furioulsy". Noam Chomsky once said it to point out that a sentence can be syntatically correct but semantically wrong.
</p>
<p>
In English, fortunately, words have clear word-boundaries which are seperated by "Space". Therefore, each individual word can be checked against a dictionary, and so, spelling check is pretty much a trivial task for most cases. However, in Myanmar (မြန်မာ), it is not the case; words are not seperated by a Space, and words have no clear word-boundry, which makes spelling checking a bit challenging.
</p>
<p>
"It is an apple." Words are seperated by Space. "ဒါသည်ပန်းသီးဖြစ်ပါသည်။" Words are not necessarily seperated by Space.
</p>
<p>
In English, sentences are formed with Subject + Verb + Object, and therefore, the positions of Subject, Verb and Object are important. However, it is not the case with Myanmar (မြန်မာ). The positions of the phrases are not very important as long as a sentence is ended with a Verb.
</p>
<p>
However, in any language, it is common that the closer the positions of words, the stronger the relationship between them. Actually, it is one of the reasons why "Attention Mechanism" works in Language Model.
</p>
<p>
Therefore, it is assumed that the adjacency relationship between words could be analzyed to check the structures of words. Based on that assumption, Grammar is analzyed based on Adjacency Relationship.
</p>
<img src="https://2kha.github.io/Images/dependency.png" style="width:70%; height:auto; display:inline-block; margin-top:-10px;" />
</div>
</div>
</div>
<br />
<br />
<div class="row box-3">
<div class="col-md-12">
<div>
<h3>Dependency Tree</h3>
<hr>
<p>
In any language, a dependency tree can define the adjacency relationship between words.
</p>
<img src="https://2kha.github.io/Images/dependenttree.png" style="width:70%; height:auto; display:inline-block; margin-top:-10px;" />
</div>
</div>
</div>
<br />
<div class="row box-3">
<div class="col-md-12">
<div>
<strong>Original Myanmar Text</strong>
<hr>
<p>
မောင်မောင်ကခွေးကိုတုတ်နှင့်ရိုက်သည်။
</p>
<hr>
<p>
There are no word-boundaries in the original sentence. However, Word Class Analysis can detect word-boundaries as well as Word Classes.
</p>
</div>
</div>
</div>
<div class="row box-3">
<div class="col-md-12">
<span class="label label-default" title="Noun" style="margin:3px; font-size:12px;font-weight:100;display:inline-block; color:#c78000;">
မောင်မောင်က
</span>
<span class="label label-default" title="Noun" style="margin:3px; font-size:12px;font-weight:100;display:inline-block; color:#c78000;">
ခွေးကို
</span>
<span class="label label-default" title="Noun" style="margin:3px; font-size:12px;font-weight:100;display:inline-block; color:#c78000;">
တုတ်
</span>
<span class="label label-default" title="Prepositional" style="margin:3px; font-size:12px;font-weight:100;display:inline-block; color:#960037;">
နှင့်
</span>
<span class="label label-default" title="Verb" style="margin:3px; font-size:12px;font-weight:100;display:inline-block; color:#0252b4;">
ရိုက်သည်
</span>
<span class="label label-default" title="Terminal" style="margin:3px; font-size:12px;font-weight:100;display:inline-block; color:#000;">
။
</span>
</div>
</div>
<div class="row box-3" style="overflow:auto;">
<div class="col-md-12">
<div>
<svg class="railroad-diagram" width="394.5" height="122" viewBox="0 0 394.5 122"><g transform="translate(.5 .5)"><g><path d="M20 21v20m0 -10h20"></path></g><g><path d="M40 31h0"></path><path d="M354.5 31h0"></path><path d="M40 31h20"></path><g><path d="M60 31h0"></path><path d="M334.5 31h0"></path><g class="terminal"><path d="M60 31h0"></path><path d="M148 31h0"></path><rect x="60" y="20" width="88" height="22" rx="10" ry="10"></rect><text x="104" y="35">ရိုက်သည်</text></g><path d="M148 31h10"></path><g><path d="M158 31h0"></path><path d="M334.5 31h0"></path><path d="M158 31h20"></path><g><path d="M178 31h0"></path><path d="M314.5 31h0"></path><g class="terminal"><path d="M178 31h0"></path><path d="M240.5 31h0"></path><rect x="178" y="20" width="62.5" height="22" rx="10" ry="10"></rect><text x="209.25" y="35">နှင့်</text></g><path d="M240.5 31h10"></path><path d="M250.5 31h10"></path><g><path d="M260.5 31h0"></path><path d="M314.5 31h0"></path><g class="terminal"><path d="M260.5 31h0"></path><path d="M314.5 31h0"></path><rect x="260.5" y="20" width="54" height="22" rx="10" ry="10"></rect><text x="287.5" y="35">တုတ်</text></g></g></g><path d="M314.5 31h20"></path><path d="M158 31a10 10 0 0 1 10 10v10a10 10 0 0 0 10 10"></path><g><path d="M178 61h28.5"></path><path d="M286 61h28.5"></path><g class="terminal"><path d="M206.5 61h0"></path><path d="M286 61h0"></path><rect x="206.5" y="50" width="79.5" height="22" rx="10" ry="10"></rect><text x="246.25" y="65">ခွေးကို</text></g></g><path d="M314.5 61a10 10 0 0 0 10 -10v-10a10 10 0 0 1 10 -10"></path><path d="M158 31a10 10 0 0 1 10 10v40a10 10 0 0 0 10 10"></path><g><path d="M178 91h11.5"></path><path d="M303 91h11.5"></path><g class="terminal"><path d="M189.5 91h0"></path><path d="M303 91h0"></path><rect x="189.5" y="80" width="113.5" height="22" rx="10" ry="10"></rect><text x="246.25" y="95">မောင်မောင်က</text></g></g><path d="M314.5 91a10 10 0 0 0 10 -10v-40a10 10 0 0 1 10 -10"></path></g></g><path d="M334.5 31h20"></path></g><path d="M 354.5 31 h 20 m 0 -10 v 20"></path></g></svg>
</div>
</div>
</div>
<div class="row box-3">
<div class="col-md-12">
<div>
<table style="width:100%;">
<tr>
<td>
</td>
<td>
ရိုက်သည်။
</td>
<td>
နှင့်
</td>
<td>
တုတ်
</td>
<td>
ခွေးကို
</td>
<td>
မောင်မောင်က
</td>
</tr>
<tr>
<td>
ရိုက်သည်။
</td>
<td>
0
</td>
<td>
1
</td>
<td>
2
</td>
<td>
1
</td>
<td>
1
</td>
</tr>
<tr>
<td>
နှင့်
</td>
<td>
1
</td>
<td>
0
</td>
<td>
1
</td>
<td>
INF
</td>
<td>
INF
</td>
</tr>
<tr>
<td>
တုတ်
</td>
<td>
2
</td>
<td>
1
</td>
<td>
0
</td>
<td>
INF
</td>
<td>
INF
</td>
</tr>
<tr>
<td>
ခွေးကို
</td>
<td>
1
</td>
<td>
INF
</td>
<td>
INF
</td>
<td>
0
</td>
<td>
INF
</td>
</tr>
<tr>
<td>
မောင်မောင်က
</td>
<td>
1
</td>
<td>
INF
</td>
<td>
INF
</td>
<td>
INF
</td>
<td>
0
</td>
</tr>
</table>
</div>
</div>
</div>
<br />
<div class="row box-3">
<div class="col-md-12">
<div>
<svg height="32" class="octicon octicon-mark-github text-white" viewBox="0 0 16 16" version="1.1" width="32" aria-hidden="true"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
<a href="https://github.com/2kha" target="_blank" style="margin-left:50px; margin-top:-35px; display:block;">Please find me more on Github...</a>
</div>
</div>
</div>
<br />
</div>
</div>
<div class="modal fade" id="suggestion-popup" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-member">
<div class="modal-content">
<div class="modal-header" style="border:none;">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
<h4>Suggestion</h4>
</div>
<div class="modal-body" style="padding:0px;">
<div id="suggestion-container" style="height:300px; overflow-y:auto;">
</div>
</div>
</div>
</div>
</div>
<hr />
<footer>
<p>© <span id="c-date"></span> - Than Lwin Aung</p>
</footer>
</div>
<script>
$(document).ready(function(){
var date = new Date();
var year = date.getFullYear();
$("#c-date").html(year);
});
</script>
</body>
</html>