blob: 11ba7ebf2caed8c02f1e25bc8a6b772caecf5362 [file] [log] [blame]
Nils Diewald8bc7e412015-03-19 22:08:27 +00001<!DOCTYPE html>
2<html>
3 <head>
4 <title>MatchInfo demo</title>
5 <meta charset="utf-8" />
Nils Diewald6e43ffd2015-03-25 18:55:39 +00006 <script src="../lib/dagre/dagre.min.js"></script>
7 <script src="../src/menu.js"></script>
Nils Diewald8bc7e412015-03-19 22:08:27 +00008 <script src="../src/matchInfo.js"></script>
Nils Diewald6e43ffd2015-03-25 18:55:39 +00009 <link type="text/css" rel="stylesheet" href="../../css/font-awesome.min.css"></link>
10 <link type="text/css" rel="stylesheet" href="../../css/matchinfo.css"></link>
11 <link type="text/css" rel="stylesheet" href="../../css/menu.css"></link>
Nils Diewald8bc7e412015-03-19 22:08:27 +000012 <style type="text/css" rel="stylesheet">
13
14body {
15 background-color: #ffa500;
Nils Diewald6e43ffd2015-03-25 18:55:39 +000016}
17
18body, text {
Nils Diewald8bc7e412015-03-19 22:08:27 +000019 font-family: tahoma, verdana, arial;
Nils Diewald6e43ffd2015-03-25 18:55:39 +000020 color: #444;
21}
22
23text {
24 fill: #444;
Nils Diewald8bc7e412015-03-19 22:08:27 +000025}
26
27 </style>
28 </head>
29 <body>
30
Nils Diewald8bc7e412015-03-19 22:08:27 +000031 <script>
32var snippet = "<span title=\"cnx/l:meist\">" +
33 " <span title=\"cnx/p:ADV\">" +
34 " <span title=\"cnx/syn:@PREMOD\">" +
35 " <span title=\"mate/l:meist\">" +
36 " <span title=\"mate/p:ADV\">" +
37 " <span title=\"opennlp/p:ADV\">meist</span>" +
38 " </span>" +
39 " </span>" +
40 " </span>" +
41 " </span>" +
42 "</span>" +
43 "<span title=\"cnx/l:deutlich\">" +
44 " <span title=\"cnx/p:A\">" +
45 " <span title=\"cnx/syn:@PREMOD\">" +
46 " <span title=\"mate/l:deutlich\">" +
47 " <span title=\"mate/m:degree:pos\">" +
48 " <span title=\"mate/p:ADJD\">" +
49 " <span title=\"opennlp/p:ADJD\">deutlich</span>" +
50 " </span>" +
51 " </span>" +
52 " </span>" +
53 " </span>" +
54 " </span>" +
55 "</span>" +
56 "<span title=\"cnx/l:fähig\">" +
57 " <span title=\"cnx/l:leistung\">" +
58 " <span title=\"cnx/p:A\">" +
59 " <span title=\"cnx/syn:@NH\">" +
60 " <span title=\"mate/l:leistungsfähig\">" +
61 " <span title=\"mate/m:degree:comp\">" +
62 " <span title=\"mate/p:ADJD\">" +
63 " <span title=\"opennlp/p:ADJD\">leistungsfähiger</span>" +
64 " </span>" +
65 " </span>" +
66 " </span>" +
67 " </span>" +
68 " </span>" +
69 " </span>" +
70 "</span>";
71
Nils Diewald6e43ffd2015-03-25 18:55:39 +000072var treeSnippet =
73 "<span class=\"context-left\"></span>" +
74 "<span class=\"match\">" +
75 " <span title=\"xip/c:MC\">" +
76 " <span title=\"xip/c:TOP\">" +
77 " <span title=\"xip/c:PP\">" +
78 " <span title=\"xip/c:PREP\">Mit</span>" +
79 " <span title=\"xip/c:NP\">" +
80 " <span title=\"xip/c:DET\">dieser</span>" +
81 " <span title=\"xip/c:NPA\">" +
82 " <span title=\"xip/c:NOUN\">Methode</span>" +
83 " </span>" +
84 " </span>" +
85 " </span>" +
86 " <span title=\"xip/c:VERB\">ist</span>" +
87 " <span title=\"xip/c:NP\">" +
88 " <span title=\"xip/c:PRON\">es</span>" +
89 " </span>" +
90 " <span title=\"xip/c:AP\">" +
91 " <span title=\"xip/c:ADV\">nun</span>" +
92 " <span title=\"xip/c:ADJ\">möglich</span>" +
93 " </span>" +
94 " <span title=\"xip/c:ADV\">z. B.</span>" +
95 " <span title=\"xip/c:NPA\">" +
96 " <span title=\"xip/c:NP\">" +
97 " <span title=\"xip/c:NOUN\">Voice</span>" +
98 " </span>" +
99 " </span>" + "(" +
100 " <span title=\"xip/c:INS\">" +
101 " <span title=\"xip/c:NPA\">" +
102 " <span title=\"xip/c:NP\">" +
103 " <span title=\"xip/c:NOUN\">Sprache</span>" +
104 " </span>" +
105 " </span>" +
106 " </span>" + ")" +
107 " <span title=\"xip/c:VERB\">bevorzugt</span>" +
108 " <span title=\"xip/c:PP\">" +
109 " <span title=\"xip/c:PREP\">in</span>" +
110 " <span title=\"xip/c:NP\">" +
111 " <span title=\"xip/c:PRON\">der</span>" +
112 " </span>" +
113 " <span title=\"xip/c:NPA\">" +
114 " <span title=\"xip/c:NP\">" +
115 " <span title=\"xip/c:NOUN\">Bridge</span>" +
116 " </span>" +
117 " </span>" +
118 " </span>" +
119 " <span title=\"xip/c:INFC\">" +
120 " <span title=\"xip/c:INS\">" +
121 " <span title=\"xip/c:VERB\">weiterzugeben</span>" +
122 " </span>" +
123 " </span>" +
124 " </span>" +
125 " </span>" +
126 "</span>" +
127 "<span class=\"context-right\"></span>";
Nils Diewald8bc7e412015-03-19 22:08:27 +0000128
Nils Diewald6e43ffd2015-03-25 18:55:39 +0000129var available =[
Nils Diewald8bc7e412015-03-19 22:08:27 +0000130 'base/s=spans',
131 'corenlp/c=spans',
132 'corenlp/ne=tokens',
133 'corenlp/p=tokens',
134 'corenlp/s=spans',
135 'glemm/l=tokens',
136 'mate/l=tokens',
137 'mate/m=tokens',
138 'mate/p=tokens',
139 'opennlp/p=tokens',
140 'opennlp/s=spans',
141 'tt/l=tokens',
142 'tt/p=tokens',
143 'tt/s=spans'
Nils Diewald6e43ffd2015-03-25 18:55:39 +0000144];
145
146var match = {
147 'corpusID' : 'WPD',
148 'docID' : 'UUU',
149 'textID' : '01912',
150 'pos' : 'p121-122'
151};
152
153// Parse and show the table
154// Override getMatchInfo API call
155KorAP.API.getMatchInfo = function(match, callObj) {
156 if (callObj["spans"] !== undefined && callObj["spans"] === true) {
157 return { "snippet": treeSnippet };
158 }
159 else {
160 return { "snippet": snippet };
161 }
162};
163
164var e = KorAP.MatchInfo.create(match, available).element();
165document.getElementsByTagName('body')[0].appendChild(e);
166
167/*
168var t = KorAP.MatchInfo.create(match, available).getTable();
169document.getElementsByClassName('matchtable')[0]
170.appendChild(t.element());
171
172// parse and show the tree
173KorAP.API.getMatchInfo = function() {
174 return { "snippet": treeSnippet };
175};
176
177var tree = KorAP.MatchInfo.create(match, available).getTree();
178document.getElementsByClassName('matchtree')[0]
179.getElementsByTagName('div')[0]
180.appendChild(tree.element());
181
182tree.center();
183*/
Nils Diewald8bc7e412015-03-19 22:08:27 +0000184 </script>
185
Nils Diewald6e43ffd2015-03-25 18:55:39 +0000186 <!--
Nils Diewald8bc7e412015-03-19 22:08:27 +0000187 <div class="matchinfo">
188 <div class="matchtable">
189 <table>
190 <thead>
191 <tr>
192 <th>Foundry</th>
193 <th>Layer</th>
194 <th>Ich</th>
195 <th>Du</th>
196 <th>Er</th>
197 </tr>
198 </thead>
199 <tbody>
200 <tr tabindex="0">
201 <th>Hallo</th>
202 <th>X</th>
203 <td>ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ</td>
204 <td>ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ<br />ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ</td>
205 <td>ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ</td>
206 </tr>
207 <tr tabindex="0">
208 <th>geht</th>
209 <th>y</th>
210 <td>ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ</td>
211 <td>ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ</td>
212 <td>ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ<br />ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ<br />ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ</td>
213 </tr>
214 <tr tabindex="0">
215 <th>es</th>
216 <th>z</th>
217 <td>ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ</td>
Nils Diewald6e43ffd2015-03-25 18:55:39 +0000218 <td>ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ</td>
219 <td>ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ<br />ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ<br />ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ</td>
220 </tr>
221 </tbody>
222 </table>
223 </div>
224 </div>
225 -->
Nils Diewald8bc7e412015-03-19 22:08:27 +0000226
227 </body>
228</html>