blob: 63bf45982527de7625669ccb8578c9252343e88d [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 Bingel2daf9862014-02-12 10:18:54 +0000233 "{@type=korap:group, operation=operation:and, operands=[" +
234 "{@type=korap:distance, key=w, min=1, max=4}," +
235 "{@type=korap:distance, key=s, min=0, max=0}," +
236 "{@type=korap:distance, key=p, min=1, max=3}" +
Joachim Bingel89cceac2014-01-08 15:51:08 +0000237 "]}" +
238 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000239 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000240 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
241 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
Joachim Bingel89cceac2014-01-08 15:51:08 +0000242 "]" +
243 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000244 ct = new CosmasTree(query);
245 map = ct.getRequestMap().get("query").toString();
Joachim Bingel89cceac2014-01-08 15:51:08 +0000246 assertEquals(prox2.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingel87480d02014-01-17 14:07:46 +0000247
248 query="Sonne %+w1:4,s0,p1:3 Mond";
249 String prox3 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000250 "{@type=korap:group, operation=operation:sequence, inOrder=true, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000251 "distances=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000252 "{@type=korap:group, operation=operation:and, operands=[" +
253 "{@type=korap:distance, key=w, min=1, max=4, exclude=true}," +
254 "{@type=korap:distance, key=s, min=0, max=0, exclude=true}," +
255 "{@type=korap:distance, key=p, min=1, max=3, exclude=true}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000256 "]}" +
257 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000258 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000259 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
260 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000261 "]" +
262 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000263 ct = new CosmasTree(query);
264 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000265 assertEquals(prox3.replaceAll(" ", ""), map.replaceAll(" ", ""));
266
267 query="Sonne /+w4 Mond";
268 String prox4 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000269 "{@type=korap:group, operation=operation:sequence, inOrder=true, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000270 "distances=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000271 "{@type=korap:distance, key=w, min=0, max=4}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000272 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000273 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000274 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
275 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000276 "]" +
277 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000278 ct = new CosmasTree(query);
279 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000280 assertEquals(prox4.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000281
282 query="Sonne /-w4 Mond";
283 String prox5 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000284 "{@type=korap:group, operation=operation:sequence, inOrder=true, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000285 "distances=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000286 "{@type=korap:distance, key=w, min=0, max=4}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000287 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000288 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000289 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}," +
290 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000291 "]" +
292 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000293 ct = new CosmasTree(query);
294 map = ct.getRequestMap().get("query").toString();
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000295 assertEquals(prox5.replaceAll(" ", ""), map.replaceAll(" ", ""));
296 }
297
298 @Test
Joachim Bingelba9a0ab2014-01-29 10:12:25 +0000299 public void testOPPROXNested() throws QueryException {
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000300 query="Sonne /-w4 Mond /+w2 Sterne";
301 String prox6 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000302 "{@type=korap:group, operation=operation:sequence, inOrder=true, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000303 "distances=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000304 "{@type=korap:distance, key=w, min=0, max=4}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000305 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000306 "operands=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000307 "{@type=korap:group, operation=operation:sequence, inOrder=true, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000308 "distances=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000309 "{@type=korap:distance, key=w, min=0, max=2}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000310 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000311 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000312 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}," +
313 "{@type=korap:token, wrap={@type=korap:term, key=Sterne, layer=orth, match=match:eq}}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000314 "]}," +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000315 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000316 "]" +
317 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000318 ct = new CosmasTree(query);
319 map = ct.getRequestMap().get("query").toString();
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000320 assertEquals(prox6.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000321 }
322
323 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000324 public void testOPIN() throws QueryException {
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000325 query="wegen #IN <s>";
Joachim Bingel3a9f7932014-01-07 17:11:31 +0000326 String opin1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000327 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands=[" +
328 "{@type=korap:group, operation=operation:position, frame=frame:contains, operands=[" +
329 "{@type=korap:span, key=s}," +
330 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000331 "{@type=korap:token, wrap={@type=korap:term, key=wegen, layer=orth, match=match:eq}}" +
Joachim Bingeleecc7652014-01-11 17:21:07 +0000332 "]}" +
333 "]}" +
Joachim Bingeld5161a12014-01-08 11:15:49 +0000334 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000335 ct = new CosmasTree(query);
336 map = ct.getRequestMap().get("query").toString();
Joachim Bingeld5161a12014-01-08 11:15:49 +0000337 assertEquals(opin1.replaceAll(" ", ""), map.replaceAll(" ", ""));
338
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000339 query="wegen #IN(L) <s>";
340 String opin2 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000341 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands=[" +
342 "{@type=korap:group, operation=operation:position, frame=frame:startswith, operands=[" +
343 "{@type=korap:span, key=s}," +
344 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000345 "{@type=korap:token, wrap={@type=korap:term, key=wegen, layer=orth, match=match:eq}}" +
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000346 "]}" +
347 "]}" +
348 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000349 ct = new CosmasTree(query);
350 map = ct.getRequestMap().get("query").toString();
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000351 assertEquals(opin2.replaceAll(" ", ""), map.replaceAll(" ", ""));
352
Joachim Bingel87480d02014-01-17 14:07:46 +0000353 query="wegen #IN(%, L) <s>";
354 String opin3 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000355 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands=[" +
356 "{@type=korap:group, operation=operation:position, frame=frame:startswith, exclude=true, operands=[" +
357 "{@type=korap:span, key=s}," +
358 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000359 "{@type=korap:token, wrap={@type=korap:term, key=wegen, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000360 "]}" +
361 "]}" +
362 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000363 ct = new CosmasTree(query);
364 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000365 assertEquals(opin3.replaceAll(" ", ""), map.replaceAll(" ", ""));
366
367 query="wegen #IN('FE,ALL,%,MIN') <s>";
368 String opin4 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000369 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands=[" +
370 "{@type=korap:group, operation=operation:position, frame=frame:matches, range=all, exclude=true, grouping=false, operands=[" +
371 "{@type=korap:span, key=s}," +
372 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000373 "{@type=korap:token, wrap={@type=korap:term, key=wegen, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000374 "]}" +
375 "]}" +
376 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000377 ct = new CosmasTree(query);
378 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000379 assertEquals(opin4.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingeld5161a12014-01-08 11:15:49 +0000380 }
381
382 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000383 public void testOPOV() throws QueryException {
Joachim Bingeld5161a12014-01-08 11:15:49 +0000384 query="wegen #OV <s>";
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000385 String opov1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000386 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands=[" +
387 "{@type=korap:group, operation=operation:position, frame=frame:overlaps, operands=[" +
388 "{@type=korap:span, key=s}," +
389 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000390 "{@type=korap:token, wrap={@type=korap:term, key=wegen, layer=orth, match=match:eq}}" +
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000391 "]}" +
392 "]}" +
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000393 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000394 ct = new CosmasTree(query);
395 map = ct.getRequestMap().get("query").toString();
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000396 assertEquals(opov1.replaceAll(" ", ""), map.replaceAll(" ", ""));
397
398 query="wegen #OV(L) <s>";
399 String opov2 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000400 "{@type=korap:group, operation=operation:submatch, classRef=[1], operands=[" +
401 "{@type=korap:group, operation=operation:position, frame=frame:overlaps-left, operands=[" +
402 "{@type=korap:span, key=s}," +
403 "{@type=korap:group, operation=operation:class, class=1, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000404 "{@type=korap:token, wrap={@type=korap:term, key=wegen, layer=orth, match=match:eq}}" +
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000405 "]}" +
406 "]}" +
407 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000408 ct = new CosmasTree(query);
409 map = ct.getRequestMap().get("query").toString();
Joachim Bingelcc1dc242014-01-15 09:32:38 +0000410 assertEquals(opov2.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000411 }
412
413 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000414 public void testOPNOT() throws QueryException {
Joachim Bingel3a9f7932014-01-07 17:11:31 +0000415 query="Sonne nicht Mond";
416 String opnot1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000417 "{@type=korap:group, operation=operation:not, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000418 "{@type=korap:token, wrap={@type=korap:term, key=Sonne, layer=orth, match=match:eq}}," +
419 "{@type=korap:token, wrap={@type=korap:term, key=Mond, layer=orth, match=match:eq}}" +
Joachim Bingel3a9f7932014-01-07 17:11:31 +0000420 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000421 ct = new CosmasTree(query);
422 map = ct.getRequestMap().get("query").toString();
Joachim Bingel3a9f7932014-01-07 17:11:31 +0000423 assertEquals(opnot1.replaceAll(" ", ""), map.replaceAll(" ", ""));
424 }
425
426 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000427 public void testBEG_END() throws QueryException {
Joachim Bingel3a9f7932014-01-07 17:11:31 +0000428 // BEG and END operators
429 // http://www.ids-mannheim.de/cosmas2/web-app/hilfe/suchanfrage/eingabe-zeile/syntax/links.html
430 // http://www.ids-mannheim.de/cosmas2/web-app/hilfe/suchanfrage/eingabe-zeile/syntax/rechts.html
431 // http://www.ids-mannheim.de/cosmas2/web-app/hilfe/suchanfrage/eingabe-zeile/thematische-bsp/bsp-satzlaenge.html
Joachim Bingel87480d02014-01-17 14:07:46 +0000432 query="#BEG(der /w3:5 Mann)";
433 String beg1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000434 "{@type=korap:group, operation=operation:submatch, @spanRef=[0,1], operands=[" +
435 "{@type=korap:group, operation=operation:sequence, inOrder=false, distances=[" +
436 "{@type=korap:distance, key=w, min=3, max=5}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000437 "]," +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000438 "operands = [" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000439 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
440 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000441 "]}" +
442 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000443 ct = new CosmasTree(query);
444 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000445 assertEquals(beg1.replaceAll(" ", ""), map.replaceAll(" ", ""));
446
447 query="#BEG(der /w3:5 Mann) /+w10 kommt"; // nesting #BEG() in a distance group
448 String beg2 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000449 "{@type=korap:group, operation=operation:sequence, inOrder=true, distances=[" +
450 "{@type=korap:distance, key=w, min=0, max=10}" +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000451 "], operands=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000452 "{@type=korap:group, operation=operation:submatch, @spanRef=[0,1], operands=[" +
453 "{@type=korap:group, operation=operation:sequence, inOrder=false, distances=[" +
454 "{@type=korap:distance, key=w, min=3, max=5}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000455 "]," +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000456 "operands = [" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000457 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
458 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000459 "]}" +
460 "]}," +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000461 "{@type=korap:token, wrap={@type=korap:term, key=kommt, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000462 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000463 ct = new CosmasTree(query);
464 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000465 assertEquals(beg2.replaceAll(" ", ""), map.replaceAll(" ", ""));
466
467 query="#END(der /w3:5 Mann)";
468 String end1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000469 "{@type=korap:group, operation=operation:submatch, @spanRef=[-1,1], operands=[" +
470 "{@type=korap:group, operation=operation:sequence, inOrder=false, distances=[" +
471 "{@type=korap:distance, key=w, min=3, max=5}" +
Joachim Bingelba9a0ab2014-01-29 10:12:25 +0000472 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000473 "operands = [" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000474 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
475 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}" +
Joachim Bingel87480d02014-01-17 14:07:46 +0000476 "]}" +
477 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000478 ct = new CosmasTree(query);
479 map = ct.getRequestMap().get("query").toString();
Joachim Bingel87480d02014-01-17 14:07:46 +0000480 assertEquals(end1.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000481 }
Joachim Bingeld5161a12014-01-08 11:15:49 +0000482
483
484 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000485 public void testELEM() throws QueryException {
Joachim Bingeld5161a12014-01-08 11:15:49 +0000486 // http://www.ids-mannheim.de/cosmas2/web-app/hilfe/suchanfrage/eingabe-zeile/syntax/elem.html
Joachim Bingeleecc7652014-01-11 17:21:07 +0000487 query="#ELEM(S)";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000488 String elem1 = "{@type=korap:span, key=s}";
489 ct = new CosmasTree(query);
490 map = ct.getRequestMap().get("query").toString();
Joachim Bingeleecc7652014-01-11 17:21:07 +0000491 assertEquals(elem1.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingeld5161a12014-01-08 11:15:49 +0000492 }
493
494 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000495 public void testOPALL() throws QueryException {
Joachim Bingel89cceac2014-01-08 15:51:08 +0000496 query="#ALL(gehen /w1:10 voran)";
Joachim Bingele98d0882014-01-21 12:58:54 +0000497 String all1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000498 "{@type=korap:group, operation=operation:sequence, inOrder=false, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000499 "distances=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000500 "{@type=korap:distance, key=w, min=1, max=10}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000501 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000502 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000503 "{@type=korap:token, wrap={@type=korap:term, key=gehen, layer=orth, match=match:eq}}," +
504 "{@type=korap:token, wrap={@type=korap:term, key=voran, layer=orth, match=match:eq}}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000505 "]" +
506 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000507 ct = new CosmasTree(query);
508 map = ct.getRequestMap().get("query").toString();
Joachim Bingel89cceac2014-01-08 15:51:08 +0000509 assertEquals(all1.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingeld5161a12014-01-08 11:15:49 +0000510 }
511
Joachim Bingel8c640e42014-02-07 16:20:47 +0000512// @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000513 public void testOPNHIT() throws QueryException {
Joachim Bingel89cceac2014-01-08 15:51:08 +0000514 query="#NHIT(gehen /w1:10 voran)";
515 String nhit1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000516 "{@type=korap:group, operation=operation:sequence, inOrder=false, " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000517 "distances=[" +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000518 "{@type=korap:distance, key=w, min=1, max=10}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000519 "], " +
Joachim Bingel11d5b152014-02-11 21:33:47 +0000520 "operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000521 "{@type=korap:token, wrap={@type=korap:term, key=gehen, layer=orth, match=match:eq}}," +
522 "{@type=korap:token, wrap={@type=korap:term, key=voran, layer=orth, match=match:eq}}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000523 "]" +
524 "}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000525 ct = new CosmasTree(query);
526 map = ct.getRequestMap().get("query").toString();
Joachim Bingel89cceac2014-01-08 15:51:08 +0000527 assertEquals(nhit1.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingeld5161a12014-01-08 11:15:49 +0000528 }
529
530 @Test
Joachim Bingel87480d02014-01-17 14:07:46 +0000531 public void testOPBED() throws QueryException {
Joachim Bingeleecc7652014-01-11 17:21:07 +0000532 query = "#BED(der , sa)";
533 String bed1 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000534 "{@type=korap:group, operation=operation:position, frame=frame:startswith, operands=[" +
535 "{@type=korap:span, key=s}," +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000536 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}" +
Joachim Bingeleecc7652014-01-11 17:21:07 +0000537 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000538 ct = new CosmasTree(query);
539 map = ct.getRequestMap().get("query").toString();
Joachim Bingeleecc7652014-01-11 17:21:07 +0000540 assertEquals(bed1.replaceAll(" ", ""), map.replaceAll(" ", ""));
541
542 query = "#BED(der Mann , +pe)";
543 String bed2 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000544 "{@type=korap:group, operation=operation:position, frame=frame:endswith, operands=[" +
545 "{@type=korap:span, key=p}," +
546 "{@type=korap:group, operation=operation:sequence, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000547 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
548 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000549 "]}" +
Joachim Bingeleecc7652014-01-11 17:21:07 +0000550 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000551 ct = new CosmasTree(query);
552 map = ct.getRequestMap().get("query").toString();
Joachim Bingeleecc7652014-01-11 17:21:07 +0000553 assertEquals(bed2.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000554
555 query = "#BED(der Mann , sa,-pa)";
556 String bed3 =
Joachim Bingel2daf9862014-02-12 10:18:54 +0000557 "{@type=korap:group, operation=operation:and, operands=[" +
558 "{@type=korap:group, operation=operation:position, frame=frame:startswith, operands=[" +
559 "{@type=korap:span, key=s}," +
560 "{@type=korap:group, operation=operation:sequence, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000561 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
562 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000563 "]}" +
564 "]}," +
Joachim Bingel2daf9862014-02-12 10:18:54 +0000565 "{@type=korap:group, operation=operation:position, frame=frame:startswith, exclude=true, operands=[" +
566 "{@type=korap:span, key=p}," +
567 "{@type=korap:group, operation=operation:sequence, operands=[" +
Joachim Bingelee3b21d2014-02-12 12:34:59 +0000568 "{@type=korap:token, wrap={@type=korap:term, key=der, layer=orth, match=match:eq}}," +
569 "{@type=korap:token, wrap={@type=korap:term, key=Mann, layer=orth, match=match:eq}}" +
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000570 "]}" +
571 "]}" +
572 "]}";
Joachim Bingel2daf9862014-02-12 10:18:54 +0000573 ct = new CosmasTree(query);
574 map = ct.getRequestMap().get("query").toString();
Joachim Bingel3f0850c2014-01-17 16:50:10 +0000575 assertEquals(bed3.replaceAll(" ", ""), map.replaceAll(" ", ""));
Joachim Bingeld5161a12014-01-08 11:15:49 +0000576 }
577
Joachim Bingelb5f7bf02014-01-07 16:36:54 +0000578}
579