Nils Diewald | 8bc7e41 | 2015-03-19 22:08:27 +0000 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>MatchInfo demo</title> |
| 5 | <meta charset="utf-8" /> |
Nils Diewald | 6e43ffd | 2015-03-25 18:55:39 +0000 | [diff] [blame] | 6 | <script src="../lib/dagre/dagre.min.js"></script> |
| 7 | <script src="../src/menu.js"></script> |
Nils Diewald | 8bc7e41 | 2015-03-19 22:08:27 +0000 | [diff] [blame] | 8 | <script src="../src/matchInfo.js"></script> |
Nils Diewald | 6e43ffd | 2015-03-25 18:55:39 +0000 | [diff] [blame] | 9 | <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 Diewald | 8bc7e41 | 2015-03-19 22:08:27 +0000 | [diff] [blame] | 12 | <style type="text/css" rel="stylesheet"> |
| 13 | |
| 14 | body { |
| 15 | background-color: #ffa500; |
Nils Diewald | 6e43ffd | 2015-03-25 18:55:39 +0000 | [diff] [blame] | 16 | } |
| 17 | |
| 18 | body, text { |
Nils Diewald | 8bc7e41 | 2015-03-19 22:08:27 +0000 | [diff] [blame] | 19 | font-family: tahoma, verdana, arial; |
Nils Diewald | 6e43ffd | 2015-03-25 18:55:39 +0000 | [diff] [blame] | 20 | color: #444; |
| 21 | } |
| 22 | |
| 23 | text { |
| 24 | fill: #444; |
Nils Diewald | 8bc7e41 | 2015-03-19 22:08:27 +0000 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | </style> |
| 28 | </head> |
| 29 | <body> |
| 30 | |
Nils Diewald | 8bc7e41 | 2015-03-19 22:08:27 +0000 | [diff] [blame] | 31 | <script> |
| 32 | var 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 Diewald | 6e43ffd | 2015-03-25 18:55:39 +0000 | [diff] [blame] | 72 | var 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 Diewald | 8bc7e41 | 2015-03-19 22:08:27 +0000 | [diff] [blame] | 128 | |
Nils Diewald | 6e43ffd | 2015-03-25 18:55:39 +0000 | [diff] [blame] | 129 | var available =[ |
Nils Diewald | 8bc7e41 | 2015-03-19 22:08:27 +0000 | [diff] [blame] | 130 | '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 Diewald | 6e43ffd | 2015-03-25 18:55:39 +0000 | [diff] [blame] | 144 | ]; |
| 145 | |
| 146 | var 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 |
| 155 | KorAP.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 | |
| 164 | var e = KorAP.MatchInfo.create(match, available).element(); |
| 165 | document.getElementsByTagName('body')[0].appendChild(e); |
| 166 | |
| 167 | /* |
| 168 | var t = KorAP.MatchInfo.create(match, available).getTable(); |
| 169 | document.getElementsByClassName('matchtable')[0] |
| 170 | .appendChild(t.element()); |
| 171 | |
| 172 | // parse and show the tree |
| 173 | KorAP.API.getMatchInfo = function() { |
| 174 | return { "snippet": treeSnippet }; |
| 175 | }; |
| 176 | |
| 177 | var tree = KorAP.MatchInfo.create(match, available).getTree(); |
| 178 | document.getElementsByClassName('matchtree')[0] |
| 179 | .getElementsByTagName('div')[0] |
| 180 | .appendChild(tree.element()); |
| 181 | |
| 182 | tree.center(); |
| 183 | */ |
Nils Diewald | 8bc7e41 | 2015-03-19 22:08:27 +0000 | [diff] [blame] | 184 | </script> |
| 185 | |
Nils Diewald | 6e43ffd | 2015-03-25 18:55:39 +0000 | [diff] [blame] | 186 | <!-- |
Nils Diewald | 8bc7e41 | 2015-03-19 22:08:27 +0000 | [diff] [blame] | 187 | <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 Diewald | 6e43ffd | 2015-03-25 18:55:39 +0000 | [diff] [blame] | 218 | <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 Diewald | 8bc7e41 | 2015-03-19 22:08:27 +0000 | [diff] [blame] | 226 | |
| 227 | </body> |
| 228 | </html> |