blob: 373b0ee6d4c078eb72d58c76d07cf7653d92cf87 [file] [log] [blame]
Nils Diewald8bc7e412015-03-19 22:08:27 +00001<!DOCTYPE html>
2<html>
3 <head>
Nils Diewalda297f062015-04-02 00:23:46 +00004 <title>Match demo</title>
Nils Diewald8bc7e412015-03-19 22:08:27 +00005 <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 Diewalda297f062015-04-02 00:23:46 +00008 <script src="../src/match.js"></script>
9 <link type="text/css"
10 rel="stylesheet"
11 href="../../css/font-awesome.min.css"></link>
12 <link type="text/css"
13 rel="stylesheet"
14 href="../../css/build/kalamar.css"></link>
15 <style type="text/css"
16 rel="stylesheet">
Nils Diewald8bc7e412015-03-19 22:08:27 +000017
18body {
19 background-color: #ffa500;
Nils Diewald6e43ffd2015-03-25 18:55:39 +000020}
21
22body, text {
Nils Diewald8bc7e412015-03-19 22:08:27 +000023 font-family: tahoma, verdana, arial;
Nils Diewald6e43ffd2015-03-25 18:55:39 +000024 color: #444;
25}
26
27text {
28 fill: #444;
Nils Diewald8bc7e412015-03-19 22:08:27 +000029}
30
31 </style>
32 </head>
33 <body>
34
Nils Diewald8bc7e412015-03-19 22:08:27 +000035 <script>
36var snippet = "<span title=\"cnx/l:meist\">" +
37 " <span title=\"cnx/p:ADV\">" +
38 " <span title=\"cnx/syn:@PREMOD\">" +
39 " <span title=\"mate/l:meist\">" +
40 " <span title=\"mate/p:ADV\">" +
41 " <span title=\"opennlp/p:ADV\">meist</span>" +
42 " </span>" +
43 " </span>" +
44 " </span>" +
45 " </span>" +
46 "</span>" +
47 "<span title=\"cnx/l:deutlich\">" +
48 " <span title=\"cnx/p:A\">" +
49 " <span title=\"cnx/syn:@PREMOD\">" +
50 " <span title=\"mate/l:deutlich\">" +
51 " <span title=\"mate/m:degree:pos\">" +
52 " <span title=\"mate/p:ADJD\">" +
53 " <span title=\"opennlp/p:ADJD\">deutlich</span>" +
54 " </span>" +
55 " </span>" +
56 " </span>" +
57 " </span>" +
58 " </span>" +
59 "</span>" +
60 "<span title=\"cnx/l:fähig\">" +
61 " <span title=\"cnx/l:leistung\">" +
62 " <span title=\"cnx/p:A\">" +
63 " <span title=\"cnx/syn:@NH\">" +
64 " <span title=\"mate/l:leistungsfähig\">" +
65 " <span title=\"mate/m:degree:comp\">" +
66 " <span title=\"mate/p:ADJD\">" +
67 " <span title=\"opennlp/p:ADJD\">leistungsfähiger</span>" +
68 " </span>" +
69 " </span>" +
70 " </span>" +
71 " </span>" +
72 " </span>" +
73 " </span>" +
74 "</span>";
75
Nils Diewald6e43ffd2015-03-25 18:55:39 +000076var treeSnippet =
77 "<span class=\"context-left\"></span>" +
78 "<span class=\"match\">" +
79 " <span title=\"xip/c:MC\">" +
80 " <span title=\"xip/c:TOP\">" +
81 " <span title=\"xip/c:PP\">" +
82 " <span title=\"xip/c:PREP\">Mit</span>" +
83 " <span title=\"xip/c:NP\">" +
84 " <span title=\"xip/c:DET\">dieser</span>" +
85 " <span title=\"xip/c:NPA\">" +
86 " <span title=\"xip/c:NOUN\">Methode</span>" +
87 " </span>" +
88 " </span>" +
89 " </span>" +
90 " <span title=\"xip/c:VERB\">ist</span>" +
91 " <span title=\"xip/c:NP\">" +
92 " <span title=\"xip/c:PRON\">es</span>" +
93 " </span>" +
94 " <span title=\"xip/c:AP\">" +
95 " <span title=\"xip/c:ADV\">nun</span>" +
96 " <span title=\"xip/c:ADJ\">möglich</span>" +
97 " </span>" +
98 " <span title=\"xip/c:ADV\">z. B.</span>" +
99 " <span title=\"xip/c:NPA\">" +
100 " <span title=\"xip/c:NP\">" +
101 " <span title=\"xip/c:NOUN\">Voice</span>" +
102 " </span>" +
103 " </span>" + "(" +
104 " <span title=\"xip/c:INS\">" +
105 " <span title=\"xip/c:NPA\">" +
106 " <span title=\"xip/c:NP\">" +
107 " <span title=\"xip/c:NOUN\">Sprache</span>" +
108 " </span>" +
109 " </span>" +
110 " </span>" + ")" +
111 " <span title=\"xip/c:VERB\">bevorzugt</span>" +
112 " <span title=\"xip/c:PP\">" +
113 " <span title=\"xip/c:PREP\">in</span>" +
114 " <span title=\"xip/c:NP\">" +
115 " <span title=\"xip/c:PRON\">der</span>" +
116 " </span>" +
117 " <span title=\"xip/c:NPA\">" +
118 " <span title=\"xip/c:NP\">" +
119 " <span title=\"xip/c:NOUN\">Bridge</span>" +
120 " </span>" +
121 " </span>" +
122 " </span>" +
123 " <span title=\"xip/c:INFC\">" +
124 " <span title=\"xip/c:INS\">" +
125 " <span title=\"xip/c:VERB\">weiterzugeben</span>" +
126 " </span>" +
127 " </span>" +
128 " </span>" +
129 " </span>" +
130 "</span>" +
131 "<span class=\"context-right\"></span>";
Nils Diewald8bc7e412015-03-19 22:08:27 +0000132
Nils Diewald6e43ffd2015-03-25 18:55:39 +0000133var available =[
Nils Diewald8bc7e412015-03-19 22:08:27 +0000134 'base/s=spans',
135 'corenlp/c=spans',
136 'corenlp/ne=tokens',
137 'corenlp/p=tokens',
138 'corenlp/s=spans',
139 'glemm/l=tokens',
140 'mate/l=tokens',
141 'mate/m=tokens',
142 'mate/p=tokens',
143 'opennlp/p=tokens',
144 'opennlp/s=spans',
145 'tt/l=tokens',
146 'tt/p=tokens',
147 'tt/s=spans'
Nils Diewald6e43ffd2015-03-25 18:55:39 +0000148];
149
150var match = {
151 'corpusID' : 'WPD',
152 'docID' : 'UUU',
153 'textID' : '01912',
Nils Diewalda297f062015-04-02 00:23:46 +0000154 'pos' : 'p121-122',
155 'available' : available
Nils Diewald6e43ffd2015-03-25 18:55:39 +0000156};
157
158// Parse and show the table
159// Override getMatchInfo API call
160KorAP.API.getMatchInfo = function(match, callObj) {
161 if (callObj["spans"] !== undefined && callObj["spans"] === true) {
162 return { "snippet": treeSnippet };
163 }
164 else {
165 return { "snippet": snippet };
166 }
167};
168
Nils Diewalda297f062015-04-02 00:23:46 +0000169var e = KorAP.Match.create(match).open();
Nils Diewaldea236742015-03-26 21:55:36 +0000170
171document.getElementsByTagName('body')[0].appendChild(e.element());
172
Nils Diewaldea236742015-03-26 21:55:36 +0000173e.addTree('cnx', 'c');
Nils Diewald6e43ffd2015-03-25 18:55:39 +0000174
Nils Diewalda297f062015-04-02 00:23:46 +0000175
176
Nils Diewald6e43ffd2015-03-25 18:55:39 +0000177/*
178var t = KorAP.MatchInfo.create(match, available).getTable();
179document.getElementsByClassName('matchtable')[0]
180.appendChild(t.element());
181
182// parse and show the tree
183KorAP.API.getMatchInfo = function() {
184 return { "snippet": treeSnippet };
185};
186
187var tree = KorAP.MatchInfo.create(match, available).getTree();
188document.getElementsByClassName('matchtree')[0]
189.getElementsByTagName('div')[0]
190.appendChild(tree.element());
191
192tree.center();
193*/
Nils Diewald8bc7e412015-03-19 22:08:27 +0000194 </script>
195
Nils Diewald6e43ffd2015-03-25 18:55:39 +0000196 <!--
Nils Diewald8bc7e412015-03-19 22:08:27 +0000197 <div class="matchinfo">
198 <div class="matchtable">
199 <table>
200 <thead>
201 <tr>
202 <th>Foundry</th>
203 <th>Layer</th>
204 <th>Ich</th>
205 <th>Du</th>
206 <th>Er</th>
207 </tr>
208 </thead>
209 <tbody>
210 <tr tabindex="0">
211 <th>Hallo</th>
212 <th>X</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<br />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</td>
216 </tr>
217 <tr tabindex="0">
218 <th>geht</th>
219 <th>y</th>
220 <td>ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ</td>
221 <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 <tr tabindex="0">
225 <th>es</th>
226 <th>z</th>
227 <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 +0000228 <td>ABC DEF GHI JKL MNO PQR STU VWX YZ ABC DEF GHI JKL MNO PQR STU VWX YZ</td>
229 <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>
230 </tr>
231 </tbody>
232 </table>
233 </div>
234 </div>
235 -->
Nils Diewald8bc7e412015-03-19 22:08:27 +0000236
237 </body>
238</html>