blob: 17fcfb38b2376a425bd3b54ba8d7d4aaa0206408 [file] [log] [blame]
Akronf5dc5102017-05-16 20:32:57 +02001requirejs.config({
2 baseUrl: '../js/src'
3});
4
5require(['match/relations'], function (relClass) {
6 var rel = relClass.create();
7 document.getElementById("tree").appendChild(rel.element());
Akron3a4a08e2017-05-23 22:34:18 +02008
9 /*
10 * Start and end may be spans, i.e. arrays
11 */
12
13 rel
14 .addToken("Der")
15 .addToken("alte")
16 .addToken("Mann")
17 .addToken("ging")
18 .addToken("über")
19 .addToken("die")
20 .addToken("breite")
21 .addToken("nasse")
22 .addToken("Straße")
23 ;
24
25 rel
26 .addRel({ start: 0, end: 1, label: "a"})
27 .addRel({ start: 0, end: 1, label: "b" })
28 .addRel({ start: 1, end: 2, label: "c", direction: "bi" })
29 .addRel({ start: 0, end: 2, label: "d" })
30 .addRel({ start: [2,4], end: 5, label: "e", direction: "uni" })
31 .addRel({ start: [5,6], end: 7, label: "g" })
32 .addRel({ start: 4, end: [6,8], label: "f", direction: "bi" })
33 ;
34
Akronf5dc5102017-05-16 20:32:57 +020035 rel.show();
36});