blob: ab252ee5798a218fff3a879a7a857fe334ed95c8 [file] [log] [blame]
Nils Diewalda944fab2015-04-08 21:02:04 +00001var snippet = "<span title=\"cnx/l:meist\">" +
2 " <span title=\"cnx/p:ADV\">" +
3 " <span title=\"cnx/syn:@PREMOD\">" +
4 " <span title=\"mate/l:meist\">" +
5 " <span title=\"mate/p:ADV\">" +
6 " <span title=\"opennlp/p:ADV\">meist</span>" +
7 " </span>" +
8 " </span>" +
9 " </span>" +
10 " </span>" +
11 "</span>" +
12 "<span title=\"cnx/l:deutlich\">" +
13 " <span title=\"cnx/p:A\">" +
14 " <span title=\"cnx/syn:@PREMOD\">" +
15 " <span title=\"mate/l:deutlich\">" +
16 " <span title=\"mate/m:degree:pos\">" +
Akron4e47d0b2017-07-03 17:58:37 +020017 " <span title=\"mate/m:case:nom\">" +
18 " <span title=\"mate/p:ADJD\">" +
19 " <span title=\"opennlp/p:ADJD\">deutlich</span>" +
20 " </span>" +
Nils Diewalda944fab2015-04-08 21:02:04 +000021 " </span>" +
22 " </span>" +
23 " </span>" +
24 " </span>" +
25 " </span>" +
26 "</span>" +
27 "<span title=\"cnx/l:fähig\">" +
28 " <span title=\"cnx/l:leistung\">" +
29 " <span title=\"cnx/p:A\">" +
30 " <span title=\"cnx/syn:@NH\">" +
31 " <span title=\"mate/l:leistungsfähig\">" +
32 " <span title=\"mate/m:degree:comp\">" +
33 " <span title=\"mate/p:ADJD\">" +
34 " <span title=\"opennlp/p:ADJD\">leistungsfähiger</span>" +
35 " </span>" +
36 " </span>" +
37 " </span>" +
38 " </span>" +
39 " </span>" +
40 " </span>" +
41 "</span>";
42
43var treeSnippet =
44 "<span class=\"context-left\"></span>" +
45 "<span class=\"match\">" +
46 " <span title=\"xip/c:MC\">" +
47 " <span title=\"xip/c:TOP\">" +
48 " <span title=\"xip/c:PP\">" +
49 " <span title=\"xip/c:PREP\">Mit</span>" +
50 " <span title=\"xip/c:NP\">" +
51 " <span title=\"xip/c:DET\">dieser</span>" +
52 " <span title=\"xip/c:NPA\">" +
53 " <span title=\"xip/c:NOUN\">Methode</span>" +
54 " </span>" +
55 " </span>" +
56 " </span>" +
57 " <span title=\"xip/c:VERB\">ist</span>" +
58 " <span title=\"xip/c:NP\">" +
59 " <span title=\"xip/c:PRON\">es</span>" +
60 " </span>" +
61 " <span title=\"xip/c:AP\">" +
62 " <span title=\"xip/c:ADV\">nun</span>" +
63 " <span title=\"xip/c:ADJ\">möglich</span>" +
64 " </span>" +
65 " <span title=\"xip/c:ADV\">z. B.</span>" +
66 " <span title=\"xip/c:NPA\">" +
67 " <span title=\"xip/c:NP\">" +
68 " <span title=\"xip/c:NOUN\">Voice</span>" +
69 " </span>" +
70 " </span>" + "(" +
71 " <span title=\"xip/c:INS\">" +
72 " <span title=\"xip/c:NPA\">" +
73 " <span title=\"xip/c:NP\">" +
74 " <span title=\"xip/c:NOUN\">Sprache</span>" +
75 " </span>" +
76 " </span>" +
77 " </span>" + ")" +
78 " <span title=\"xip/c:VERB\">bevorzugt</span>" +
79 " <span title=\"xip/c:PP\">" +
80 " <span title=\"xip/c:PREP\">in</span>" +
81 " <span title=\"xip/c:NP\">" +
82 " <span title=\"xip/c:PRON\">der</span>" +
83 " </span>" +
84 " <span title=\"xip/c:NPA\">" +
85 " <span title=\"xip/c:NP\">" +
86 " <span title=\"xip/c:NOUN\">Bridge</span>" +
87 " </span>" +
88 " </span>" +
89 " </span>" +
90 " <span title=\"xip/c:INFC\">" +
91 " <span title=\"xip/c:INS\">" +
92 " <span title=\"xip/c:VERB\">weiterzugeben</span>" +
93 " </span>" +
94 " </span>" +
95 " </span>" +
96 " </span>" +
97 "</span>" +
98 "<span class=\"context-right\"></span>";
99
100var treeSnippet2 =
101 "<span class=\"context-left\"><\/span>"+
102 "<span class=\"match\">"+
103 "<span title=\"xip\/c:NPA\">"+
104 "<span title=\"xip\/c:NP\">"+
105 "<span title=\"xip\/c:NOUN\">HDTV<\/span>"+
106 "<\/span>"+
107 "<\/span> "+
108 "<span title=\"xip\/c:NPA\">" +
109 "<span title=\"xip\/c:NP\">"+
110 "<span title=\"xip\/c:NOUN\">Samples<\/span>"+
111 "<\/span>"+
112 "<\/span> "+
113 "<span title=\"xip\/c:ADV\">from<\/span> "+
114 "<span title=\"xip\/c:NPA\">"+
115 "<span title=\"xip\/c:NP\">"+
116 "<span title=\"xip\/c:NOUN\">European<\/span>"+
117 "<\/span>"+
118 "<\/span> ("+
119 "<span title=\"xip\/c:INS\">"+
120 "<span title=\"xip\/c:NPA\">"+
121 "<span title=\"xip\/c:NP\">"+
122 "<span title=\"xip\/c:NOUN\">and<\/span>"+
123 "<\/span>"+
124 "<\/span> "+
125 "<span title=\"xip\/c:ADV\">other<\/span>"+
126 "<\/span>) "+
127 "<span title=\"xip\/c:ADV\">broadcasters<\/span> "+
128 "<span title=\"xip\/c:NPA\">"+
129 "<span title=\"xip\/c:NP\">"+
130 "<span title=\"xip\/c:NOUN\">and<\/span>"+
131 "<\/span>"+
132 "<\/span> "+
133 "<span title=\"xip\/c:VERB\">test<\/span> "+
134 "<span title=\"xip\/c:ADV\">transmissions<\/span> "+
135 "<span title=\"xip\/c:PREP\">in<\/span> "+
136 "<span title=\"xip\/c:NOUN\">Europe<\/span>"+
137 "<\/span>"+
138 "<span class=\"context-right\"><\/span>";
139
Akron0988d882017-11-10 16:13:12 +0100140var relSnippet =
141 "<span class=\"context-left\"></span>" +
142 "<span class=\"match\">" +
143 " <span xml:id=\"token-GOE/AGA/01784-p199\">" +
144 " <span xlink:title=\"malt/d:ADV\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p199\">dann</span>" +
145 " </span>" +
146 " zog " +
147 " <span xlink:title=\"malt/d:SUBJ\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p199\">ich</span>" +
148 " <span xml:id=\"token-GOE/AGA/01784-p202\">" +
149 " <span xlink:title=\"malt/d:OBJA\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p199\">mich</span>" +
150 " </span>" +
151 " <span xlink:title=\"malt/d:PP\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p199\">gegen</span>" +
152 " <span xml:id=\"token-GOE/AGA/01784-p204\">" +
153 " <span xlink:title=\"malt/d:DET\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p204\">das</span>" +
154 " </span>" +
155 " <span xlink:title=\"malt/d:PN\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p202\">Regiment</span>" +
156 " <span xml:id=\"token-GOE/AGA/01784-p206\">" +
157 " <span xlink:title=\"malt/d:AVZ\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p199\">zurück</span>" +
158 " </span>" +
159 " <span xml:id=\"token-GOE/AGA/01784-p207\">" +
160 " <span xlink:title=\"malt/d:KON\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p199\">und</span>" +
161 " </span>" +
162 " <span xml:id=\"token-GOE/AGA/01784-p208\">" +
163 " <span xlink:title=\"malt/d:CJ\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p206\">war</span>" +
164 " </span>" +
165 " <span xlink:title=\"malt/d:AUX\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p207\">bemüht</span>" +
166 "," +
167 " <span xlink:title=\"malt/d:DET\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p211\">einige</span>" +
168 " <span xml:id=\"token-GOE/AGA/01784-p211\">" +
169 " <span xlink:title=\"malt/d:ATTR\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p211\">genaue</span>" +
170 " </span>" +
171 " <span xml:id=\"token-GOE/AGA/01784-p212\">" +
172 " <span xlink:title=\"malt/d:OBJA\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p215\">Umrisse</span>" +
173 " </span>" +
174 " <span xlink:title=\"malt/d:OBJP\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p215\">aufs</span>" +
175 " <span xlink:title=\"malt/d:PN\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p212\">Papier</span>" +
176 " <span xml:id=\"token-GOE/AGA/01784-p215\">" +
177 " <span xlink:title=\"malt/d:PART\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p215\">zu</span>" +
178 " </span>" +
179 " <span xlink:title=\"malt/d:OBJI\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p208\">bringen</span>" +
180 ", um mir " +
181 " <span xml:id=\"token-GOE/AGA/01784-p219\">" +
182 " <span xlink:title=\"malt/d:DET\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p219\">die</span>" +
183 " </span>" +
184 " <span xml:id=\"token-GOE/AGA/01784-p220\">Bezüge</span>" +
185 " <span xlink:title=\"malt/d:KON\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p219\">und</span>" +
186 " <span xml:id=\"token-GOE/AGA/01784-p222\">" +
187 " <span xlink:title=\"malt/d:DET\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p222\">die</span>" +
188 " </span>" +
189 " <span xlink:title=\"malt/d:CJ\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p220\">Distanzen</span>" +
190 " <mark>" +
191 " <span xlink:title=\"malt/d:DET\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p225\">der</span>" +
192 " </mark>" +
193 " <span xml:id=\"token-GOE/AGA/01784-p225\">" +
194 " <span xlink:title=\"malt/d:ATTR\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p225\">landschaftlichen</span>" +
195 " </span>" +
196 " <span xml:id=\"token-GOE/AGA/01784-p226\">" +
197 " <span xlink:title=\"malt/d:GMOD\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p222\">Gegenstände</span>" +
198 " </span>" +
199 " <span xlink:title=\"malt/d:KON\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p219\">desto</span>" +
200 " <span xlink:title=\"malt/d:ADV\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p229\">besser</span>" +
201 " <span xml:id=\"token-GOE/AGA/01784-p229\">" +
202 " <span xlink:title=\"malt/d:PART\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p229\">zu</span>" +
203 " </span>" +
204 " <span xlink:title=\"malt/d:CJ\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p226\">imprimieren</span>" +
205 "</span>" +
206 "<span class=\"context-right\"></span>";
207
208
Nils Diewalda944fab2015-04-08 21:02:04 +0000209var menuContent = [
210 ['cnx/c', 'cnx', 'c'],
211 ['mate/c', 'mate', 'c'],
212 ['base/c', 'base', 'c'],
213 ['xip/c', 'xip', 'c'],
214 ['tt/c', 'tt', 'c']
215];
216
217var namedEntities = [
218 ["I-LOC", "I-LOC ", "Location"],
219 ["I-MISC", "I-MISC ", "Miscellaneous"],
220 ["I-ORG", "I-ORG ", "Organization"],
221 ["I-PER", "I-PER ", "Person"]
222];
223
224// http://www.ids-mannheim.de/cosmas2/projekt/referenz/stts/morph.html
225// http://nachhalt.sfb632.uni-potsdam.de/owl-docu/stts.html
226var sttsArray = [
227 // "$.", "$(", "$,"
228 ["ADJA","ADJA ", "Attributive Adjective"],
229 ["ADJD","ADJD ", "Predicative Adjective"],
230 ["ADV","ADV ", "Adverb"],
231 ["APPO","APPO ", "Postposition"],
232 ["APPR","APPR ", "Preposition"],
233 ["APPRART","APPRART ", "Preposition with Determiner"],
234 ["APZR","APZR ","Right Circumposition"],
235 ["ART","ART ", "Determiner"],
236 ["CARD","CARD ", "Cardinal Number"],
237 ["FM","FM ", "Foreign Material"],
238 ["ITJ","ITJ ", "Interjection"],
239 ["KOKOM","KOKOM ", "Comparison Particle"],
240 ["KON","KON ", "Coordinating Conjuncion"],
241 ["KOUI","KOUI ", "Subordinating Conjunction with 'zu'"],
242 ["KOUS","KOUS ", "Subordinating Conjunction with Sentence"],
243 ["NE","NE ", "Named Entity"],
244 ["NN","NN ", "Normal Nomina"],
245 ["PAV", "PAV ", "Pronominal Adverb"],
246 ["PDAT","PDAT ","Attributive Demonstrative Pronoun"],
247 ["PDS","PDS ", "Substitutive Demonstrative Pronoun"],
248 ["PIAT","PIAT ", "Attributive Indefinite Pronoun without Determiner"],
249 ["PIDAT","PIDAT ", "Attributive Indefinite Pronoun with Determiner"],
250 ["PIS","PIS ", "Substitutive Indefinite Pronoun"],
251 ["PPER","PPER ", "Personal Pronoun"],
252 ["PPOSAT","PPOSAT ", "Attributive Possessive Pronoun"],
253 ["PPOSS","PPOSS ", "Substitutive Possessive Pronoun"],
254 ["PRELAT","PRELAT ", "Attributive Relative Pronoun"],
255 ["PRELS","PRELS ", "Substitutive Relative Pronoun"],
256 ["PRF","PRF ", "Reflexive Pronoun"],
257 ["PROAV","PROAV ", "Pronominal Adverb"],
258 ["PTKA","PTKA ","Particle with Adjective"],
259 ["PTKANT","PTKANT ", "Answering Particle"],
260 ["PTKNEG","PTKNEG ", "Negation Particle"],
261 ["PTKVZ","PTKVZ ", "Separated Verbal Particle"],
262 ["PTKZU","PTKZU ", "'zu' Particle"],
263 ["PWAT","PWAT ", "Attributive Interrogative Pronoun"],
264 ["PWAV","PWAV ", "Adverbial Interrogative Pronoun"],
265 ["PWS","PWS ", "Substitutive Interrogative Pronoun"],
266 ["TRUNC","TRUNC ","Truncated"],
267 ["VAFIN","VAFIN ", "Auxiliary Finite Verb"],
268 ["VAINF","VAINF ", "Auxiliary Infinite Verb"],
269 ["VAIMP","VAIMP ", "Auxiliary Finite Imperative Verb"],
270 ["VAPP","VAPP ", "Auxiliary Perfect Participle"],
271 ["VMFIN","VMFIN ", "Modal Finite Verb"],
272 ["VMINF","VMINF ", "Modal Infinite Verb"],
273 ["VMPP","VMPP ", "Modal Perfect Participle"],
274 ["VVFIN","VVFIN ","Finite Verb"],
275 ["VVIMP","VVIMP ", "Finite Imperative Verb"],
276 ["VVINF","VVINF ", "Infinite Verb"],
277 ["VVIZU","VVIZU ", "Infinite Verb with 'zu'"],
278 ["VVPP","VVPP ", "Perfect Participle"],
279 ["XY", "XY ", "Non-Word"]
280];
281
282var mateSttsArray = sttsArray.slice(0);
283mateSttsArray.push(
284 ["<root-POS>","<root-POS>","Root Part of Speech"]
285);
286
Nils Diewalda944fab2015-04-08 21:02:04 +0000287var vcExample = {
288 "@type":"koral:docGroup",
289 "operation":"operation:or",
290 "operands":[
291 {
292 "@type":"koral:docGroup",
293 "operation":"operation:and",
294 "operands":[
295 {
296 "@type":"koral:doc",
Nils Diewald6283d692015-04-23 20:32:53 +0000297 "key":"title",
Nils Diewalda944fab2015-04-08 21:02:04 +0000298 "value":"Der Birnbaum",
299 "match":"match:eq"
300 },
301 {
302 "@type":"koral:doc",
Nils Diewald6283d692015-04-23 20:32:53 +0000303 "key":"pubPlace",
Nils Diewalda944fab2015-04-08 21:02:04 +0000304 "value":"Mannheim",
305 "match":"match:eq"
306 },
307 {
308 "@type":"koral:docGroup",
309 "operation":"operation:or",
310 "operands":[
311 {
312 "@type":"koral:doc",
Nils Diewald6283d692015-04-23 20:32:53 +0000313 "key":"subTitle",
Nils Diewalda944fab2015-04-08 21:02:04 +0000314 "value":"Aufzucht und Pflege",
315 "match":"match:eq"
316 },
317 {
Akron7e5afce2020-08-25 15:50:19 +0200318 "@type":"koral:docGroupRef",
319 "ref":"@admin/derekosub"
320 },
321 {
Nils Diewalda944fab2015-04-08 21:02:04 +0000322 "@type":"koral:doc",
Nils Diewald6283d692015-04-23 20:32:53 +0000323 "key":"subTitle",
Nils Diewalda944fab2015-04-08 21:02:04 +0000324 "value":"Gedichte",
325 "match":"match:eq",
326 "rewrites" : [
327 {
328 "@type": "koral:rewrite",
329 "src" : "policy",
330 "operation" : "operation:injection",
331 }
332 ]
333 }
334 ]
335 }
336 ]
337 },
338 {
339 "@type":"koral:doc",
Nils Diewald6283d692015-04-23 20:32:53 +0000340 "key":"pubDate",
Nils Diewalda944fab2015-04-08 21:02:04 +0000341 "type":"type:date",
342 "value":"2015-03-05",
343 "match":"match:geq"
344 }
345 ]
346};
347
Nils Diewald0e6992a2015-04-14 20:13:52 +0000348var hintArray = {
Nils Diewalda944fab2015-04-08 21:02:04 +0000349 "-" : [
350 ["Connexor", "cnx/", "Constituency, Lemma, Morphology, Part-of-Speech, Syntax"],
351 ["CoreNLP", "corenlp/", "Named Entities"],
352 ["Mate", "mate/", "Lemma, Morphology, Part-of-Speech"],
353 ["OpenNLP", "opennlp/", "Part-of-Speech"],
354 ["TreeTagger", "tt/", "Lemma, Part-of-Speech"],
355 ["Xerox Parser", "xip/", "Constituency, Lemma, Part-of-Speech"]
356 ],
357 "corenlp/" : [
358 ["Named Entity", "ne=" , "Combined"],
359 ["Named Entity", "ne_dewac_175m_600=" , "ne_dewac_175m_600"],
360 ["Named Entity", "ne_hgc_175m_600=", "ne_hgc_175m_600"]
361 ],
362 "corenlp/ne=" : namedEntities,
363 "corenlp/ne_dewac_175m_600=" : namedEntities,
364 "corenlp/ne_hgc_175m_600=" : namedEntities,
365 "cnx/" : [
366 ["Constituency", "c="],
367 ["Lemma", "l="],
368 ["Morphology", "m="],
369 ["Part-of-Speech", "p="],
370 ["Syntax", "syn="]
371 ],
372 "cnx/c=" : [
373 ["np", "np ", "Nominal Phrase"]
374 ],
375 // http://www.ids-mannheim.de/cosmas2/projekt/referenz/connexor/morph.html
376 "cnx/m=" : [
377 ["Abbr","Abbr ", "Nouns: Abbreviation"],
378 ["CMP","CMP ", "Adjective: Comparative"],
379 ["IMP", "IMP ", "Mood: Imperative"],
380 ["IND", "IND ", "Mood: Indicative"],
381 ["INF", "INF ", "Infinitive"],
382 ["ORD","ORD ", "Numeral: Ordinal"],
383 ["PAST", "PAST ", "Tense: past"],
384 ["PCP", "PCP ", "Participle"],
385 ["PERF", "PERF ", "Perfective Participle"],
386 ["PL","PL ", "Nouns: Plural"],
387 ["PRES", "PRES ", "Tense: present"],
388 ["PROG", "PROG ", "Progressive Participle"],
389 ["Prop","Prop ", "Nouns: Proper Noun"],
390 ["SUB", "SUB ", "Mood: Subjunctive"],
391 ["SUP","SUP ", "Adjective: Superlative"]
392 ],
393 // http://www.ids-mannheim.de/cosmas2/projekt/referenz/connexor/morph.html
394 "cnx/p=" : [
395 ["A", "A ", "Adjective"],
396 ["ADV", "ADV ", "Adverb"],
397 ["CC", "CC ", "Coordination Marker"],
398 ["CS", "CS ", "Clause Marker"],
399 ["DET", "DET ", "Determiner"],
400 ["INTERJ", "INTERJ ", "Interjection"],
401 ["N", "N ", "Noun"],
402 ["NUM", "NUM ", "Numeral"],
403 ["PREP", "PREP ", "Preposition"],
404 ["PRON", "PRON ", "Pro-Nominal"],
405 ["V", "V ", "Verb"]
406 ],
407 // http://www.ids-mannheim.de/cosmas2/projekt/referenz/connexor/syntax.html
408 "cnx/syn=" : [
409 ["@ADVL", "@ADVL ", "Adverbial Head"],
410 ["@AUX", "@AUX ", "Auxiliary Verb"],
411 ["@CC", "@CC ", "Coordination"]
412 ["@MAIN", "@MAIN ", "Main Verb"],
413 ["@NH", "@NH ", "Nominal Head"],
414 ["@POSTMOD", "@POSTMOD ", "Postmodifier"],
415 ["@PREMARK", "@PREMARK ", "Preposed Marker"],
416 ["@PREMOD", "@POSTMOD ", "Premodifier"]
417 ],
418 "opennlp/" : [
419 ["Part-of-Speech", "p="]
420 ],
421 "opennlp/p=" : sttsArray,
422 "xip/" : [
423 ["Constituency", "c="],
424 // Inactive: ["Dependency", "d="],
425 ["Lemma", "l="],
426 ["Part-of-Speech", "p="],
427 ],
428 // "xip/c=" : [],
429 // Inactive: "xip/d=" : [],
430 // "xip/p=" : [],
431 "tt/" : [
432 ["Lemma", "l="],
433 ["Part-of-Speech", "p="]
434 ],
435 "tt/p=" : sttsArray,
436 "mate/" : [
437 // Inactive: "d" : ["d=", "Dependency"],
438 ["Lemma", "l="],
439 ["Morphology", "m="],
440 ["Part-of-Speech", "p="]
441 ],
442 // Inactive: mate/d=
443 "mate/p=" : mateSttsArray,
444 "mate/m=" : [
445 ["Case", "case:"],
446 ["Degree", "degree:"],
447 ["Gender", "gender:"],
448 ["Mood", "mood:"],
449 ["Number", "number:"],
450 ["Person", "person:"],
451 ["Tense","tense:"],
452 ["No type", "<no-type> "]
453 ],
454 "mate/m=case:" : [
455 ["acc", "acc ", "Accusative"],
456 ["dat","dat ", "Dative"],
457 ["gen", "gen ","Genitive"],
458 ["nom","nom ", "Nominative"],
459 ["*","* ", "Undefined"]
460 ],
461 "mate/m=degree:" : [
462 ["comp","comp ", "Comparative"],
463 ["pos","pos ", "Positive"],
464 ["sup","sup ", "Superative"]
465 ],
466 "mate/m=gender:" : [
467 ["fem", "fem ", "Feminium"],
468 ["masc", "masc ", "Masculinum"],
469 ["neut","neut ", "Neuter"],
470 ["*","* ","Undefined"]
471 ],
472 "mate/m=mood:" : [
473 ["imp","imp ", "Imperative"],
474 ["ind","ind ", "Indicative"],
475 ["subj","subj ", "Subjunctive"]
476 ],
477 "mate/m=number:" : [
478 ["pl","pl ","Plural"],
479 ["sg","sg ","Singular"],
480 ["*","* ","Undefined"]
481 ],
482 "mate/m=person:" : [
483 ["1","1 ", "First Person"],
484 ["2","2 ", "Second Person"],
485 ["3","3 ", "Third Person"]
486 ],
487 "mate/m=tense:" : [
488 ["past","past ", "Past"],
489 ["pres","pres ", "Present"]
490 ]
491};
492
Nils Diewald845282c2015-05-14 07:53:03 +0000493var queryExample = {"wrap":{"layer":"orth","match":"match:eq","foundry":"opennlp","key":"Baum","@type":"korap:term"},"@type":"korap:token"};
494
495queryExample = {
496 "@context" : "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld",
497 "collection" : {
498 "@type" : "koral:doc",
499 "key" : "pubDate",
500 "value" : "2005-05-25",
501 "type" : "type:date",
502 "match" : "match:geq"
503 },
504 "query" : {}
505};
506
507queryExample = {
508 "@type" : "koral:docGroup",
509 "operation" : "operation:and",
510 "operands" : [{
511 "@type":"koral:doc",
512 "key":"title",
513 "match":"match:eq",
514 "value":"Der Birnbaum",
515 "type":"type:string"
516 },{
517 "@type":"koral:doc",
518 "key":"pubPlace",
519 "match":"match:eq",
520 "value":"Mannheim",
521 "type":"type:string"
522 }
523 ]
524 };
525
526queryExample = {
527 "@context" : "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld",
528 "collection" : {},
529 "query" : {
530 "@type":"koral:group",
531 "operation" : "operation:sequence",
532 "operands" : [
533 {
534 "@type" : "koral:token",
535 "wrap" : {
536 "@type" : "koral:termGroup",
537 "relation" : "relation:and",
538 "operands" : [ {
539 "@type" : "koral:term",
540 "foundry" : "tt",
541 "key" : "ADJA",
542 "layer" : "pos",
543 "match" : "match:eq"
544 },
545 {
546 "@type" : "koral:term",
547 "foundry" : "cnx",
548 "key" : "@PREMOD",
549 "layer" : "syn",
550 "match" : "match:eq"
551 } ]
552 }
553 },
554 {
555 "@type" : "koral:token",
556 "wrap" : {
557 "@type" : "koral:term",
558 "key" : "octopus",
559 "layer" : "lemma",
560 "match" : "match:eq"
561 }
562 } ]
563 }
564};
565
566
567queryExample = {
568 "@context" : "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld",
569 "collection" : {
570 "@type" : "koral:doc",
571 "key" : "pubDate",
572 "value" : "2005-05-25",
573 "type" : "type:date",
574 "match" : "match:geq"
575 },
576 "query" : {
577 "@type" : "koral:token",
578 "wrap" : {
579 "@type" : "koral:term",
580 "key" : "octopus",
581 "layer" : "lemma",
582 "match" : "match:eq"
583 }
584 }
585};
586
587queryExample = {
588 "@type":"koral:doc",
589 "key":"subTitle",
590 "value":"Gedichte",
591 "match":"match:eq",
592 "rewrites" : [
593 {
594 "@type": "koral:rewrite",
595 "src" : "policy",
596 "operation" : "operation:injection",
597 }
598 ]
599};
600
Nils Diewald0e6992a2015-04-14 20:13:52 +0000601
Akron4bbd8b32018-03-06 19:19:44 +0100602var textInfo = {
603 "@context":"http:\/\/korap.ids-mannheim.de\/ns\/KoralQuery\/v0.3\/context.jsonld",
604 "document":{
605 "@type":"koral:document",
606 "fields":[
607 {
608 "@type":"koral:field",
609 "key":"editor",
610 "type":"type:store",
611 "value":"wikipedia.org"
612 },
613 {
614 "@type":"koral:field",
615 "key":"textSigle",
616 "type":"type:string",
617 "value":"WPD15\/264\/58336"
618 },
619 {
620 "@type":"koral:field",
621 "key":"author",
622 "type":"type:text",
623 "value":"Sprachpfleger, u.a."
624 },
625 {
626 "@type":"koral:field",
627 "key":"docSigle",
628 "type":"type:string",
629 "value":"WPD15\/264"
630 },
631 {
632 "@type":"koral:field",
633 "key":"textTypeArt",
634 "type":"type:string",
635 "value":"Enzyklopädie-Artikel"
636 },
637 {
638 "@type":"koral:field",
639 "key":"language",
640 "type":"type:string",
641 "value":"de"
642 },
643 {
644 "@type":"koral:field",
645 "key":"docTitle",
646 "type":"type:text",
647 "value":"Wikipedia, Artikel mit Anfangszahl 2, Teil 64"
648 },
649 {
650 "@type":"koral:field",
651 "key":"textType",
652 "type":"type:string",
653 "value":"Enzyklopädie"
654 },
655 {
656 "@type":"koral:field",
657 "key":"availability",
658 "type":"type:string",
659 "value":"CC-BY-SA"
660 },
661 {
662 "@type":"koral:field",
663 "key":"foundries",
Akronbf3fc9d2018-03-08 12:36:39 +0100664 "type":"type:keywords",
665 "value":[
666 "corenlp",
667 "corenlp\/constituency",
668 "corenlp\/morpho",
669 "corenlp\/sentences",
670 "dereko",
671 "dereko\/structure",
672 "dereko\/structure\/base-sentences-paragraphs-pagebreaks",
673 "opennlp",
674 "opennlp\/morpho",
675 "opennlp\/sentences"
676 ]
Akron4bbd8b32018-03-06 19:19:44 +0100677 },
678 {
679 "@type":"koral:field",
680 "key":"creationDate",
Akronbf3fc9d2018-03-08 12:36:39 +0100681 "type":"type:date",
682 "value":"2015-04-17"
Akron4bbd8b32018-03-06 19:19:44 +0100683 },
684 {
685 "@type":"koral:field",
686 "key":"title",
687 "type":"type:text",
688 "value":"22:43 – Das Schicksal hat einen Plan"
689 },
690 {
691 "@type":"koral:field",
692 "key":"pubDate",
Akronbf3fc9d2018-03-08 12:36:39 +0100693 "type":"type:date",
694 "value":"2015-05-01"
Akron4bbd8b32018-03-06 19:19:44 +0100695 },
696 {
697 "@type":"koral:field",
698 "key":"reference",
699 "type":"type:store",
700 "value":"22:43 – Das Schicksal hat einen Plan, In: Wikipedia - URL:http:\/\/de.wikipedia.org\/wiki\/22:43_–_Das_Schicksal_hat_einen_Plan: Wikipedia, 2015"
701 },
702 {
703 "@type":"koral:field",
704 "key":"textClass",
Akronbf3fc9d2018-03-08 12:36:39 +0100705 "type":"type:keywords",
706 "value":["kultur","film"]
Akron4bbd8b32018-03-06 19:19:44 +0100707 },
708 {
709 "@type":"koral:field",
710 "key":"tokenSource",
711 "type":"type:store",
712 "value":"base#tokens"
713 },
714 {
715 "@type":"koral:field",
716 "key":"publisher",
717 "type":"type:store",
718 "value":"Wikipedia"
719 },
720 {
721 "@type":"koral:field",
722 "key":"layerInfos",
723 "type":"type:store",
724 "value":"corenlp\/c=spans corenlp\/p=tokens corenlp\/s=spans dereko\/s=spans opennlp\/p=tokens opennlp\/s=spans"
725 },
726 {
727 "@type":"koral:field",
728 "key":"pubPlace",
729 "type":"type:string",
730 "value":"URL:http:\/\/de.wikipedia.org"
731 },
732 {
733 "@type":"koral:field",
734 "key":"corpusTitle",
735 "type":"type:text",
736 "value":"Wikipedia"
737 },
738 {
739 "@type":"koral:field",
740 "key":"corpusEditor",
741 "type":"type:store",
742 "value":"wikipedia.org"
743 },
744 {
745 "@type":"koral:field",
746 "key":"corpusSigle",
747 "type":"type:string",
748 "value":"WPD15"
749 }
750 ]
751 }
752};
753
Akron2f979122018-07-25 17:00:23 +0200754//corpus statistic
755var statistic = {
756 "documents":1,
757 "tokens":222222,
758 "sentences":33333,
759 "paragraphs":444
760};
761
762
Nils Diewald0e6992a2015-04-14 20:13:52 +0000763requirejs.config({
764 baseUrl: '../js/src',
765 paths : {
766 'lib': '../lib'
Nils Diewalda944fab2015-04-08 21:02:04 +0000767 }
Nils Diewald0e6992a2015-04-14 20:13:52 +0000768});
Nils Diewalda944fab2015-04-08 21:02:04 +0000769
Akron48b1e4d2015-06-17 18:47:01 +0200770KorAP.currentQuery = queryExample;
Nils Diewald845282c2015-05-14 07:53:03 +0000771
Akron1f0521b2018-08-28 13:01:24 +0200772/*
773KorAP.koralQuery["collection"] = {
774 "@type" : "koral:docGroupRef",
775 "ref" : "This is my name"
776};
777*/
Akron80055992017-12-20 16:30:52 +0100778require(['app/en', 'init', 'hint/foundries/cnx'], function (lang) {
Nils Diewald0e6992a2015-04-14 20:13:52 +0000779 KorAP.hintArray = hintArray;
Nils Diewalda944fab2015-04-08 21:02:04 +0000780
Akroncd42a142019-07-12 18:55:37 +0200781 // Set current virtual corpus
Akron1f0521b2018-08-28 13:01:24 +0200782 // KorAP.currentVC = vcExample;
Nils Diewald6283d692015-04-23 20:32:53 +0000783
Nils Diewald0e6992a2015-04-14 20:13:52 +0000784 // Parse and show the table
785 // Override getMatchInfo API call
786 KorAP.API.getMatchInfo = function(match, callObj, cb) {
Akron311ca652017-06-26 20:39:56 +0200787
788 console.log(match);
Akron0988d882017-11-10 16:13:12 +0100789
790 if (callObj["foundry"] === "malt" && callObj["layer"] === "d") {
791 cb({ "snippet": relSnippet });
792 }
793 else if (callObj["spans"] !== undefined && callObj["spans"] === true) {
Nils Diewald0e6992a2015-04-14 20:13:52 +0000794 cb({ "snippet": treeSnippet2 });
795 }
796 else {
797 cb({ "snippet": snippet });
798 }
799 };
800
Akron4bbd8b32018-03-06 19:19:44 +0100801 KorAP.API.getTextInfo = function (doc, param, cb) {
802 cb(textInfo);
803 };
Akron2f979122018-07-25 17:00:23 +0200804
805 //get the corpus statistic (demo function)
806 KorAP.API.getCorpStat = function(collQu, cb){
807 return cb(statistic);
808 };
809
810
Nils Diewald0e6992a2015-04-14 20:13:52 +0000811 /**
812 * Do some things at the beginning.
813 */
Nils Diewalda944fab2015-04-08 21:02:04 +0000814
Nils Diewalda944fab2015-04-08 21:02:04 +0000815 // document.getElementById('vc-choose').click();
Nils Diewalda944fab2015-04-08 21:02:04 +0000816 // init.tutorial.show();
817
Nils Diewald0e6992a2015-04-14 20:13:52 +0000818 /*
819 KorAP.HintMenu.hide = function () {};
820 init.hint.show();
Nils Diewald2488d052015-04-09 21:46:02 +0000821
Nils Diewald0e6992a2015-04-14 20:13:52 +0000822 var menu = KorAP.MatchTreeMenu.create(
823 undefined,
824 menuContent
825 );
826 menu.hide = function () {};
827 document.getElementById('menu').appendChild(menu.element());
828 menu.limit(3);
829 menu.show();
830 menu.focus();
831 */
Nils Diewalda944fab2015-04-08 21:02:04 +0000832});