blob: 1a350ea05f672c60c0d66b2eb66ade73448b34f0 [file] [log] [blame]
Joachim Bingelb5f7bf02014-01-07 16:36:54 +00001import static org.junit.Assert.*;
2
3import org.junit.Test;
4
5import de.ids_mannheim.korap.query.serialize.CosmasTree;
Joachim Bingelb5f7bf02014-01-07 16:36:54 +00006import de.ids_mannheim.korap.util.QueryException;
7
8public class CosmasTreeTest {
9
Joachim Bingel2daf9862014-02-12 10:18:54 +000010 CosmasTree ct;
Joachim Bingelb5f7bf02014-01-07 16:36:54 +000011 String map;
12 String query;
13
14 private boolean equalsContent(String str, Object map) {
15 str = str.replaceAll(" ", "");
16 String mapStr = map.toString().replaceAll(" ", "");
17 return str.equals(mapStr);
18 }
19
20 private boolean equalsQueryContent(String res, String query) throws QueryException {
21 res = res.replaceAll(" ", "");
Joachim Bingel2daf9862014-02-12 10:18:54 +000022 ct = new CosmasTree(query);
23 String queryMap = ct.getRequestMap().get("query").toString().replaceAll(" ", "");
Joachim Bingelb5f7bf02014-01-07 16:36:54 +000024 return res.equals(queryMap);
25 }
26
Joachim Bingel11d5b152014-02-11 21:33:47 +000027// @Test
Joachim Bingelb5f7bf02014-01-07 16:36:54 +000028 public void testContext() throws QueryException {
Joachim Bingel2daf9862014-02-12 10:18:54 +000029 String contextString = "{korap = http://korap.ids-mannheim.de/ns/KorAP/json-ld/v0.1/, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +000030 "boundary = korap:boundary/,"+
31 "group = korap:group/,"+
32 "operation = {@id = group:operation/, @type = @id},"+
33 "class = {@id = group:class, @type = xsd:integer},"+
34 "operands = {@id = group:operands, @container = @list},"+
Joachim Bingel2daf9862014-02-12 10:18:54 +000035 "frame = {@id = group:frame/, @type = @id},"+
Joachim Bingel11d5b152014-02-11 21:33:47 +000036 "classRef = {@id = group:classRef, @type = xsd:integer},"+
37 "spanRef = {@id = group:spanRef, @type = xsd:integer},"+
38 "classRefOp = {@id = group:classRefOp, @type = @id},"+
39 "min = {@id = boundary:min, @type = xsd:integer},"+
40 "max = {@id = boundary:max, @type = xsd:integer},"+
41 "exclude = {@id = group:exclude, @type = xsd:boolean},"+
42 "distances = {@id = group:distances, @container = @list},"+
Joachim Bingel2daf9862014-02-12 10:18:54 +000043 "inOrder = {@id = group:inOrder, @type = xsd:boolean}"+
Joachim Bingel11d5b152014-02-11 21:33:47 +000044 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +000045 ct = new CosmasTree("Test");
46 assertEquals(contextString.replaceAll(" ", ""), ct.getRequestMap().get("@context").toString().replaceAll(" ", ""));
Joachim Bingelb5f7bf02014-01-07 16:36:54 +000047 }
48
49
50 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +000051 public void testSingleToken() throws QueryException {
Joachim Bingelb5f7bf02014-01-07 16:36:54 +000052 query="der";
53 String single1 =
Joachim Bingelee3b21d2014-02-12 12:34:59 +000054 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}";
Joachim Bingel2daf9862014-02-12 10:18:54 +000055 ct = new CosmasTree(query);
56 map = ct.getRequestMap().get("query").toString();
Joachim Bingelb5f7bf02014-01-07 16:36:54 +000057 assertEquals(single1.replaceAll(" ", ""), map.replaceAll(" ", ""));
58
59 query="Mann";
60 String single2 =
Joachim Bingelee3b21d2014-02-12 12:34:59 +000061 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}";
Joachim Bingel2daf9862014-02-12 10:18:54 +000062 ct = new CosmasTree(query);
63 map = ct.getRequestMap().get("query").toString();
Joachim Bingelb5f7bf02014-01-07 16:36:54 +000064 assertEquals(single2.replaceAll(" ", ""), map.replaceAll(" ", ""));
65
66 query="&Mann";
67 String single3 =
Joachim Bingelee3b21d2014-02-12 12:34:59 +000068 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=lemma, match=match:eq}}";
Joachim Bingel2daf9862014-02-12 10:18:54 +000069 ct = new CosmasTree(query);
70 map = ct.getRequestMap().get("query").toString();
Joachim Bingelb5f7bf02014-01-07 16:36:54 +000071 assertEquals(single3.replaceAll(" ", ""), map.replaceAll(" ", ""));
72 }
73
Joachim Bingelba9a0ab2014-01-29 10:12:25 +000074 @Test
Joachim Bingel8c640e42014-02-07 16:20:47 +000075 public void testCaseSensitivityFlag() throws QueryException {
Joachim Bingel0207d5e2014-02-12 14:18:41 +000076 query="$deutscher";
77 String cs1 =
78 "{@type=korap:token, wrap={@type=korap:term, caseInsensitive=true, key=deutscher, layer=orth, match=match:eq}}";
79 ct = new CosmasTree(query);
80 map = ct.getRequestMap().get("query").toString();
81 assertEquals(cs1.replaceAll(" ", ""), map.replaceAll(" ", ""));
82
83 query="$deutscher Bundestag";
84 String cs2 =
85 "{@type=korap:group, operation=operation:sequence, operands=[" +
86 "{@type=korap:token, wrap={@type=korap:term, caseInsensitive=true, key=deutscher, layer=orth, match=match:eq}}," +
87 "{@type=korap:token, wrap={@type=korap:term, key=Bundestag, layer=orth, match=match:eq}}" +
88 "]}";
89 ct = new CosmasTree(query);
90 map = ct.getRequestMap().get("query").toString();
91 assertEquals(cs2.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingel8c640e42014-02-07 16:20:47 +000092 }
93
94 @Test
Joachim Bingelffd65e32014-01-22 14:22:57 +000095 public void testMORPH() throws QueryException {
96 query="#MORPH(V)";
97 String morph1 =
Joachim Bingel0207d5e2014-02-12 14:18:41 +000098 "{@type=korap:token, wrap={@type=korap:term, key=V, layer=pos, match=match:eq}}";
Joachim Bingel2daf9862014-02-12 10:18:54 +000099 ct = new CosmasTree(query);
100 map = ct.getRequestMap().get("query").toString();
Joachim Bingelffd65e32014-01-22 14:22:57 +0000101 assertEquals(morph1.replaceAll(" ", ""), map.replaceAll(" ", ""));
102 }
103
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000104 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000105 public void testSequence() throws QueryException {
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000106 query="der Mann";
107 String seq1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000108 "{@type=korap:group, operation=operation:sequence, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000109 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
110 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}" +
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000111 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000112 ct = new CosmasTree(query);
113 map = ct.getRequestMap().get("query").toString();
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000114 assertEquals(seq1.replaceAll(" ", ""), map.replaceAll(" ", ""));
115
Joachim Bingeld5161a12014-01-08 11:15:49 +0000116 query="der Mann schläft";
117 String seq2 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000118 "{@type=korap:group, operation=operation:sequence, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000119 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
120 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}," +
121 "{@type=korap:token, wrap={@type=korap:term, key=schläft, layer=orth, match=match:eq}}" +
Joachim Bingeld5161a12014-01-08 11:15:49 +0000122 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000123 ct = new CosmasTree(query);
124 map = ct.getRequestMap().get("query").toString();
Joachim Bingeld5161a12014-01-08 11:15:49 +0000125 assertEquals(seq2.replaceAll(" ", ""), map.replaceAll(" ", ""));
126
127 query="der Mann schläft lang";
128 String seq3 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000129 "{@type=korap:group, operation=operation:sequence, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000130 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
131 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}," +
132 "{@type=korap:token, wrap={@type=korap:term, key=schläft, layer=orth, match=match:eq}}," +
133 "{@type=korap:token, wrap={@type=korap:term, key=lang, layer=orth, match=match:eq}}" +
Joachim Bingeld5161a12014-01-08 11:15:49 +0000134 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000135 ct = new CosmasTree(query);
136 map = ct.getRequestMap().get("query").toString();
Joachim Bingeld5161a12014-01-08 11:15:49 +0000137 assertEquals(seq3.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000138 }
139
140 @Test
141 public void testOPOR() throws QueryException {
142 query="Sonne oder Mond";
143 String disj1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000144 "{@type=korap:group, operation=operation:or, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000145 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
146 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000147 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000148 ct = new CosmasTree(query);
149 map = ct.getRequestMap().get("query").toString();
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000150 assertEquals(disj1.replaceAll(" ", ""), map.replaceAll(" ", ""));
151
Joachim Bingeld5161a12014-01-08 11:15:49 +0000152 query="(Sonne scheint) oder Mond";
153 String disj2 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000154 "{@type=korap:group, operation=operation:or, operands=[" +
155 "{@type=korap:group, operation=operation:sequence, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000156 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
157 "{@type=korap:token, wrap={@type=korap:term, key=scheint, layer=orth, match=match:eq}}" +
Joachim Bingeld5161a12014-01-08 11:15:49 +0000158 "]}," +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000159 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
Joachim Bingeld5161a12014-01-08 11:15:49 +0000160 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000161 ct = new CosmasTree(query);
162 map = ct.getRequestMap().get("query").toString();
Joachim Bingeld5161a12014-01-08 11:15:49 +0000163 assertEquals(disj2.replaceAll(" ", ""), map.replaceAll(" ", ""));
164
165 query="(Sonne scheint) oder (Mond scheint)";
166 String disj3 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000167 "{@type=korap:group, operation=operation:or, operands=[" +
168 "{@type=korap:group, operation=operation:sequence, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000169 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
170 "{@type=korap:token, wrap={@type=korap:term, key=scheint, layer=orth, match=match:eq}}" +
Joachim Bingeld5161a12014-01-08 11:15:49 +0000171 "]}," +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000172 "{@type=korap:group, operation=operation:sequence, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000173 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}," +
174 "{@type=korap:token, wrap={@type=korap:term, key=scheint, layer=orth, match=match:eq}}" +
Joachim Bingeld5161a12014-01-08 11:15:49 +0000175 "]}" +
176 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000177 ct = new CosmasTree(query);
178 map = ct.getRequestMap().get("query").toString();
Joachim Bingeld5161a12014-01-08 11:15:49 +0000179 assertEquals(disj3.replaceAll(" ", ""), map.replaceAll(" ", ""));
180
181 }
182
183 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000184 public void testOPORAND() throws QueryException {
Joachim Bingeld5161a12014-01-08 11:15:49 +0000185 query="(Sonne oder Mond) und scheint";
186 String orand1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000187 "{@type=korap:group, operation=operation:and, operands=[" +
188 "{@type=korap:group, operation=operation:or, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000189 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
190 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
Joachim Bingeld5161a12014-01-08 11:15:49 +0000191 "]}," +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000192 "{@type=korap:token, wrap={@type=korap:term, key=scheint, layer=orth, match=match:eq}}" +
Joachim Bingeld5161a12014-01-08 11:15:49 +0000193 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000194 ct = new CosmasTree(query);
195 map = ct.getRequestMap().get("query").toString();
Joachim Bingeld5161a12014-01-08 11:15:49 +0000196 assertEquals(orand1.replaceAll(" ", ""), map.replaceAll(" ", ""));
197
198 query="scheint und (Sonne oder Mond)";
199 String orand2 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000200 "{@type=korap:group, operation=operation:and, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000201 "{@type=korap:token, wrap={@type=korap:term, key=scheint, layer=orth, match=match:eq}}," +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000202 "{@type=korap:group, operation=operation:or, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000203 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
204 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
Joachim Bingeld5161a12014-01-08 11:15:49 +0000205 "]}" +
206 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000207 ct = new CosmasTree(query);
208 map = ct.getRequestMap().get("query").toString();
Joachim Bingeld5161a12014-01-08 11:15:49 +0000209 assertEquals(orand2.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000210 }
211
212 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000213 public void testOPPROX() throws QueryException {
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000214 query="Sonne /+w1:4 Mond";
215 String prox1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000216 "{@type=korap:group, operation=operation:sequence, inOrder=true, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000217 "distances=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000218 "{@type=korap:distance, key=w, min=1, max=4}" +
Joachim Bingel89cceac2014-01-08 15:51:08 +0000219 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000220 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000221 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
222 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
Joachim Bingel89cceac2014-01-08 15:51:08 +0000223 "]" +
224 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000225 ct = new CosmasTree(query);
226 map = ct.getRequestMap().get("query").toString();
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000227 assertEquals(prox1.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingel89cceac2014-01-08 15:51:08 +0000228
229 query="Sonne /+w1:4,s0,p1:3 Mond";
230 String prox2 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000231 "{@type=korap:group, operation=operation:sequence, inOrder=true, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000232 "distances=[" +
Joachim Bingelcd7b7252014-02-13 08:49:14 +0000233 "{@type=korap:distance, key=w, min=1, max=4}," +
234 "{@type=korap:distance, key=s, min=0, max=0}," +
235 "{@type=korap:distance, key=p, min=1, max=3}" +
Joachim Bingel89cceac2014-01-08 15:51:08 +0000236 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000237 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000238 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
239 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
Joachim Bingel89cceac2014-01-08 15:51:08 +0000240 "]" +
241 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000242 ct = new CosmasTree(query);
243 map = ct.getRequestMap().get("query").toString();
Joachim Bingel89cceac2014-01-08 15:51:08 +0000244 assertEquals(prox2.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingel87480d02014-01-17 14:07:46 +0000245
246 query="Sonne %+w1:4,s0,p1:3 Mond";
247 String prox3 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000248 "{@type=korap:group, operation=operation:sequence, inOrder=true, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000249 "distances=[" +
Joachim Bingelcd7b7252014-02-13 08:49:14 +0000250 "{@type=korap:distance, key=w, min=1, max=4, exclude=true}," +
251 "{@type=korap:distance, key=s, min=0, max=0, exclude=true}," +
252 "{@type=korap:distance, key=p, min=1, max=3, exclude=true}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000253 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000254 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000255 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
256 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000257 "]" +
258 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000259 ct = new CosmasTree(query);
260 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000261 assertEquals(prox3.replaceAll(" ", ""), map.replaceAll(" ", ""));
262
263 query="Sonne /+w4 Mond";
264 String prox4 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000265 "{@type=korap:group, operation=operation:sequence, inOrder=true, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000266 "distances=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000267 "{@type=korap:distance, key=w, min=0, max=4}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000268 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000269 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000270 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
271 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000272 "]" +
273 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000274 ct = new CosmasTree(query);
275 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000276 assertEquals(prox4.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000277
278 query="Sonne /-w4 Mond";
279 String prox5 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000280 "{@type=korap:group, operation=operation:sequence, inOrder=true, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000281 "distances=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000282 "{@type=korap:distance, key=w, min=0, max=4}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000283 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000284 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000285 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}," +
286 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000287 "]" +
288 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000289 ct = new CosmasTree(query);
290 map = ct.getRequestMap().get("query").toString();
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000291 assertEquals(prox5.replaceAll(" ", ""), map.replaceAll(" ", ""));
292 }
293
294 @Test
Joachim Bingelba9a0ab2014-01-29 10:12:25 +0000295 public void testOPPROXNested() throws QueryException {
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000296 query="Sonne /-w4 Mond /+w2 Sterne";
297 String prox6 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000298 "{@type=korap:group, operation=operation:sequence, inOrder=true, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000299 "distances=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000300 "{@type=korap:distance, key=w, min=0, max=4}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000301 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000302 "operands=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000303 "{@type=korap:group, operation=operation:sequence, inOrder=true, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000304 "distances=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000305 "{@type=korap:distance, key=w, min=0, max=2}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000306 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000307 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000308 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}," +
309 "{@type=korap:token, wrap={@type=korap:term, key=Sterne, layer=orth, match=match:eq}}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000310 "]}," +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000311 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000312 "]" +
313 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000314 ct = new CosmasTree(query);
315 map = ct.getRequestMap().get("query").toString();
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000316 assertEquals(prox6.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000317 }
318
319 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000320 public void testOPIN() throws QueryException {
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000321 query="wegen #IN <s>";
Joachim Bingel3a9f7932014-01-07 17:11:31 +0000322 String opin1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000323 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands=[" +
324 "{@type=korap:group, operation=operation:position, frame=frame:contains, operands=[" +
325 "{@type=korap:span, key=s}," +
326 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000327 "{@type=korap:token, wrap={@type=korap:term, key=wegen, layer=orth, match=match:eq}}" +
Joachim Bingeleecc7652014-01-11 17:21:07 +0000328 "]}" +
329 "]}" +
Joachim Bingeld5161a12014-01-08 11:15:49 +0000330 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000331 ct = new CosmasTree(query);
332 map = ct.getRequestMap().get("query").toString();
Joachim Bingeld5161a12014-01-08 11:15:49 +0000333 assertEquals(opin1.replaceAll(" ", ""), map.replaceAll(" ", ""));
334
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000335 query="wegen #IN(L) <s>";
336 String opin2 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000337 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands=[" +
338 "{@type=korap:group, operation=operation:position, frame=frame:startswith, operands=[" +
339 "{@type=korap:span, key=s}," +
340 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000341 "{@type=korap:token, wrap={@type=korap:term, key=wegen, layer=orth, match=match:eq}}" +
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000342 "]}" +
343 "]}" +
344 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000345 ct = new CosmasTree(query);
346 map = ct.getRequestMap().get("query").toString();
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000347 assertEquals(opin2.replaceAll(" ", ""), map.replaceAll(" ", ""));
348
Joachim Bingel87480d02014-01-17 14:07:46 +0000349 query="wegen #IN(%, L) <s>";
350 String opin3 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000351 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands=[" +
352 "{@type=korap:group, operation=operation:position, frame=frame:startswith, exclude=true, operands=[" +
353 "{@type=korap:span, key=s}," +
354 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000355 "{@type=korap:token, wrap={@type=korap:term, key=wegen, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000356 "]}" +
357 "]}" +
358 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000359 ct = new CosmasTree(query);
360 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000361 assertEquals(opin3.replaceAll(" ", ""), map.replaceAll(" ", ""));
362
363 query="wegen #IN('FE,ALL,%,MIN') <s>";
364 String opin4 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000365 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands=[" +
366 "{@type=korap:group, operation=operation:position, frame=frame:matches, range=all, exclude=true, grouping=false, operands=[" +
367 "{@type=korap:span, key=s}," +
368 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000369 "{@type=korap:token, wrap={@type=korap:term, key=wegen, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000370 "]}" +
371 "]}" +
372 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000373 ct = new CosmasTree(query);
374 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000375 assertEquals(opin4.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingeld5161a12014-01-08 11:15:49 +0000376 }
377
378 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000379 public void testOPOV() throws QueryException {
Joachim Bingeld5161a12014-01-08 11:15:49 +0000380 query="wegen #OV <s>";
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000381 String opov1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000382 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands=[" +
383 "{@type=korap:group, operation=operation:position, frame=frame:overlaps, operands=[" +
384 "{@type=korap:span, key=s}," +
385 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000386 "{@type=korap:token, wrap={@type=korap:term, key=wegen, layer=orth, match=match:eq}}" +
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000387 "]}" +
388 "]}" +
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000389 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000390 ct = new CosmasTree(query);
391 map = ct.getRequestMap().get("query").toString();
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000392 assertEquals(opov1.replaceAll(" ", ""), map.replaceAll(" ", ""));
393
394 query="wegen #OV(L) <s>";
395 String opov2 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000396 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands=[" +
397 "{@type=korap:group, operation=operation:position, frame=frame:overlaps-left, operands=[" +
398 "{@type=korap:span, key=s}," +
399 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000400 "{@type=korap:token, wrap={@type=korap:term, key=wegen, layer=orth, match=match:eq}}" +
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000401 "]}" +
402 "]}" +
403 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000404 ct = new CosmasTree(query);
405 map = ct.getRequestMap().get("query").toString();
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000406 assertEquals(opov2.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000407 }
408
409 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000410 public void testOPNOT() throws QueryException {
Joachim Bingel3a9f7932014-01-07 17:11:31 +0000411 query="Sonne nicht Mond";
412 String opnot1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000413 "{@type=korap:group, operation=operation:not, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000414 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
415 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
Joachim Bingel3a9f7932014-01-07 17:11:31 +0000416 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000417 ct = new CosmasTree(query);
418 map = ct.getRequestMap().get("query").toString();
Joachim Bingel3a9f7932014-01-07 17:11:31 +0000419 assertEquals(opnot1.replaceAll(" ", ""), map.replaceAll(" ", ""));
420 }
421
422 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000423 public void testBEG_END() throws QueryException {
Joachim Bingel3a9f7932014-01-07 17:11:31 +0000424 // BEG and END operators
425 // http://www.ids-mannheim.de/cosmas2/web-app/hilfe/suchanfrage/eingabe-zeile/syntax/links.html
426 // http://www.ids-mannheim.de/cosmas2/web-app/hilfe/suchanfrage/eingabe-zeile/syntax/rechts.html
427 // http://www.ids-mannheim.de/cosmas2/web-app/hilfe/suchanfrage/eingabe-zeile/thematische-bsp/bsp-satzlaenge.html
Joachim Bingel87480d02014-01-17 14:07:46 +0000428 query="#BEG(der /w3:5 Mann)";
429 String beg1 =
Joachim Bingelcd7b7252014-02-13 08:49:14 +0000430 "{@type=korap:group, operation=operation:submatch, spanRef=[0,1], operands=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000431 "{@type=korap:group, operation=operation:sequence, inOrder=false, distances=[" +
432 "{@type=korap:distance, key=w, min=3, max=5}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000433 "]," +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000434 "operands = [" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000435 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
436 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000437 "]}" +
438 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000439 ct = new CosmasTree(query);
440 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000441 assertEquals(beg1.replaceAll(" ", ""), map.replaceAll(" ", ""));
442
443 query="#BEG(der /w3:5 Mann) /+w10 kommt"; // nesting #BEG() in a distance group
444 String beg2 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000445 "{@type=korap:group, operation=operation:sequence, inOrder=true, distances=[" +
446 "{@type=korap:distance, key=w, min=0, max=10}" +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000447 "], operands=[" +
Joachim Bingelcd7b7252014-02-13 08:49:14 +0000448 "{@type=korap:group, operation=operation:submatch, spanRef=[0,1], operands=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000449 "{@type=korap:group, operation=operation:sequence, inOrder=false, distances=[" +
450 "{@type=korap:distance, key=w, min=3, max=5}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000451 "]," +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000452 "operands = [" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000453 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
454 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000455 "]}" +
456 "]}," +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000457 "{@type=korap:token, wrap={@type=korap:term, key=kommt, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000458 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000459 ct = new CosmasTree(query);
460 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000461 assertEquals(beg2.replaceAll(" ", ""), map.replaceAll(" ", ""));
462
463 query="#END(der /w3:5 Mann)";
464 String end1 =
Joachim Bingelcd7b7252014-02-13 08:49:14 +0000465 "{@type=korap:group, operation=operation:submatch, spanRef=[-1,1], operands=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000466 "{@type=korap:group, operation=operation:sequence, inOrder=false, distances=[" +
467 "{@type=korap:distance, key=w, min=3, max=5}" +
Joachim Bingelba9a0ab2014-01-29 10:12:25 +0000468 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000469 "operands = [" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000470 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
471 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000472 "]}" +
473 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000474 ct = new CosmasTree(query);
475 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000476 assertEquals(end1.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000477 }
Joachim Bingeld5161a12014-01-08 11:15:49 +0000478
479
480 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000481 public void testELEM() throws QueryException {
Joachim Bingeld5161a12014-01-08 11:15:49 +0000482 // http://www.ids-mannheim.de/cosmas2/web-app/hilfe/suchanfrage/eingabe-zeile/syntax/elem.html
Joachim Bingeleecc7652014-01-11 17:21:07 +0000483 query="#ELEM(S)";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000484 String elem1 = "{@type=korap:span, key=s}";
485 ct = new CosmasTree(query);
486 map = ct.getRequestMap().get("query").toString();
Joachim Bingeleecc7652014-01-11 17:21:07 +0000487 assertEquals(elem1.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingeld5161a12014-01-08 11:15:49 +0000488 }
489
490 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000491 public void testOPALL() throws QueryException {
Joachim Bingel89cceac2014-01-08 15:51:08 +0000492 query="#ALL(gehen /w1:10 voran)";
Joachim Bingele98d0882014-01-21 12:58:54 +0000493 String all1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000494 "{@type=korap:group, operation=operation:sequence, inOrder=false, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000495 "distances=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000496 "{@type=korap:distance, key=w, min=1, max=10}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000497 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000498 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000499 "{@type=korap:token, wrap={@type=korap:term, key=gehen, layer=orth, match=match:eq}}," +
500 "{@type=korap:token, wrap={@type=korap:term, key=voran, layer=orth, match=match:eq}}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000501 "]" +
502 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000503 ct = new CosmasTree(query);
504 map = ct.getRequestMap().get("query").toString();
Joachim Bingel89cceac2014-01-08 15:51:08 +0000505 assertEquals(all1.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingeld5161a12014-01-08 11:15:49 +0000506 }
507
Joachim Bingel36233b52014-02-13 10:48:24 +0000508 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000509 public void testOPNHIT() throws QueryException {
Joachim Bingel89cceac2014-01-08 15:51:08 +0000510 query="#NHIT(gehen /w1:10 voran)";
511 String nhit1 =
Joachim Bingel36233b52014-02-13 10:48:24 +0000512 "{@type=korap:group, operation=operation:submatch, classRef=[1,2], classRefOp=classRefOp:intersection, operands=[" +
513 "{@type=korap:group, operation=operation:sequence, inOrder=false, " +
514 "distances=[" +
515 "{@type=korap:distance, key=w, min=1, max=10}" +
516 "], " +
517 "operands=[" +
518 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
519 "{@type=korap:token, wrap={@type=korap:term, key=gehen, layer=orth, match=match:eq}}" +
520 "]}," +
521 "{@type=korap:group, operation=operation:class, class=2, operands=[" +
522 "{@type=korap:token, wrap={@type=korap:term, key=voran, layer=orth, match=match:eq}}" +
523 "]}" +
524 "]" +
525 "}" +
526 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000527 ct = new CosmasTree(query);
528 map = ct.getRequestMap().get("query").toString();
Joachim Bingel89cceac2014-01-08 15:51:08 +0000529 assertEquals(nhit1.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingeld5161a12014-01-08 11:15:49 +0000530 }
531
532 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000533 public void testOPBED() throws QueryException {
Joachim Bingeleecc7652014-01-11 17:21:07 +0000534 query = "#BED(der , sa)";
535 String bed1 =
Joachim Bingelcd7b7252014-02-13 08:49:14 +0000536 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands= [" +
537 "{@type=korap:group, operation=operation:position, frame=frame:startswith, operands=[" +
538 "{@type=korap:span, key=s}," +
539 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
540 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}" +
541 "]}" +
542 "]}" +
Joachim Bingeleecc7652014-01-11 17:21:07 +0000543 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000544 ct = new CosmasTree(query);
545 map = ct.getRequestMap().get("query").toString();
Joachim Bingeleecc7652014-01-11 17:21:07 +0000546 assertEquals(bed1.replaceAll(" ", ""), map.replaceAll(" ", ""));
547
548 query = "#BED(der Mann , +pe)";
549 String bed2 =
Joachim Bingel36233b52014-02-13 10:48:24 +0000550 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands= [" +
551 "{@type=korap:group, operation=operation:position, frame=frame:endswith, operands=[" +
552 "{@type=korap:span, key=p}," +
553 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
554 "{@type=korap:group, operation=operation:sequence, operands=[" +
555 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
556 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}" +
557 "]}" +
558 "]}" +
559 "]}" +
560 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000561 ct = new CosmasTree(query);
562 map = ct.getRequestMap().get("query").toString();
Joachim Bingel36233b52014-02-13 10:48:24 +0000563 assertEquals(bed2.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000564
565 query = "#BED(der Mann , sa,-pa)";
566 String bed3 =
Joachim Bingel36233b52014-02-13 10:48:24 +0000567 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands=[" +
568 "{@type=korap:group, operation=operation:sequence, distances=[" +
569 "{@type=korap:distance, key=w, min=0, max=0}" +
570 "], operands=[" +
571 "{@type=korap:group, operation=operation:position, frame=frame:startswith, operands=[" +
572 "{@type=korap:span, key=s}," +
573 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
574 "{@type=korap:group, operation=operation:sequence, operands=[" +
575 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
576 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}" +
577 "]}" +
578 "]}" +
579 "]}," +
580 "{@type=korap:group, operation=operation:position, frame=frame:startswith, exclude=true, operands=[" +
581 "{@type=korap:span, key=p}," +
582 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
583 "{@type=korap:group, operation=operation:sequence, operands=[" +
584 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
585 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}" +
586 "]}" +
587 "]}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000588 "]}" +
589 "]}" +
590 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000591 ct = new CosmasTree(query);
592 map = ct.getRequestMap().get("query").toString();
Joachim Bingel36233b52014-02-13 10:48:24 +0000593 assertEquals(bed3.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingeld5161a12014-01-08 11:15:49 +0000594 }
595
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000596}
597