Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 1 | import static org.junit.Assert.*; |
Michael Hanl | f1fead4 | 2014-05-14 15:13:33 +0000 | [diff] [blame] | 2 | import de.ids_mannheim.korap.query.serialize.CollectionQueryTree; |
Michael Hanl | f1fead4 | 2014-05-14 15:13:33 +0000 | [diff] [blame] | 3 | import de.ids_mannheim.korap.util.QueryException; |
Michael Hanl | f1fead4 | 2014-05-14 15:13:33 +0000 | [diff] [blame] | 4 | import org.junit.Test; |
| 5 | |
| 6 | public class CollectionQueryTreeTest { |
| 7 | |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 8 | CollectionQueryTree cqt; |
| 9 | String map; |
| 10 | private String query; |
| 11 | private String expected; |
Michael Hanl | f1fead4 | 2014-05-14 15:13:33 +0000 | [diff] [blame] | 12 | |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 13 | private boolean equalsQueryContent(String res, String query) throws QueryException { |
| 14 | res = res.replaceAll(" ", ""); |
| 15 | cqt = new CollectionQueryTree(); |
| 16 | cqt.process(query); |
| 17 | String queryMap = cqt.getRequestMap().get("query").toString().replaceAll(" ", ""); |
| 18 | return res.equals(queryMap); |
| 19 | } |
Michael Hanl | f1fead4 | 2014-05-14 15:13:33 +0000 | [diff] [blame] | 20 | |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 21 | @Test |
| 22 | public void testSimple() throws QueryException { |
| 23 | query = "textClass=Sport"; |
| 24 | // String regex1 = "{@type=korap:filter, filter={@type=korap:doc, attribute=textClass, key=Sport, match=match:eq}}"; |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 25 | expected = "{@type=korap:doc, key=textClass, value=Sport, match=match:eq}"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 26 | cqt = new CollectionQueryTree(); |
| 27 | cqt.process(query); |
| 28 | map = cqt.getRequestMap().toString(); |
| 29 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 30 | |
| 31 | query = "textClass!=Sport"; |
| 32 | // String regex1 = "{@type=korap:filter, filter={@type=korap:doc, attribute=textClass, key=Sport, match=match:eq}}"; |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 33 | expected = "{@type=korap:doc, key=textClass, value=Sport, match=match:ne}"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 34 | cqt = new CollectionQueryTree(); |
| 35 | cqt.process(query); |
| 36 | map = cqt.getRequestMap().toString(); |
| 37 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 38 | } |
| 39 | |
| 40 | @Test |
| 41 | public void testTwoConjuncts() throws QueryException { |
| 42 | query = "textClass=Sport & year=2014"; |
| 43 | expected = |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 44 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 45 | "{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," + |
| 46 | "{@type=korap:doc, key=year, value=2014, match=match:eq}" + |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 47 | "]}"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 48 | cqt = new CollectionQueryTree(); |
| 49 | cqt.process(query); |
| 50 | map = cqt.getRequestMap().toString(); |
| 51 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 52 | } |
| 53 | |
| 54 | @Test |
| 55 | public void testThreeConjuncts() throws QueryException { |
| 56 | query = "textClass=Sport & year=2014 & corpusID=WPD"; |
| 57 | expected = |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 58 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 59 | "{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," + |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 60 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 61 | "{@type=korap:doc, key=year, value=2014, match=match:eq}," + |
| 62 | "{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}" + |
| 63 | "]}" + |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 64 | "]}"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 65 | cqt = new CollectionQueryTree(); |
| 66 | cqt.process(query); |
| 67 | map = cqt.getRequestMap().toString(); |
| 68 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 69 | } |
| 70 | |
| 71 | |
| 72 | @Test |
| 73 | public void testTwoDisjuncts() throws QueryException { |
| 74 | query = "textClass=Sport | year=2014"; |
| 75 | expected = |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 76 | "{@type=korap:docGroup, operation=operation:or, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 77 | "{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," + |
| 78 | "{@type=korap:doc, key=year, value=2014, match=match:eq}" + |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 79 | "]}"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 80 | cqt = new CollectionQueryTree(); |
| 81 | cqt.process(query); |
| 82 | map = cqt.getRequestMap().toString(); |
| 83 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 84 | } |
| 85 | |
| 86 | @Test |
| 87 | public void testThreeDisjuncts() throws QueryException { |
| 88 | query = "textClass=Sport | year=2014 | corpusID=WPD"; |
| 89 | expected = |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 90 | "{@type=korap:docGroup, operation=operation:or, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 91 | "{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," + |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 92 | "{@type=korap:docGroup, operation=operation:or, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 93 | "{@type=korap:doc, key=year, value=2014, match=match:eq}," + |
| 94 | "{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}" + |
| 95 | "]}" + |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 96 | "]}"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 97 | cqt = new CollectionQueryTree(); |
| 98 | cqt.process(query); |
| 99 | map = cqt.getRequestMap().toString(); |
| 100 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 101 | } |
Michael Hanl | f1fead4 | 2014-05-14 15:13:33 +0000 | [diff] [blame] | 102 | |
| 103 | |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 104 | @Test |
| 105 | public void testMixed() throws QueryException { |
| 106 | query = "(textClass=Sport | textClass=ausland) & corpusID=WPD"; |
| 107 | expected = |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 108 | |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 109 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
| 110 | "{@type=korap:docGroup, operation=operation:or, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 111 | "{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," + |
| 112 | "{@type=korap:doc, key=textClass, value=ausland, match=match:eq}" + |
| 113 | "]}," + |
| 114 | "{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}" + |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 115 | "]}"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 116 | cqt = new CollectionQueryTree(); |
| 117 | cqt.process(query); |
| 118 | map = cqt.getRequestMap().toString(); |
| 119 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 120 | |
| 121 | query = "(textClass=Sport & textClass=ausland) & corpusID=WPD"; |
| 122 | expected = |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 123 | |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 124 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
| 125 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 126 | "{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," + |
| 127 | "{@type=korap:doc, key=textClass, value=ausland, match=match:eq}" + |
| 128 | "]}," + |
| 129 | "{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}" + |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 130 | "]}"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 131 | cqt = new CollectionQueryTree(); |
| 132 | cqt.process(query); |
| 133 | map = cqt.getRequestMap().toString(); |
| 134 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 135 | |
| 136 | query = "(textClass=Sport & textClass=ausland) | (corpusID=WPD & author=White)"; |
| 137 | expected = |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 138 | |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 139 | "{@type=korap:docGroup, operation=operation:or, operands=[" + |
| 140 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 141 | "{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," + |
| 142 | "{@type=korap:doc, key=textClass, value=ausland, match=match:eq}" + |
| 143 | "]}," + |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 144 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 145 | "{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}," + |
| 146 | "{@type=korap:doc, key=author, value=White, match=match:eq}" + |
| 147 | "]}" + |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 148 | "]}"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 149 | cqt = new CollectionQueryTree(); |
| 150 | cqt.process(query); |
| 151 | map = cqt.getRequestMap().toString(); |
| 152 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 153 | |
| 154 | query = "(textClass=Sport & textClass=ausland) | (corpusID=WPD & author=White & year=2010)"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 155 | expected = |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 156 | "{@type=korap:docGroup, operation=operation:or, operands=[" + |
| 157 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 158 | "{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," + |
| 159 | "{@type=korap:doc, key=textClass, value=ausland, match=match:eq}" + |
| 160 | "]}," + |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 161 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 162 | "{@type=korap:doc, key=corpusID, value=WPD, match=match:eq}," + |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 163 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 164 | "{@type=korap:doc, key=author, value=White, match=match:eq}," + |
| 165 | "{@type=korap:doc, key=year, value=2010, match=match:eq}" + |
| 166 | "]}" + |
| 167 | "]}" + |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 168 | "]}"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 169 | cqt = new CollectionQueryTree(); |
| 170 | cqt.process(query); |
| 171 | map = cqt.getRequestMap().toString(); |
| 172 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 173 | } |
Michael Hanl | f1fead4 | 2014-05-14 15:13:33 +0000 | [diff] [blame] | 174 | |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 175 | @Test |
| 176 | public void testDate() throws QueryException { |
| 177 | // search for pubDate between 1990 and 2010! |
| 178 | query = "1990<pubDate<2010"; |
| 179 | expected = |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 180 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 181 | "{@type=korap:doc, key=pubDate, value=1990, match=match:gt}," + |
| 182 | "{@type=korap:doc, key=pubDate, value=2010, match=match:lt}" + |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 183 | "]}"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 184 | cqt = new CollectionQueryTree(); |
| 185 | cqt.process(query); |
| 186 | map = cqt.getRequestMap().toString(); |
| 187 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 188 | |
| 189 | query = "pubDate>=1990"; |
| 190 | expected = |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 191 | "{@type=korap:doc, key=pubDate, value=1990, match=match:geq}"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 192 | cqt = new CollectionQueryTree(); |
| 193 | cqt.process(query); |
| 194 | map = cqt.getRequestMap().toString(); |
| 195 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | 624854b | 2014-07-23 13:53:28 +0000 | [diff] [blame] | 196 | |
| 197 | query = "pubDate>=1990-05"; |
| 198 | expected = |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 199 | "{@type=korap:doc, key=pubDate, value=1990-05, match=match:geq}"; |
Joachim Bingel | 624854b | 2014-07-23 13:53:28 +0000 | [diff] [blame] | 200 | cqt = new CollectionQueryTree(); |
| 201 | cqt.process(query); |
| 202 | map = cqt.getRequestMap().toString(); |
| 203 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 204 | |
| 205 | query = "pubDate>=1990-05-01"; |
| 206 | expected = |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 207 | "{@type=korap:doc, key=pubDate, value=1990-05-01, match=match:geq}"; |
Joachim Bingel | 624854b | 2014-07-23 13:53:28 +0000 | [diff] [blame] | 208 | cqt = new CollectionQueryTree(); |
| 209 | cqt.process(query); |
| 210 | map = cqt.getRequestMap().toString(); |
| 211 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 212 | } |
Michael Hanl | f1fead4 | 2014-05-14 15:13:33 +0000 | [diff] [blame] | 213 | |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 214 | @Test |
| 215 | public void testRegex() throws QueryException { |
| 216 | query = "author=/Go.*he/"; |
| 217 | expected = |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 218 | "{@type=korap:doc, key=author, value=Go.*he, type=type:regex, match=match:eq}"; |
| 219 | cqt = new CollectionQueryTree(); |
| 220 | cqt.process(query); |
| 221 | map = cqt.getRequestMap().toString(); |
| 222 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 223 | } |
| 224 | |
| 225 | @Test |
| 226 | public void testContentFilter() throws QueryException { |
| 227 | query = "[base=Schwalbe]"; |
| 228 | expected = |
| 229 | "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schwalbe, match=match:eq}}"; |
| 230 | cqt = new CollectionQueryTree(); |
| 231 | cqt.process(query); |
| 232 | map = cqt.getRequestMap().toString(); |
| 233 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 234 | |
| 235 | query = "[cnx/base=Schwalbe]"; |
| 236 | expected = |
| 237 | "{@type=korap:token, wrap={@type=korap:term, foundry=cnx, layer=lemma, key=Schwalbe, match=match:eq}}"; |
| 238 | cqt = new CollectionQueryTree(); |
| 239 | cqt.process(query); |
| 240 | map = cqt.getRequestMap().toString(); |
| 241 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 242 | |
| 243 | query = "[base!=Schwalbe]"; |
| 244 | expected = |
| 245 | "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schwalbe, match=match:ne}}"; |
| 246 | cqt = new CollectionQueryTree(); |
| 247 | cqt.process(query); |
| 248 | map = cqt.getRequestMap().toString(); |
| 249 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 250 | |
| 251 | query = "[base=Schwalbe] & [orth=Foul]"; |
| 252 | expected = |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 253 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 254 | "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schwalbe, match=match:eq}}," + |
| 255 | "{@type=korap:token, wrap={@type=korap:term, layer=orth, key=Foul, match=match:eq}}" + |
| 256 | "]}"; |
| 257 | cqt = new CollectionQueryTree(); |
| 258 | cqt.process(query); |
| 259 | map = cqt.getRequestMap().toString(); |
| 260 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 261 | } |
| 262 | |
| 263 | @Test |
| 264 | public void testContentMetaMixed() throws QueryException { |
| 265 | query = "textClass=Sport & [base=Schwalbe]"; |
| 266 | expected = |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 267 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 268 | "{@type=korap:doc, key=textClass, value=Sport, match=match:eq}," + |
| 269 | "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schwalbe, match=match:eq}}" + |
| 270 | "]}"; |
| 271 | cqt = new CollectionQueryTree(); |
| 272 | cqt.process(query); |
| 273 | map = cqt.getRequestMap().toString(); |
| 274 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 275 | |
| 276 | query = "[base=Schwalbe] & textClass=Sport"; |
| 277 | expected = |
Joachim Bingel | b895c1f | 2014-09-29 09:31:05 +0000 | [diff] [blame^] | 278 | "{@type=korap:docGroup, operation=operation:and, operands=[" + |
Joachim Bingel | 43a444a | 2014-08-07 15:06:02 +0000 | [diff] [blame] | 279 | "{@type=korap:token, wrap={@type=korap:term, layer=lemma, key=Schwalbe, match=match:eq}}," + |
| 280 | "{@type=korap:doc, key=textClass, value=Sport, match=match:eq}" + |
| 281 | "]}"; |
Joachim Bingel | a3f51f7 | 2014-07-22 14:45:31 +0000 | [diff] [blame] | 282 | cqt = new CollectionQueryTree(); |
| 283 | cqt.process(query); |
| 284 | map = cqt.getRequestMap().toString(); |
| 285 | assertEquals(expected.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 286 | } |
Michael Hanl | f1fead4 | 2014-05-14 15:13:33 +0000 | [diff] [blame] | 287 | |
| 288 | } |
| 289 | |