-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathxml_synsets_II_generator.js
More file actions
39 lines (36 loc) · 1.23 KB
/
xml_synsets_II_generator.js
File metadata and controls
39 lines (36 loc) · 1.23 KB
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
function loader() {
srcCode.value = 'story=0 sequence_blocks=4 iterative_depth=2 paragraphs=2 sentences=13 season=0 weapon=0 realization=(+) story_state_machine=[]'
return
}
// function loader ()
function clear_window() {
srcTranslated.value = ''
return
}
// clear_window ()
function MD5() {
srcTranslated.value = Math.md5(srcCode.value)
return
}
// generate_MD5 ()
function translatorTool() {
var result = []
result.push("{")
for(var word in mysql_wn_data_synsets_II){
var N = mysql_wn_data_synsets_II[word].length
var t = []
t.push('"WORD":{'+word+'"')
for(var i=0; i<N; i++){
t.push(':{')
t.push('"KEY":"'+mysql_wn_data_synsets_II[word][i][0]+'"')
t.push('"PART_OF_SPEECH":"'+mysql_wn_data_synsets_II[word][i][1]+'"')
t.push('"OTHER":"'+mysql_wn_data_synsets_II[word][i][2]+'"')
t.push('"DEFINITION":"'+mysql_wn_data_synsets_II[word][i][3]+'"')
t.push('}')
result.push(JSON.stringify(t).replace(/\],/gmi,'],\n').replace(/\\/gmi,''))
}
}
result.push("}")
srcTranslated.value = JSON.stringify(result.join('\n')).replace(/\\/gmi,'').replace(/\},/gmi,'},\n')
}
// translatorTool ()