blob: 7bffc50a96c3382dc79bd19be4d3d8e424110d2c [file] [log] [blame]
Nils Diewald0e6992a2015-04-14 20:13:52 +00001requirejs.config({
2 baseUrl: '../js/src',
3 paths : {
4 'lib': '../lib'
5 }
6});
7
8// Parse and show the table
9// Override getMatchInfo API call
10require(['init'], function () {
11
Nils Diewald4347ee92015-05-04 20:32:48 +000012 var snippet = "<span title=\"cnx/l:meist\">" +
Nils Diewald0e6992a2015-04-14 20:13:52 +000013 " <span title=\"cnx/p:ADV\">" +
14 " <span title=\"cnx/syn:@PREMOD\">" +
15 " <span title=\"mate/l:meist\">" +
16 " <span title=\"mate/p:ADV\">" +
17 " <span title=\"opennlp/p:ADV\">meist</span>" +
18 " </span>" +
19 " </span>" +
20 " </span>" +
21 " </span>" +
22 "</span>" +
23 "<span title=\"cnx/l:deutlich\">" +
24 " <span title=\"cnx/p:A\">" +
25 " <span title=\"cnx/syn:@PREMOD\">" +
26 " <span title=\"mate/l:deutlich\">" +
27 " <span title=\"mate/m:degree:pos\">" +
28 " <span title=\"mate/p:ADJD\">" +
29 " <span title=\"opennlp/p:ADJD\">deutlich</span>" +
30 " </span>" +
31 " </span>" +
32 " </span>" +
33 " </span>" +
34 " </span>" +
35 "</span>" +
36 "<span title=\"cnx/l:fähig\">" +
37 " <span title=\"cnx/l:leistung\">" +
38 " <span title=\"cnx/p:A\">" +
39 " <span title=\"cnx/syn:@NH\">" +
40 " <span title=\"mate/l:leistungsfähig\">" +
41 " <span title=\"mate/m:degree:comp\">" +
42 " <span title=\"mate/p:ADJD\">" +
43 " <span title=\"opennlp/p:ADJD\">leistungsfähiger</span>" +
44 " </span>" +
45 " </span>" +
46 " </span>" +
47 " </span>" +
48 " </span>" +
49 " </span>" +
50 "</span>";
51
Akron98a933f2016-08-11 00:19:17 +020052 var treeSnippet =
Nils Diewald0e6992a2015-04-14 20:13:52 +000053 "<span class=\"context-left\"></span>" +
54 "<span class=\"match\">" +
55 " <span title=\"xip/c:MC\">" +
56 " <span title=\"xip/c:TOP\">" +
57 " <span title=\"xip/c:PP\">" +
58 " <span title=\"xip/c:PREP\">Mit</span>" +
59 " <span title=\"xip/c:NP\">" +
60 " <span title=\"xip/c:DET\">dieser</span>" +
61 " <span title=\"xip/c:NPA\">" +
62 " <span title=\"xip/c:NOUN\">Methode</span>" +
63 " </span>" +
64 " </span>" +
65 " </span>" +
66 " <span title=\"xip/c:VERB\">ist</span>" +
Akron98a933f2016-08-11 00:19:17 +020067 " <mark>" +
68 " <span title=\"xip/c:NP\">" +
69 " <span title=\"xip/c:PRON\">es</span>" +
70 " </span>" +
71 " <span title=\"xip/c:AP\">" +
72 " <span title=\"xip/c:ADV\">nun</span>" +
73 " <span title=\"xip/c:ADJ\">möglich</span>" +
74 " </span>" +
75 " </mark>" +
Nils Diewald0e6992a2015-04-14 20:13:52 +000076 " <span title=\"xip/c:ADV\">z. B.</span>" +
77 " <span title=\"xip/c:NPA\">" +
78 " <span title=\"xip/c:NP\">" +
79 " <span title=\"xip/c:NOUN\">Voice</span>" +
80 " </span>" +
81 " </span>" + "(" +
82 " <span title=\"xip/c:INS\">" +
83 " <span title=\"xip/c:NPA\">" +
84 " <span title=\"xip/c:NP\">" +
85 " <span title=\"xip/c:NOUN\">Sprache</span>" +
86 " </span>" +
87 " </span>" +
88 " </span>" + ")" +
89 " <span title=\"xip/c:VERB\">bevorzugt</span>" +
90 " <span title=\"xip/c:PP\">" +
91 " <span title=\"xip/c:PREP\">in</span>" +
92 " <span title=\"xip/c:NP\">" +
93 " <span title=\"xip/c:PRON\">der</span>" +
94 " </span>" +
95 " <span title=\"xip/c:NPA\">" +
96 " <span title=\"xip/c:NP\">" +
97 " <span title=\"xip/c:NOUN\">Bridge</span>" +
98 " </span>" +
99 " </span>" +
100 " </span>" +
101 " <span title=\"xip/c:INFC\">" +
102 " <span title=\"xip/c:INS\">" +
103 " <span title=\"xip/c:VERB\">weiterzugeben</span>" +
104 " </span>" +
105 " </span>" +
106 " </span>" +
107 " </span>" +
108 "</span>" +
109 "<span class=\"context-right\"></span>";
110
Akron98a933f2016-08-11 00:19:17 +0200111// var treeSnippet = "<span class=\"context-left\"><\/span><span class=\"match\">In diesem <span title=\"cnx\/c:np\">Sinne<\/span> schrieb <span title=\"cnx\/c:np\">Brunschwicg<\/span>:&quot;In <span title=\"cnx\/c:np\">Euklids<\/span> <span title=\"cnx\/c:np\">Elementen<\/span> <span title=\"cnx\/c:np\">spiegel<\/span> sich die <span title=\"cnx\/c:np\">Resultate<\/span> der <span title=\"cnx\/c:np\">Arbeit von Generationen vor Aristoteles<\/span> wider, nicht nur die <span title=\"cnx\/c:np\">technische Arbeit<\/span> der <span title=\"cnx\/c:np\">Entdecklung<\/span>, sondern auch die <span title=\"cnx\/c:np\">methodologische Arbeit<\/span> der <span title=\"cnx\/c:np\">Verbindung<\/span> und des <span title=\"cnx\/c:np\">Beweises<\/span>, die, in der <span title=\"cnx\/c:np\">Schule<\/span> des <span title=\"cnx\/c:np\">Phythagoras<\/span> begonnen, ihre <span title=\"cnx\/c:np\">Vollendung in den Schulen von Eudoxos von Cnidus<\/span> und <span title=\"cnx\/c:np\">Platon<\/span> gefunden hat&quot;(5<\/span><span class=\"context-right\"><\/span>";
Nils Diewald4347ee92015-05-04 20:32:48 +0000112
Nils Diewald0e6992a2015-04-14 20:13:52 +0000113 KorAP.API.getMatchInfo = function(match, callObj, cb) {
Akron7f613e02016-11-07 02:50:44 +0100114 console.dir(callObj);
Nils Diewald0e6992a2015-04-14 20:13:52 +0000115 if (callObj["spans"] !== undefined && callObj["spans"] === true) {
116 return cb({ "snippet": treeSnippet });
117 }
118 else {
119 return cb({ "snippet": snippet });
120 }
121 };
Nils Diewald0e6992a2015-04-14 20:13:52 +0000122});