Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 1 | var 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\">" + |
Akron | 4e47d0b | 2017-07-03 17:58:37 +0200 | [diff] [blame] | 17 | " <span title=\"mate/m:case:nom\">" + |
| 18 | " <span title=\"mate/p:ADJD\">" + |
| 19 | " <span title=\"opennlp/p:ADJD\">deutlich</span>" + |
| 20 | " </span>" + |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 21 | " </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 | |
| 43 | var 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 | |
| 100 | var 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 | |
Akron | 0988d88 | 2017-11-10 16:13:12 +0100 | [diff] [blame] | 140 | var 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 Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 209 | var 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 | |
| 217 | var 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 |
| 226 | var 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 | |
| 282 | var mateSttsArray = sttsArray.slice(0); |
| 283 | mateSttsArray.push( |
| 284 | ["<root-POS>","<root-POS>","Root Part of Speech"] |
| 285 | ); |
| 286 | |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 287 | var 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 Diewald | 6283d69 | 2015-04-23 20:32:53 +0000 | [diff] [blame] | 297 | "key":"title", |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 298 | "value":"Der Birnbaum", |
| 299 | "match":"match:eq" |
| 300 | }, |
| 301 | { |
| 302 | "@type":"koral:doc", |
Nils Diewald | 6283d69 | 2015-04-23 20:32:53 +0000 | [diff] [blame] | 303 | "key":"pubPlace", |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 304 | "value":"Mannheim", |
| 305 | "match":"match:eq" |
| 306 | }, |
| 307 | { |
| 308 | "@type":"koral:docGroup", |
| 309 | "operation":"operation:or", |
| 310 | "operands":[ |
| 311 | { |
| 312 | "@type":"koral:doc", |
Nils Diewald | 6283d69 | 2015-04-23 20:32:53 +0000 | [diff] [blame] | 313 | "key":"subTitle", |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 314 | "value":"Aufzucht und Pflege", |
| 315 | "match":"match:eq" |
| 316 | }, |
| 317 | { |
| 318 | "@type":"koral:doc", |
Nils Diewald | 6283d69 | 2015-04-23 20:32:53 +0000 | [diff] [blame] | 319 | "key":"subTitle", |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 320 | "value":"Gedichte", |
| 321 | "match":"match:eq", |
| 322 | "rewrites" : [ |
| 323 | { |
| 324 | "@type": "koral:rewrite", |
| 325 | "src" : "policy", |
| 326 | "operation" : "operation:injection", |
| 327 | } |
| 328 | ] |
| 329 | } |
| 330 | ] |
| 331 | } |
| 332 | ] |
| 333 | }, |
| 334 | { |
| 335 | "@type":"koral:doc", |
Nils Diewald | 6283d69 | 2015-04-23 20:32:53 +0000 | [diff] [blame] | 336 | "key":"pubDate", |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 337 | "type":"type:date", |
| 338 | "value":"2015-03-05", |
| 339 | "match":"match:geq" |
| 340 | } |
| 341 | ] |
| 342 | }; |
| 343 | |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 344 | var hintArray = { |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 345 | "-" : [ |
| 346 | ["Connexor", "cnx/", "Constituency, Lemma, Morphology, Part-of-Speech, Syntax"], |
| 347 | ["CoreNLP", "corenlp/", "Named Entities"], |
| 348 | ["Mate", "mate/", "Lemma, Morphology, Part-of-Speech"], |
| 349 | ["OpenNLP", "opennlp/", "Part-of-Speech"], |
| 350 | ["TreeTagger", "tt/", "Lemma, Part-of-Speech"], |
| 351 | ["Xerox Parser", "xip/", "Constituency, Lemma, Part-of-Speech"] |
| 352 | ], |
| 353 | "corenlp/" : [ |
| 354 | ["Named Entity", "ne=" , "Combined"], |
| 355 | ["Named Entity", "ne_dewac_175m_600=" , "ne_dewac_175m_600"], |
| 356 | ["Named Entity", "ne_hgc_175m_600=", "ne_hgc_175m_600"] |
| 357 | ], |
| 358 | "corenlp/ne=" : namedEntities, |
| 359 | "corenlp/ne_dewac_175m_600=" : namedEntities, |
| 360 | "corenlp/ne_hgc_175m_600=" : namedEntities, |
| 361 | "cnx/" : [ |
| 362 | ["Constituency", "c="], |
| 363 | ["Lemma", "l="], |
| 364 | ["Morphology", "m="], |
| 365 | ["Part-of-Speech", "p="], |
| 366 | ["Syntax", "syn="] |
| 367 | ], |
| 368 | "cnx/c=" : [ |
| 369 | ["np", "np ", "Nominal Phrase"] |
| 370 | ], |
| 371 | // http://www.ids-mannheim.de/cosmas2/projekt/referenz/connexor/morph.html |
| 372 | "cnx/m=" : [ |
| 373 | ["Abbr","Abbr ", "Nouns: Abbreviation"], |
| 374 | ["CMP","CMP ", "Adjective: Comparative"], |
| 375 | ["IMP", "IMP ", "Mood: Imperative"], |
| 376 | ["IND", "IND ", "Mood: Indicative"], |
| 377 | ["INF", "INF ", "Infinitive"], |
| 378 | ["ORD","ORD ", "Numeral: Ordinal"], |
| 379 | ["PAST", "PAST ", "Tense: past"], |
| 380 | ["PCP", "PCP ", "Participle"], |
| 381 | ["PERF", "PERF ", "Perfective Participle"], |
| 382 | ["PL","PL ", "Nouns: Plural"], |
| 383 | ["PRES", "PRES ", "Tense: present"], |
| 384 | ["PROG", "PROG ", "Progressive Participle"], |
| 385 | ["Prop","Prop ", "Nouns: Proper Noun"], |
| 386 | ["SUB", "SUB ", "Mood: Subjunctive"], |
| 387 | ["SUP","SUP ", "Adjective: Superlative"] |
| 388 | ], |
| 389 | // http://www.ids-mannheim.de/cosmas2/projekt/referenz/connexor/morph.html |
| 390 | "cnx/p=" : [ |
| 391 | ["A", "A ", "Adjective"], |
| 392 | ["ADV", "ADV ", "Adverb"], |
| 393 | ["CC", "CC ", "Coordination Marker"], |
| 394 | ["CS", "CS ", "Clause Marker"], |
| 395 | ["DET", "DET ", "Determiner"], |
| 396 | ["INTERJ", "INTERJ ", "Interjection"], |
| 397 | ["N", "N ", "Noun"], |
| 398 | ["NUM", "NUM ", "Numeral"], |
| 399 | ["PREP", "PREP ", "Preposition"], |
| 400 | ["PRON", "PRON ", "Pro-Nominal"], |
| 401 | ["V", "V ", "Verb"] |
| 402 | ], |
| 403 | // http://www.ids-mannheim.de/cosmas2/projekt/referenz/connexor/syntax.html |
| 404 | "cnx/syn=" : [ |
| 405 | ["@ADVL", "@ADVL ", "Adverbial Head"], |
| 406 | ["@AUX", "@AUX ", "Auxiliary Verb"], |
| 407 | ["@CC", "@CC ", "Coordination"] |
| 408 | ["@MAIN", "@MAIN ", "Main Verb"], |
| 409 | ["@NH", "@NH ", "Nominal Head"], |
| 410 | ["@POSTMOD", "@POSTMOD ", "Postmodifier"], |
| 411 | ["@PREMARK", "@PREMARK ", "Preposed Marker"], |
| 412 | ["@PREMOD", "@POSTMOD ", "Premodifier"] |
| 413 | ], |
| 414 | "opennlp/" : [ |
| 415 | ["Part-of-Speech", "p="] |
| 416 | ], |
| 417 | "opennlp/p=" : sttsArray, |
| 418 | "xip/" : [ |
| 419 | ["Constituency", "c="], |
| 420 | // Inactive: ["Dependency", "d="], |
| 421 | ["Lemma", "l="], |
| 422 | ["Part-of-Speech", "p="], |
| 423 | ], |
| 424 | // "xip/c=" : [], |
| 425 | // Inactive: "xip/d=" : [], |
| 426 | // "xip/p=" : [], |
| 427 | "tt/" : [ |
| 428 | ["Lemma", "l="], |
| 429 | ["Part-of-Speech", "p="] |
| 430 | ], |
| 431 | "tt/p=" : sttsArray, |
| 432 | "mate/" : [ |
| 433 | // Inactive: "d" : ["d=", "Dependency"], |
| 434 | ["Lemma", "l="], |
| 435 | ["Morphology", "m="], |
| 436 | ["Part-of-Speech", "p="] |
| 437 | ], |
| 438 | // Inactive: mate/d= |
| 439 | "mate/p=" : mateSttsArray, |
| 440 | "mate/m=" : [ |
| 441 | ["Case", "case:"], |
| 442 | ["Degree", "degree:"], |
| 443 | ["Gender", "gender:"], |
| 444 | ["Mood", "mood:"], |
| 445 | ["Number", "number:"], |
| 446 | ["Person", "person:"], |
| 447 | ["Tense","tense:"], |
| 448 | ["No type", "<no-type> "] |
| 449 | ], |
| 450 | "mate/m=case:" : [ |
| 451 | ["acc", "acc ", "Accusative"], |
| 452 | ["dat","dat ", "Dative"], |
| 453 | ["gen", "gen ","Genitive"], |
| 454 | ["nom","nom ", "Nominative"], |
| 455 | ["*","* ", "Undefined"] |
| 456 | ], |
| 457 | "mate/m=degree:" : [ |
| 458 | ["comp","comp ", "Comparative"], |
| 459 | ["pos","pos ", "Positive"], |
| 460 | ["sup","sup ", "Superative"] |
| 461 | ], |
| 462 | "mate/m=gender:" : [ |
| 463 | ["fem", "fem ", "Feminium"], |
| 464 | ["masc", "masc ", "Masculinum"], |
| 465 | ["neut","neut ", "Neuter"], |
| 466 | ["*","* ","Undefined"] |
| 467 | ], |
| 468 | "mate/m=mood:" : [ |
| 469 | ["imp","imp ", "Imperative"], |
| 470 | ["ind","ind ", "Indicative"], |
| 471 | ["subj","subj ", "Subjunctive"] |
| 472 | ], |
| 473 | "mate/m=number:" : [ |
| 474 | ["pl","pl ","Plural"], |
| 475 | ["sg","sg ","Singular"], |
| 476 | ["*","* ","Undefined"] |
| 477 | ], |
| 478 | "mate/m=person:" : [ |
| 479 | ["1","1 ", "First Person"], |
| 480 | ["2","2 ", "Second Person"], |
| 481 | ["3","3 ", "Third Person"] |
| 482 | ], |
| 483 | "mate/m=tense:" : [ |
| 484 | ["past","past ", "Past"], |
| 485 | ["pres","pres ", "Present"] |
| 486 | ] |
| 487 | }; |
| 488 | |
Nils Diewald | 845282c | 2015-05-14 07:53:03 +0000 | [diff] [blame] | 489 | var queryExample = {"wrap":{"layer":"orth","match":"match:eq","foundry":"opennlp","key":"Baum","@type":"korap:term"},"@type":"korap:token"}; |
| 490 | |
| 491 | queryExample = { |
| 492 | "@context" : "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld", |
| 493 | "collection" : { |
| 494 | "@type" : "koral:doc", |
| 495 | "key" : "pubDate", |
| 496 | "value" : "2005-05-25", |
| 497 | "type" : "type:date", |
| 498 | "match" : "match:geq" |
| 499 | }, |
| 500 | "query" : {} |
| 501 | }; |
| 502 | |
| 503 | queryExample = { |
| 504 | "@type" : "koral:docGroup", |
| 505 | "operation" : "operation:and", |
| 506 | "operands" : [{ |
| 507 | "@type":"koral:doc", |
| 508 | "key":"title", |
| 509 | "match":"match:eq", |
| 510 | "value":"Der Birnbaum", |
| 511 | "type":"type:string" |
| 512 | },{ |
| 513 | "@type":"koral:doc", |
| 514 | "key":"pubPlace", |
| 515 | "match":"match:eq", |
| 516 | "value":"Mannheim", |
| 517 | "type":"type:string" |
| 518 | } |
| 519 | ] |
| 520 | }; |
| 521 | |
| 522 | queryExample = { |
| 523 | "@context" : "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld", |
| 524 | "collection" : {}, |
| 525 | "query" : { |
| 526 | "@type":"koral:group", |
| 527 | "operation" : "operation:sequence", |
| 528 | "operands" : [ |
| 529 | { |
| 530 | "@type" : "koral:token", |
| 531 | "wrap" : { |
| 532 | "@type" : "koral:termGroup", |
| 533 | "relation" : "relation:and", |
| 534 | "operands" : [ { |
| 535 | "@type" : "koral:term", |
| 536 | "foundry" : "tt", |
| 537 | "key" : "ADJA", |
| 538 | "layer" : "pos", |
| 539 | "match" : "match:eq" |
| 540 | }, |
| 541 | { |
| 542 | "@type" : "koral:term", |
| 543 | "foundry" : "cnx", |
| 544 | "key" : "@PREMOD", |
| 545 | "layer" : "syn", |
| 546 | "match" : "match:eq" |
| 547 | } ] |
| 548 | } |
| 549 | }, |
| 550 | { |
| 551 | "@type" : "koral:token", |
| 552 | "wrap" : { |
| 553 | "@type" : "koral:term", |
| 554 | "key" : "octopus", |
| 555 | "layer" : "lemma", |
| 556 | "match" : "match:eq" |
| 557 | } |
| 558 | } ] |
| 559 | } |
| 560 | }; |
| 561 | |
| 562 | |
| 563 | queryExample = { |
| 564 | "@context" : "http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld", |
| 565 | "collection" : { |
| 566 | "@type" : "koral:doc", |
| 567 | "key" : "pubDate", |
| 568 | "value" : "2005-05-25", |
| 569 | "type" : "type:date", |
| 570 | "match" : "match:geq" |
| 571 | }, |
| 572 | "query" : { |
| 573 | "@type" : "koral:token", |
| 574 | "wrap" : { |
| 575 | "@type" : "koral:term", |
| 576 | "key" : "octopus", |
| 577 | "layer" : "lemma", |
| 578 | "match" : "match:eq" |
| 579 | } |
| 580 | } |
| 581 | }; |
| 582 | |
| 583 | queryExample = { |
| 584 | "@type":"koral:doc", |
| 585 | "key":"subTitle", |
| 586 | "value":"Gedichte", |
| 587 | "match":"match:eq", |
| 588 | "rewrites" : [ |
| 589 | { |
| 590 | "@type": "koral:rewrite", |
| 591 | "src" : "policy", |
| 592 | "operation" : "operation:injection", |
| 593 | } |
| 594 | ] |
| 595 | }; |
| 596 | |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 597 | |
Akron | 4bbd8b3 | 2018-03-06 19:19:44 +0100 | [diff] [blame] | 598 | var textInfo = { |
| 599 | "@context":"http:\/\/korap.ids-mannheim.de\/ns\/KoralQuery\/v0.3\/context.jsonld", |
| 600 | "document":{ |
| 601 | "@type":"koral:document", |
| 602 | "fields":[ |
| 603 | { |
| 604 | "@type":"koral:field", |
| 605 | "key":"editor", |
| 606 | "type":"type:store", |
| 607 | "value":"wikipedia.org" |
| 608 | }, |
| 609 | { |
| 610 | "@type":"koral:field", |
| 611 | "key":"textSigle", |
| 612 | "type":"type:string", |
| 613 | "value":"WPD15\/264\/58336" |
| 614 | }, |
| 615 | { |
| 616 | "@type":"koral:field", |
| 617 | "key":"author", |
| 618 | "type":"type:text", |
| 619 | "value":"Sprachpfleger, u.a." |
| 620 | }, |
| 621 | { |
| 622 | "@type":"koral:field", |
| 623 | "key":"docSigle", |
| 624 | "type":"type:string", |
| 625 | "value":"WPD15\/264" |
| 626 | }, |
| 627 | { |
| 628 | "@type":"koral:field", |
| 629 | "key":"textTypeArt", |
| 630 | "type":"type:string", |
| 631 | "value":"Enzyklopädie-Artikel" |
| 632 | }, |
| 633 | { |
| 634 | "@type":"koral:field", |
| 635 | "key":"language", |
| 636 | "type":"type:string", |
| 637 | "value":"de" |
| 638 | }, |
| 639 | { |
| 640 | "@type":"koral:field", |
| 641 | "key":"docTitle", |
| 642 | "type":"type:text", |
| 643 | "value":"Wikipedia, Artikel mit Anfangszahl 2, Teil 64" |
| 644 | }, |
| 645 | { |
| 646 | "@type":"koral:field", |
| 647 | "key":"textType", |
| 648 | "type":"type:string", |
| 649 | "value":"Enzyklopädie" |
| 650 | }, |
| 651 | { |
| 652 | "@type":"koral:field", |
| 653 | "key":"availability", |
| 654 | "type":"type:string", |
| 655 | "value":"CC-BY-SA" |
| 656 | }, |
| 657 | { |
| 658 | "@type":"koral:field", |
| 659 | "key":"foundries", |
Akron | bf3fc9d | 2018-03-08 12:36:39 +0100 | [diff] [blame] | 660 | "type":"type:keywords", |
| 661 | "value":[ |
| 662 | "corenlp", |
| 663 | "corenlp\/constituency", |
| 664 | "corenlp\/morpho", |
| 665 | "corenlp\/sentences", |
| 666 | "dereko", |
| 667 | "dereko\/structure", |
| 668 | "dereko\/structure\/base-sentences-paragraphs-pagebreaks", |
| 669 | "opennlp", |
| 670 | "opennlp\/morpho", |
| 671 | "opennlp\/sentences" |
| 672 | ] |
Akron | 4bbd8b3 | 2018-03-06 19:19:44 +0100 | [diff] [blame] | 673 | }, |
| 674 | { |
| 675 | "@type":"koral:field", |
| 676 | "key":"creationDate", |
Akron | bf3fc9d | 2018-03-08 12:36:39 +0100 | [diff] [blame] | 677 | "type":"type:date", |
| 678 | "value":"2015-04-17" |
Akron | 4bbd8b3 | 2018-03-06 19:19:44 +0100 | [diff] [blame] | 679 | }, |
| 680 | { |
| 681 | "@type":"koral:field", |
| 682 | "key":"title", |
| 683 | "type":"type:text", |
| 684 | "value":"22:43 – Das Schicksal hat einen Plan" |
| 685 | }, |
| 686 | { |
| 687 | "@type":"koral:field", |
| 688 | "key":"pubDate", |
Akron | bf3fc9d | 2018-03-08 12:36:39 +0100 | [diff] [blame] | 689 | "type":"type:date", |
| 690 | "value":"2015-05-01" |
Akron | 4bbd8b3 | 2018-03-06 19:19:44 +0100 | [diff] [blame] | 691 | }, |
| 692 | { |
| 693 | "@type":"koral:field", |
| 694 | "key":"reference", |
| 695 | "type":"type:store", |
| 696 | "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" |
| 697 | }, |
| 698 | { |
| 699 | "@type":"koral:field", |
| 700 | "key":"textClass", |
Akron | bf3fc9d | 2018-03-08 12:36:39 +0100 | [diff] [blame] | 701 | "type":"type:keywords", |
| 702 | "value":["kultur","film"] |
Akron | 4bbd8b3 | 2018-03-06 19:19:44 +0100 | [diff] [blame] | 703 | }, |
| 704 | { |
| 705 | "@type":"koral:field", |
| 706 | "key":"tokenSource", |
| 707 | "type":"type:store", |
| 708 | "value":"base#tokens" |
| 709 | }, |
| 710 | { |
| 711 | "@type":"koral:field", |
| 712 | "key":"publisher", |
| 713 | "type":"type:store", |
| 714 | "value":"Wikipedia" |
| 715 | }, |
| 716 | { |
| 717 | "@type":"koral:field", |
| 718 | "key":"layerInfos", |
| 719 | "type":"type:store", |
| 720 | "value":"corenlp\/c=spans corenlp\/p=tokens corenlp\/s=spans dereko\/s=spans opennlp\/p=tokens opennlp\/s=spans" |
| 721 | }, |
| 722 | { |
| 723 | "@type":"koral:field", |
| 724 | "key":"pubPlace", |
| 725 | "type":"type:string", |
| 726 | "value":"URL:http:\/\/de.wikipedia.org" |
| 727 | }, |
| 728 | { |
| 729 | "@type":"koral:field", |
| 730 | "key":"corpusTitle", |
| 731 | "type":"type:text", |
| 732 | "value":"Wikipedia" |
| 733 | }, |
| 734 | { |
| 735 | "@type":"koral:field", |
| 736 | "key":"corpusEditor", |
| 737 | "type":"type:store", |
| 738 | "value":"wikipedia.org" |
| 739 | }, |
| 740 | { |
| 741 | "@type":"koral:field", |
| 742 | "key":"corpusSigle", |
| 743 | "type":"type:string", |
| 744 | "value":"WPD15" |
| 745 | } |
| 746 | ] |
| 747 | } |
| 748 | }; |
| 749 | |
Akron | 2f97912 | 2018-07-25 17:00:23 +0200 | [diff] [blame] | 750 | //corpus statistic |
| 751 | var statistic = { |
| 752 | "documents":1, |
| 753 | "tokens":222222, |
| 754 | "sentences":33333, |
| 755 | "paragraphs":444 |
| 756 | }; |
| 757 | |
| 758 | |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 759 | requirejs.config({ |
| 760 | baseUrl: '../js/src', |
| 761 | paths : { |
| 762 | 'lib': '../lib' |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 763 | } |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 764 | }); |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 765 | |
Akron | 48b1e4d | 2015-06-17 18:47:01 +0200 | [diff] [blame] | 766 | KorAP.currentQuery = queryExample; |
Nils Diewald | 845282c | 2015-05-14 07:53:03 +0000 | [diff] [blame] | 767 | |
Akron | 1f0521b | 2018-08-28 13:01:24 +0200 | [diff] [blame] | 768 | /* |
| 769 | KorAP.koralQuery["collection"] = { |
| 770 | "@type" : "koral:docGroupRef", |
| 771 | "ref" : "This is my name" |
| 772 | }; |
| 773 | */ |
Akron | 8005599 | 2017-12-20 16:30:52 +0100 | [diff] [blame] | 774 | require(['app/en', 'init', 'hint/foundries/cnx'], function (lang) { |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 775 | KorAP.hintArray = hintArray; |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 776 | |
Nils Diewald | 6283d69 | 2015-04-23 20:32:53 +0000 | [diff] [blame] | 777 | // Set current virtual collection |
Akron | 1f0521b | 2018-08-28 13:01:24 +0200 | [diff] [blame] | 778 | // KorAP.currentVC = vcExample; |
Nils Diewald | 6283d69 | 2015-04-23 20:32:53 +0000 | [diff] [blame] | 779 | |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 780 | // Parse and show the table |
| 781 | // Override getMatchInfo API call |
| 782 | KorAP.API.getMatchInfo = function(match, callObj, cb) { |
Akron | 311ca65 | 2017-06-26 20:39:56 +0200 | [diff] [blame] | 783 | |
| 784 | console.log(match); |
Akron | 0988d88 | 2017-11-10 16:13:12 +0100 | [diff] [blame] | 785 | |
| 786 | if (callObj["foundry"] === "malt" && callObj["layer"] === "d") { |
| 787 | cb({ "snippet": relSnippet }); |
| 788 | } |
| 789 | else if (callObj["spans"] !== undefined && callObj["spans"] === true) { |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 790 | cb({ "snippet": treeSnippet2 }); |
| 791 | } |
| 792 | else { |
| 793 | cb({ "snippet": snippet }); |
| 794 | } |
| 795 | }; |
| 796 | |
Akron | 4bbd8b3 | 2018-03-06 19:19:44 +0100 | [diff] [blame] | 797 | KorAP.API.getTextInfo = function (doc, param, cb) { |
| 798 | cb(textInfo); |
| 799 | }; |
Akron | 2f97912 | 2018-07-25 17:00:23 +0200 | [diff] [blame] | 800 | |
| 801 | //get the corpus statistic (demo function) |
| 802 | KorAP.API.getCorpStat = function(collQu, cb){ |
| 803 | return cb(statistic); |
| 804 | }; |
| 805 | |
| 806 | |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 807 | /** |
| 808 | * Do some things at the beginning. |
| 809 | */ |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 810 | |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 811 | // document.getElementById('vc-choose').click(); |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 812 | // init.tutorial.show(); |
| 813 | |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 814 | /* |
| 815 | KorAP.HintMenu.hide = function () {}; |
| 816 | init.hint.show(); |
Nils Diewald | 2488d05 | 2015-04-09 21:46:02 +0000 | [diff] [blame] | 817 | |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 818 | var menu = KorAP.MatchTreeMenu.create( |
| 819 | undefined, |
| 820 | menuContent |
| 821 | ); |
| 822 | menu.hide = function () {}; |
| 823 | document.getElementById('menu').appendChild(menu.element()); |
| 824 | menu.limit(3); |
| 825 | menu.show(); |
| 826 | menu.focus(); |
| 827 | */ |
Nils Diewald | a944fab | 2015-04-08 21:02:04 +0000 | [diff] [blame] | 828 | }); |