blob: a84bfebb925c07af9ca232ac81fe11ce10709449 [file] [log] [blame]
Akron15175132017-09-07 18:12:55 +02001var treeSnippet =
2 "<span class=\"context-left\"></span>" +
3 "<span class=\"match\">" +
4 " <span title=\"xip/c:MC\">" +
5 " <span title=\"xip/c:TOP\">" +
6 " <span title=\"xip/c:PP\">" +
7 " <span title=\"xip/c:PREP\">Mit</span>" +
8 " <span title=\"xip/c:NP\">" +
9 " <span title=\"xip/c:DET\">dieser</span>" +
10 " <span title=\"xip/c:NPA\">" +
11 " <span title=\"xip/c:NOUN\">Methode</span>" +
12 " </span>" +
13 " </span>" +
14 " </span>" +
15 " <span title=\"xip/c:VERB\">ist</span>" +
16 " <span title=\"xip/c:NP\">" +
17 " <span title=\"xip/c:PRON\">es</span>" +
18 " </span>" +
19 " <span title=\"xip/c:AP\">" +
20 " <span title=\"xip/c:ADV\">nun</span>" +
21 " <span title=\"xip/c:ADJ\">möglich</span>" +
22 " </span>" +
23 " <span title=\"xip/c:ADV\">z. B.</span>" +
24 " <span title=\"xip/c:NPA\">" +
25 " <span title=\"xip/c:NP\">" +
26 " <span title=\"xip/c:NOUN\">Voice</span>" +
27 " </span>" +
28 " </span>" + "(" +
29 " <span title=\"xip/c:INS\">" +
30 " <span title=\"xip/c:NPA\">" +
31 " <span title=\"xip/c:NP\">" +
32 " <span title=\"xip/c:NOUN\">Sprache</span>" +
33 " </span>" +
34 " </span>" +
35 " </span>" + ")" +
36 " <span title=\"xip/c:VERB\">bevorzugt</span>" +
37 " <span title=\"xip/c:PP\">" +
38 " <span title=\"xip/c:PREP\">in</span>" +
39 " <span title=\"xip/c:NP\">" +
40 " <span title=\"xip/c:PRON\">der</span>" +
41 " </span>" +
42 " <span title=\"xip/c:NPA\">" +
43 " <span title=\"xip/c:NP\">" +
44 " <span title=\"xip/c:NOUN\">Bridge</span>" +
45 " </span>" +
46 " </span>" +
47 " </span>" +
48 " <span title=\"xip/c:INFC\">" +
49 " <span title=\"xip/c:INS\">" +
50 " <span title=\"xip/c:VERB\">weiterzugeben</span>" +
51 " </span>" +
52 " </span>" +
53 " </span>" +
54 " </span>" +
55 "</span>" +
56 "<span class=\"context-right\"></span>";
57
Akron21896622017-09-12 16:22:23 +020058var relSnippet =
59 "<span class=\"context-left\"></span>" +
60 "<span class=\"match\">" +
61 " <span xml:id=\"token-GOE/AGA/01784-p199\">" +
62 " <span xlink:title=\"malt/d:ADV\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p199\">dann</span>" +
63 " </span>" +
64 " zog " +
65 " <span xlink:title=\"malt/d:SUBJ\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p199\">ich</span>" +
66 " <span xml:id=\"token-GOE/AGA/01784-p202\">" +
67 " <span xlink:title=\"malt/d:OBJA\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p199\">mich</span>" +
68 " </span>" +
69 " <span xlink:title=\"malt/d:PP\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p199\">gegen</span>" +
70 " <span xml:id=\"token-GOE/AGA/01784-p204\">" +
71 " <span xlink:title=\"malt/d:DET\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p204\">das</span>" +
72 " </span>" +
73 " <span xlink:title=\"malt/d:PN\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p202\">Regiment</span>" +
74 " <span xml:id=\"token-GOE/AGA/01784-p206\">" +
75 " <span xlink:title=\"malt/d:AVZ\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p199\">zurück</span>" +
76 " </span>" +
77 " <span xml:id=\"token-GOE/AGA/01784-p207\">" +
78 " <span xlink:title=\"malt/d:KON\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p199\">und</span>" +
79 " </span>" +
80 " <span xml:id=\"token-GOE/AGA/01784-p208\">" +
81 " <span xlink:title=\"malt/d:CJ\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p206\">war</span>" +
82 " </span>" +
83 " <span xlink:title=\"malt/d:AUX\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p207\">bemüht</span>" +
84 "," +
85 " <span xlink:title=\"malt/d:DET\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p211\">einige</span>" +
86 " <span xml:id=\"token-GOE/AGA/01784-p211\">" +
87 " <span xlink:title=\"malt/d:ATTR\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p211\">genaue</span>" +
88 " </span>" +
89 " <span xml:id=\"token-GOE/AGA/01784-p212\">" +
90 " <span xlink:title=\"malt/d:OBJA\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p215\">Umrisse</span>" +
91 " </span>" +
92 " <span xlink:title=\"malt/d:OBJP\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p215\">aufs</span>" +
93 " <span xlink:title=\"malt/d:PN\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p212\">Papier</span>" +
94 " <span xml:id=\"token-GOE/AGA/01784-p215\">" +
95 " <span xlink:title=\"malt/d:PART\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p215\">zu</span>" +
96 " </span>" +
97 " <span xlink:title=\"malt/d:OBJI\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p208\">bringen</span>" +
98 ", um mir " +
99 " <span xml:id=\"token-GOE/AGA/01784-p219\">" +
100 " <span xlink:title=\"malt/d:DET\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p219\">die</span>" +
101 " </span>" +
102 " <span xml:id=\"token-GOE/AGA/01784-p220\">Bezüge</span>" +
103 " <span xlink:title=\"malt/d:KON\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p219\">und</span>" +
104 " <span xml:id=\"token-GOE/AGA/01784-p222\">" +
105 " <span xlink:title=\"malt/d:DET\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p222\">die</span>" +
106 " </span>" +
107 " <span xlink:title=\"malt/d:CJ\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p220\">Distanzen</span>" +
108 " <mark>" +
109 " <span xlink:title=\"malt/d:DET\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p225\">der</span>" +
110 " </mark>" +
111 " <span xml:id=\"token-GOE/AGA/01784-p225\">" +
112 " <span xlink:title=\"malt/d:ATTR\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p225\">landschaftlichen</span>" +
113 " </span>" +
114 " <span xml:id=\"token-GOE/AGA/01784-p226\">" +
115 " <span xlink:title=\"malt/d:GMOD\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p222\">Gegenstände</span>" +
116 " </span>" +
117 " <span xlink:title=\"malt/d:KON\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p219\">desto</span>" +
118 " <span xlink:title=\"malt/d:ADV\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p229\">besser</span>" +
119 " <span xml:id=\"token-GOE/AGA/01784-p229\">" +
120 " <span xlink:title=\"malt/d:PART\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p229\">zu</span>" +
121 " </span>" +
122 " <span xlink:title=\"malt/d:CJ\" xlink:type=\"simple\" xlink:href=\"#token-GOE/AGA/01784-p226\">imprimieren</span>" +
123 "</span>" +
124 "<span class=\"context-right\"></span>";
125
126
Akronf5dc5102017-05-16 20:32:57 +0200127requirejs.config({
Akron15175132017-09-07 18:12:55 +0200128 baseUrl: '../js/src',
129 paths : {
130 'lib': '../lib'
131 }
Akronf5dc5102017-05-16 20:32:57 +0200132});
133
Akron15175132017-09-07 18:12:55 +0200134require(['match/relations', 'match/tree'], function (relClass, treeClass) {
Akronf5dc5102017-05-16 20:32:57 +0200135 var rel = relClass.create();
Akron3a4a08e2017-05-23 22:34:18 +0200136
137 /*
138 * Start and end may be spans, i.e. arrays
139 */
140
141 rel
142 .addToken("Der")
143 .addToken("alte")
144 .addToken("Mann")
145 .addToken("ging")
146 .addToken("über")
147 .addToken("die")
148 .addToken("breite")
149 .addToken("nasse")
150 .addToken("Straße")
151 ;
152
153 rel
Akron65d31082017-09-08 16:23:40 +0200154 .addRel({ start: 0, end: 1, label: "a", direction: "uni"})
155 .addRel({ start: 0, end: 1, label: "b", direction: "uni" })
Akron3a4a08e2017-05-23 22:34:18 +0200156 .addRel({ start: 1, end: 2, label: "c", direction: "bi" })
Akron65d31082017-09-08 16:23:40 +0200157 .addRel({ start: 0, end: 2, label: "dreizehn", direction: "uni" })
158 .addRel({ start: [2,4], end: 5, label: "e", direction: "uni" })
Akron6f1302b2017-09-13 12:46:02 +0200159 .addRel({ start: [5,6], end: 7, direction: "uni" })
Akron3a4a08e2017-05-23 22:34:18 +0200160 .addRel({ start: 4, end: [6,8], label: "f", direction: "bi" })
Akronfee0b622017-09-13 14:46:43 +0200161 .addRel({ start: 8, end: 8, label: "self", direction: "uni"})
Akron3a4a08e2017-05-23 22:34:18 +0200162 ;
Akron15175132017-09-07 18:12:55 +0200163
164 document.getElementById("treeRel").appendChild(rel.element());
165
166 // Todo: Probably rename to rel.draw()
Akronf5dc5102017-05-16 20:32:57 +0200167 rel.show();
Akron15175132017-09-07 18:12:55 +0200168
Akronfee0b622017-09-13 14:46:43 +0200169 /*
Akron671fdb92017-09-12 18:09:46 +0200170 var rel2 = relClass.create(relSnippet);
171 document.getElementById("treeRel2").appendChild(rel2.element());
172 rel2.show();
173
Akron15175132017-09-07 18:12:55 +0200174 var tree = treeClass.create(treeSnippet);
175 document.getElementById("treeHier").appendChild(tree.element());
Akronfee0b622017-09-13 14:46:43 +0200176 */
Akronf5dc5102017-05-16 20:32:57 +0200177});
Akron15175132017-09-07 18:12:55 +0200178