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