Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 1 | import static org.junit.Assert.*; |
| 2 | |
| 3 | import org.junit.Test; |
| 4 | |
| 5 | import de.ids_mannheim.korap.query.serialize.CosmasTree; |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 6 | import de.ids_mannheim.korap.util.QueryException; |
| 7 | |
| 8 | public class CosmasTreeTest { |
| 9 | |
| 10 | CosmasTree ppt; |
| 11 | 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(" ", ""); |
| 22 | ppt = new CosmasTree(query); |
| 23 | String queryMap = ppt.getRequestMap().get("query").toString().replaceAll(" ", ""); |
| 24 | return res.equals(queryMap); |
| 25 | } |
| 26 | |
| 27 | @Test |
| 28 | public void testContext() throws QueryException { |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 29 | String contextString = "{korap=http://korap.ids-mannheim.de/ns/query, @language=de, @operands={@id=korap:operands, @container=@list}, @relation={@id=korap:relation, @type=korap:relation#types}, class={@id=korap:class, @type=xsd:integer}, query=korap:query, filter=korap:filter, meta=korap:meta}"; |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 30 | ppt = new CosmasTree("Test"); |
| 31 | assertTrue(equalsContent(contextString, ppt.getRequestMap().get("@context"))); |
| 32 | } |
| 33 | |
| 34 | |
| 35 | @Test |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 36 | public void testSingleToken() throws QueryException { |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 37 | query="der"; |
| 38 | String single1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 39 | "{@type=korap:token, @value={@type=korap:term, @value=der, @attr=orth, @relation==}}"; |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 40 | ppt = new CosmasTree(query); |
| 41 | map = ppt.getRequestMap().get("query").toString(); |
| 42 | assertEquals(single1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 43 | |
| 44 | query="Mann"; |
| 45 | String single2 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 46 | "{@type=korap:token, @value={@type=korap:term, @value=Mann, @attr=orth, @relation==}}"; |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 47 | ppt = new CosmasTree(query); |
| 48 | map = ppt.getRequestMap().get("query").toString(); |
| 49 | assertEquals(single2.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 50 | |
| 51 | query="&Mann"; |
| 52 | String single3 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 53 | "{@type=korap:token, @value={@type=korap:term, @value=Mann, @attr=lemma, @relation==}}"; |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 54 | ppt = new CosmasTree(query); |
| 55 | map = ppt.getRequestMap().get("query").toString(); |
| 56 | assertEquals(single3.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 57 | } |
| 58 | |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 59 | @Test |
Joachim Bingel | ffd65e3 | 2014-01-22 14:22:57 +0000 | [diff] [blame] | 60 | public void testMORPH() throws QueryException { |
| 61 | query="#MORPH(V)"; |
| 62 | String morph1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 63 | "{@type=korap:token, @value={@type=korap:term, @value=V, @relation==}}"; |
Joachim Bingel | ffd65e3 | 2014-01-22 14:22:57 +0000 | [diff] [blame] | 64 | ppt = new CosmasTree(query); |
| 65 | map = ppt.getRequestMap().get("query").toString(); |
| 66 | assertEquals(morph1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 67 | } |
| 68 | |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 69 | @Test |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 70 | public void testSequence() throws QueryException { |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 71 | query="der Mann"; |
| 72 | String seq1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 73 | "{@type=korap:sequence, @operands=[" + |
| 74 | "{@type=korap:token, @value={@type=korap:term, @value=der, @attr=orth, @relation==}}," + |
| 75 | "{@type=korap:token, @value={@type=korap:term, @value=Mann, @attr=orth, @relation==}}" + |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 76 | "]}"; |
| 77 | ppt = new CosmasTree(query); |
| 78 | map = ppt.getRequestMap().get("query").toString(); |
| 79 | assertEquals(seq1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 80 | |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 81 | query="der Mann schläft"; |
| 82 | String seq2 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 83 | "{@type=korap:sequence, @operands=[" + |
| 84 | "{@type=korap:token, @value={@type=korap:term, @value=der, @attr=orth, @relation==}}," + |
| 85 | "{@type=korap:token, @value={@type=korap:term, @value=Mann, @attr=orth, @relation==}}," + |
| 86 | "{@type=korap:token, @value={@type=korap:term, @value=schläft, @attr=orth, @relation==}}" + |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 87 | "]}"; |
| 88 | ppt = new CosmasTree(query); |
| 89 | map = ppt.getRequestMap().get("query").toString(); |
| 90 | assertEquals(seq2.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 91 | |
| 92 | query="der Mann schläft lang"; |
| 93 | String seq3 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 94 | "{@type=korap:sequence, @operands=[" + |
| 95 | "{@type=korap:token, @value={@type=korap:term, @value=der, @attr=orth, @relation==}}," + |
| 96 | "{@type=korap:token, @value={@type=korap:term, @value=Mann, @attr=orth, @relation==}}," + |
| 97 | "{@type=korap:token, @value={@type=korap:term, @value=schläft, @attr=orth, @relation==}}," + |
| 98 | "{@type=korap:token, @value={@type=korap:term, @value=lang, @attr=orth, @relation==}}" + |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 99 | "]}"; |
| 100 | ppt = new CosmasTree(query); |
| 101 | map = ppt.getRequestMap().get("query").toString(); |
| 102 | assertEquals(seq3.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | @Test |
| 106 | public void testOPOR() throws QueryException { |
| 107 | query="Sonne oder Mond"; |
| 108 | String disj1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 109 | "{@type=korap:group, @relation=or, @operands=[" + |
| 110 | "{@type=korap:token, @value={@type=korap:term, @value=Sonne, @attr=orth, @relation==}}," + |
| 111 | "{@type=korap:token, @value={@type=korap:term, @value=Mond, @attr=orth, @relation==}}" + |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 112 | "]}"; |
| 113 | ppt = new CosmasTree(query); |
| 114 | map = ppt.getRequestMap().get("query").toString(); |
| 115 | assertEquals(disj1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 116 | |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 117 | query="(Sonne scheint) oder Mond"; |
| 118 | String disj2 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 119 | "{@type=korap:group, @relation=or, @operands=[" + |
| 120 | "{@type=korap:sequence, @operands=[" + |
| 121 | "{@type=korap:token, @value={@type=korap:term, @value=Sonne, @attr=orth, @relation==}}," + |
| 122 | "{@type=korap:token, @value={@type=korap:term, @value=scheint, @attr=orth, @relation==}}" + |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 123 | "]}," + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 124 | "{@type=korap:token, @value={@type=korap:term, @value=Mond, @attr=orth, @relation==}}" + |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 125 | "]}"; |
| 126 | ppt = new CosmasTree(query); |
| 127 | map = ppt.getRequestMap().get("query").toString(); |
| 128 | assertEquals(disj2.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 129 | |
| 130 | query="(Sonne scheint) oder (Mond scheint)"; |
| 131 | String disj3 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 132 | "{@type=korap:group, @relation=or, @operands=[" + |
| 133 | "{@type=korap:sequence, @operands=[" + |
| 134 | "{@type=korap:token, @value={@type=korap:term, @value=Sonne, @attr=orth, @relation==}}," + |
| 135 | "{@type=korap:token, @value={@type=korap:term, @value=scheint, @attr=orth, @relation==}}" + |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 136 | "]}," + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 137 | "{@type=korap:sequence, @operands=[" + |
| 138 | "{@type=korap:token, @value={@type=korap:term, @value=Mond, @attr=orth, @relation==}}," + |
| 139 | "{@type=korap:token, @value={@type=korap:term, @value=scheint, @attr=orth, @relation==}}" + |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 140 | "]}" + |
| 141 | "]}"; |
| 142 | ppt = new CosmasTree(query); |
| 143 | map = ppt.getRequestMap().get("query").toString(); |
| 144 | assertEquals(disj3.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 145 | |
| 146 | } |
| 147 | |
| 148 | @Test |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 149 | public void testOPORAND() throws QueryException { |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 150 | query="(Sonne oder Mond) und scheint"; |
| 151 | String orand1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 152 | "{@type=korap:group, @relation=and, @operands=[" + |
| 153 | "{@type=korap:group, @relation=or, @operands=[" + |
| 154 | "{@type=korap:token, @value={@type=korap:term, @value=Sonne, @attr=orth, @relation==}}," + |
| 155 | "{@type=korap:token, @value={@type=korap:term, @value=Mond, @attr=orth, @relation==}}" + |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 156 | "]}," + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 157 | "{@type=korap:token, @value={@type=korap:term, @value=scheint, @attr=orth, @relation==}}" + |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 158 | "]}"; |
| 159 | ppt = new CosmasTree(query); |
| 160 | map = ppt.getRequestMap().get("query").toString(); |
| 161 | assertEquals(orand1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 162 | |
| 163 | query="scheint und (Sonne oder Mond)"; |
| 164 | String orand2 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 165 | "{@type=korap:group, @relation=and, @operands=[" + |
| 166 | "{@type=korap:token, @value={@type=korap:term, @value=scheint, @attr=orth, @relation==}}," + |
| 167 | "{@type=korap:group, @relation=or, @operands=[" + |
| 168 | "{@type=korap:token, @value={@type=korap:term, @value=Sonne, @attr=orth, @relation==}}," + |
| 169 | "{@type=korap:token, @value={@type=korap:term, @value=Mond, @attr=orth, @relation==}}" + |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 170 | "]}" + |
| 171 | "]}"; |
| 172 | ppt = new CosmasTree(query); |
| 173 | map = ppt.getRequestMap().get("query").toString(); |
| 174 | assertEquals(orand2.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | @Test |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 178 | public void testOPPROX() throws QueryException { |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 179 | query="Sonne /+w1:4 Mond"; |
| 180 | String prox1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 181 | "{@type=korap:sequence, @inOrder=true, " + |
| 182 | "@constraints=[" + |
| 183 | "{@type=korap:distance, @measure=w, @min=1, @max=4}" + |
Joachim Bingel | 89cceac | 2014-01-08 15:51:08 +0000 | [diff] [blame] | 184 | "], " + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 185 | "@operands=[" + |
| 186 | "{@type=korap:token, @value={@type=korap:term, @value=Sonne, @attr=orth, @relation==}}," + |
| 187 | "{@type=korap:token, @value={@type=korap:term, @value=Mond, @attr=orth, @relation==}}" + |
Joachim Bingel | 89cceac | 2014-01-08 15:51:08 +0000 | [diff] [blame] | 188 | "]" + |
| 189 | "}"; |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 190 | ppt = new CosmasTree(query); |
| 191 | map = ppt.getRequestMap().get("query").toString(); |
| 192 | assertEquals(prox1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | 89cceac | 2014-01-08 15:51:08 +0000 | [diff] [blame] | 193 | |
| 194 | query="Sonne /+w1:4,s0,p1:3 Mond"; |
| 195 | String prox2 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 196 | "{@type=korap:sequence, @inOrder=true, " + |
| 197 | "@constraints=[" + |
| 198 | "{@type=korap:group, @relation=and, @operands=[" + |
| 199 | "{@type=korap:distance, @measure=w, @min=1, @max=4}," + |
| 200 | "{@type=korap:distance, @measure=s, @min=0, @max=0}," + |
| 201 | "{@type=korap:distance, @measure=p, @min=1, @max=3}" + |
Joachim Bingel | 89cceac | 2014-01-08 15:51:08 +0000 | [diff] [blame] | 202 | "]}" + |
| 203 | "], " + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 204 | "@operands=[" + |
| 205 | "{@type=korap:token, @value={@type=korap:term, @value=Sonne, @attr=orth, @relation==}}," + |
| 206 | "{@type=korap:token, @value={@type=korap:term, @value=Mond, @attr=orth, @relation==}}" + |
Joachim Bingel | 89cceac | 2014-01-08 15:51:08 +0000 | [diff] [blame] | 207 | "]" + |
| 208 | "}"; |
| 209 | ppt = new CosmasTree(query); |
| 210 | map = ppt.getRequestMap().get("query").toString(); |
| 211 | assertEquals(prox2.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 212 | |
| 213 | query="Sonne %+w1:4,s0,p1:3 Mond"; |
| 214 | String prox3 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 215 | "{@type=korap:sequence, @inOrder=true, " + |
| 216 | "@constraints=[" + |
| 217 | "{@type=korap:group, @relation=and, @operands=[" + |
| 218 | "{@type=korap:distance, @measure=w, @min=1, @max=4, @exclude=true}," + |
| 219 | "{@type=korap:distance, @measure=s, @min=0, @max=0, @exclude=true}," + |
| 220 | "{@type=korap:distance, @measure=p, @min=1, @max=3, @exclude=true}" + |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 221 | "]}" + |
| 222 | "], " + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 223 | "@operands=[" + |
| 224 | "{@type=korap:token, @value={@type=korap:term, @value=Sonne, @attr=orth, @relation==}}," + |
| 225 | "{@type=korap:token, @value={@type=korap:term, @value=Mond, @attr=orth, @relation==}}" + |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 226 | "]" + |
| 227 | "}"; |
| 228 | ppt = new CosmasTree(query); |
| 229 | map = ppt.getRequestMap().get("query").toString(); |
| 230 | assertEquals(prox3.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 231 | |
| 232 | query="Sonne /+w4 Mond"; |
| 233 | String prox4 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 234 | "{@type=korap:sequence, @inOrder=true, " + |
| 235 | "@constraints=[" + |
| 236 | "{@type=korap:distance, @measure=w, @min=0, @max=4}" + |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 237 | "], " + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 238 | "@operands=[" + |
| 239 | "{@type=korap:token, @value={@type=korap:term, @value=Sonne, @attr=orth, @relation==}}," + |
| 240 | "{@type=korap:token, @value={@type=korap:term, @value=Mond, @attr=orth, @relation==}}" + |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 241 | "]" + |
| 242 | "}"; |
| 243 | ppt = new CosmasTree(query); |
| 244 | map = ppt.getRequestMap().get("query").toString(); |
| 245 | assertEquals(prox4.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 246 | |
| 247 | query="Sonne /-w4 Mond"; |
| 248 | String prox5 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 249 | "{@type=korap:sequence, @inOrder=true, " + |
| 250 | "@constraints=[" + |
| 251 | "{@type=korap:distance, @measure=w, @min=0, @max=4}" + |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 252 | "], " + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 253 | "@operands=[" + |
| 254 | "{@type=korap:token, @value={@type=korap:term, @value=Mond, @attr=orth, @relation==}}," + |
| 255 | "{@type=korap:token, @value={@type=korap:term, @value=Sonne, @attr=orth, @relation==}}" + |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 256 | "]" + |
| 257 | "}"; |
| 258 | ppt = new CosmasTree(query); |
| 259 | map = ppt.getRequestMap().get("query").toString(); |
| 260 | assertEquals(prox5.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 261 | } |
| 262 | |
| 263 | @Test |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 264 | public void testOPPROXNested() throws QueryException { |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 265 | query="Sonne /-w4 Mond /+w2 Sterne"; |
| 266 | String prox6 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 267 | "{@type=korap:sequence, @inOrder=true, " + |
| 268 | "@constraints=[" + |
| 269 | "{@type=korap:distance, @measure=w, @min=0, @max=4}" + |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 270 | "], " + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 271 | "@operands=[" + |
| 272 | "{@type=korap:sequence, @inOrder=true, " + |
| 273 | "@constraints=[" + |
| 274 | "{@type=korap:distance, @measure=w, @min=0, @max=2}" + |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 275 | "], " + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 276 | "@operands=[" + |
| 277 | "{@type=korap:token, @value={@type=korap:term, @value=Mond, @attr=orth, @relation==}}," + |
| 278 | "{@type=korap:token, @value={@type=korap:term, @value=Sterne, @attr=orth, @relation==}}" + |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 279 | "]}," + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 280 | "{@type=korap:token, @value={@type=korap:term, @value=Sonne, @attr=orth, @relation==}}" + |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 281 | "]" + |
| 282 | "}"; |
| 283 | ppt = new CosmasTree(query); |
| 284 | map = ppt.getRequestMap().get("query").toString(); |
| 285 | assertEquals(prox6.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | @Test |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 289 | public void testOPIN() throws QueryException { |
Joachim Bingel | cc1dc24 | 2014-01-15 09:32:38 +0000 | [diff] [blame] | 290 | query="wegen #IN <s>"; |
Joachim Bingel | 3a9f793 | 2014-01-07 17:11:31 +0000 | [diff] [blame] | 291 | String opin1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 292 | "{@type=korap:group, @relation=submatch, @classRef=1, @operands=[" + |
| 293 | "{@type=korap:group, @relation=position, @position=contains, @operands=[" + |
| 294 | "{@type=korap:span, @value=s}," + |
| 295 | "{@type=korap:group, class=1, @operands=[" + |
| 296 | "{@type=korap:token, @value={@type=korap:term, @value=wegen, @attr=orth, @relation==}}" + |
Joachim Bingel | eecc765 | 2014-01-11 17:21:07 +0000 | [diff] [blame] | 297 | "]}" + |
| 298 | "]}" + |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 299 | "]}"; |
| 300 | ppt = new CosmasTree(query); |
| 301 | map = ppt.getRequestMap().get("query").toString(); |
| 302 | assertEquals(opin1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 303 | |
Joachim Bingel | cc1dc24 | 2014-01-15 09:32:38 +0000 | [diff] [blame] | 304 | query="wegen #IN(L) <s>"; |
| 305 | String opin2 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 306 | "{@type=korap:group, @relation=submatch, @classRef=1, @operands=[" + |
| 307 | "{@type=korap:group, @relation=position, @position=startswith, @operands=[" + |
| 308 | "{@type=korap:span, @value=s}," + |
| 309 | "{@type=korap:group, class=1, @operands=[" + |
| 310 | "{@type=korap:token, @value={@type=korap:term, @value=wegen, @attr=orth, @relation==}}" + |
Joachim Bingel | cc1dc24 | 2014-01-15 09:32:38 +0000 | [diff] [blame] | 311 | "]}" + |
| 312 | "]}" + |
| 313 | "]}"; |
| 314 | ppt = new CosmasTree(query); |
| 315 | map = ppt.getRequestMap().get("query").toString(); |
| 316 | assertEquals(opin2.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 317 | |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 318 | query="wegen #IN(%, L) <s>"; |
| 319 | String opin3 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 320 | "{@type=korap:group, @relation=submatch, @classRef=1, @operands=[" + |
| 321 | "{@type=korap:group, @relation=position, @position=startswith, @exclude=true, @operands=[" + |
| 322 | "{@type=korap:span, @value=s}," + |
| 323 | "{@type=korap:group, class=1, @operands=[" + |
| 324 | "{@type=korap:token, @value={@type=korap:term, @value=wegen, @attr=orth, @relation==}}" + |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 325 | "]}" + |
| 326 | "]}" + |
| 327 | "]}"; |
| 328 | ppt = new CosmasTree(query); |
| 329 | map = ppt.getRequestMap().get("query").toString(); |
| 330 | assertEquals(opin3.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 331 | |
| 332 | query="wegen #IN('FE,ALL,%,MIN') <s>"; |
| 333 | String opin4 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 334 | "{@type=korap:group, @relation=submatch, @classRef=1, @operands=[" + |
| 335 | "{@type=korap:group, @relation=position, @position=ident, range=all, @exclude=true, grouping=false, @operands=[" + |
| 336 | "{@type=korap:span, @value=s}," + |
| 337 | "{@type=korap:group, class=1, @operands=[" + |
| 338 | "{@type=korap:token, @value={@type=korap:term, @value=wegen, @attr=orth, @relation==}}" + |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 339 | "]}" + |
| 340 | "]}" + |
| 341 | "]}"; |
| 342 | ppt = new CosmasTree(query); |
| 343 | map = ppt.getRequestMap().get("query").toString(); |
| 344 | assertEquals(opin4.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 345 | } |
| 346 | |
| 347 | @Test |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 348 | public void testOPOV() throws QueryException { |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 349 | query="wegen #OV <s>"; |
Joachim Bingel | cc1dc24 | 2014-01-15 09:32:38 +0000 | [diff] [blame] | 350 | String opov1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 351 | "{@type=korap:group, @relation=submatch, @classRef=1, @operands=[" + |
| 352 | "{@type=korap:group, @relation=overlaps, @position=any, @operands=[" + |
| 353 | "{@type=korap:span, @value=s}," + |
| 354 | "{@type=korap:group, class=1, @operands=[" + |
| 355 | "{@type=korap:token, @value={@type=korap:term, @value=wegen, @attr=orth, @relation==}}" + |
Joachim Bingel | cc1dc24 | 2014-01-15 09:32:38 +0000 | [diff] [blame] | 356 | "]}" + |
| 357 | "]}" + |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 358 | "]}"; |
| 359 | ppt = new CosmasTree(query); |
| 360 | map = ppt.getRequestMap().get("query").toString(); |
Joachim Bingel | cc1dc24 | 2014-01-15 09:32:38 +0000 | [diff] [blame] | 361 | assertEquals(opov1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 362 | |
| 363 | query="wegen #OV(L) <s>"; |
| 364 | String opov2 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 365 | "{@type=korap:group, @relation=submatch, @classRef=1, @operands=[" + |
| 366 | "{@type=korap:group, @relation=overlaps, @position=startswith, @operands=[" + |
| 367 | "{@type=korap:span, @value=s}," + |
| 368 | "{@type=korap:group, class=1, @operands=[" + |
| 369 | "{@type=korap:token, @value={@type=korap:term, @value=wegen, @attr=orth, @relation==}}" + |
Joachim Bingel | cc1dc24 | 2014-01-15 09:32:38 +0000 | [diff] [blame] | 370 | "]}" + |
| 371 | "]}" + |
| 372 | "]}"; |
| 373 | ppt = new CosmasTree(query); |
| 374 | map = ppt.getRequestMap().get("query").toString(); |
| 375 | assertEquals(opov2.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 376 | } |
| 377 | |
| 378 | @Test |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 379 | public void testOPNOT() throws QueryException { |
Joachim Bingel | 3a9f793 | 2014-01-07 17:11:31 +0000 | [diff] [blame] | 380 | query="Sonne nicht Mond"; |
| 381 | String opnot1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 382 | "{@type=korap:group, @relation=not, @operands=[" + |
| 383 | "{@type=korap:token, @value={@type=korap:term, @value=Sonne, @attr=orth, @relation==}}," + |
| 384 | "{@type=korap:token, @value={@type=korap:term, @value=Mond, @attr=orth, @relation==}}" + |
Joachim Bingel | 3a9f793 | 2014-01-07 17:11:31 +0000 | [diff] [blame] | 385 | "]}"; |
| 386 | ppt = new CosmasTree(query); |
| 387 | map = ppt.getRequestMap().get("query").toString(); |
| 388 | assertEquals(opnot1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 389 | } |
| 390 | |
| 391 | @Test |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 392 | public void testBEG_END() throws QueryException { |
Joachim Bingel | 3a9f793 | 2014-01-07 17:11:31 +0000 | [diff] [blame] | 393 | // BEG and END operators |
| 394 | // http://www.ids-mannheim.de/cosmas2/web-app/hilfe/suchanfrage/eingabe-zeile/syntax/links.html |
| 395 | // http://www.ids-mannheim.de/cosmas2/web-app/hilfe/suchanfrage/eingabe-zeile/syntax/rechts.html |
| 396 | // http://www.ids-mannheim.de/cosmas2/web-app/hilfe/suchanfrage/eingabe-zeile/thematische-bsp/bsp-satzlaenge.html |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 397 | query="#BEG(der /w3:5 Mann)"; |
| 398 | String beg1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 399 | "{@type=korap:group, @relation=submatch, @spanRef=[0,1], @operands=[" + |
| 400 | "{@type=korap:sequence, @inOrder=false, @constraints=[" + |
| 401 | "{@type=korap:distance, @measure=w, @min=3, @max=5}" + |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 402 | "]," + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 403 | "@operands = [" + |
| 404 | "{@type=korap:token, @value={@type=korap:term, @value=der, @attr=orth, @relation==}}," + |
| 405 | "{@type=korap:token, @value={@type=korap:term, @value=Mann, @attr=orth, @relation==}}" + |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 406 | "]}" + |
| 407 | "]}"; |
| 408 | ppt = new CosmasTree(query); |
| 409 | map = ppt.getRequestMap().get("query").toString(); |
| 410 | assertEquals(beg1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 411 | |
| 412 | query="#BEG(der /w3:5 Mann) /+w10 kommt"; // nesting #BEG() in a distance group |
| 413 | String beg2 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 414 | "{@type=korap:sequence, @inOrder=true, @constraints=[" + |
| 415 | "{@type=korap:distance, @measure=w, @min=0, @max=10}" + |
| 416 | "], @operands=[" + |
| 417 | "{@type=korap:group, @relation=submatch, @spanRef=[0,1], @operands=[" + |
| 418 | "{@type=korap:sequence, @inOrder=false, @constraints=[" + |
| 419 | "{@type=korap:distance, @measure=w, @min=3, @max=5}" + |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 420 | "]," + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 421 | "@operands = [" + |
| 422 | "{@type=korap:token, @value={@type=korap:term, @value=der, @attr=orth, @relation==}}," + |
| 423 | "{@type=korap:token, @value={@type=korap:term, @value=Mann, @attr=orth, @relation==}}" + |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 424 | "]}" + |
| 425 | "]}," + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 426 | "{@type=korap:token, @value={@type=korap:term, @value=kommt, @attr=orth, @relation==}}" + |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 427 | "]}"; |
| 428 | ppt = new CosmasTree(query); |
| 429 | map = ppt.getRequestMap().get("query").toString(); |
| 430 | assertEquals(beg2.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 431 | |
| 432 | query="#END(der /w3:5 Mann)"; |
| 433 | String end1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 434 | "{@type=korap:group, @relation=submatch, @spanRef=[-1,1], @operands=[" + |
| 435 | "{@type=korap:sequence, @inOrder=false, @constraints=[" + |
| 436 | "{@type=korap:distance, @measure=w, @min=3, @max=5}" + |
| 437 | "], " + |
| 438 | "@operands = [" + |
| 439 | "{@type=korap:token, @value={@type=korap:term, @value=der, @attr=orth, @relation==}}," + |
| 440 | "{@type=korap:token, @value={@type=korap:term, @value=Mann, @attr=orth, @relation==}}" + |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 441 | "]}" + |
| 442 | "]}"; |
| 443 | ppt = new CosmasTree(query); |
| 444 | map = ppt.getRequestMap().get("query").toString(); |
| 445 | assertEquals(end1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 446 | } |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 447 | |
| 448 | |
| 449 | @Test |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 450 | public void testELEM() throws QueryException { |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 451 | // http://www.ids-mannheim.de/cosmas2/web-app/hilfe/suchanfrage/eingabe-zeile/syntax/elem.html |
Joachim Bingel | eecc765 | 2014-01-11 17:21:07 +0000 | [diff] [blame] | 452 | query="#ELEM(S)"; |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 453 | String elem1 = "{@type=korap:span, @value=s}"; |
Joachim Bingel | eecc765 | 2014-01-11 17:21:07 +0000 | [diff] [blame] | 454 | ppt = new CosmasTree(query); |
| 455 | map = ppt.getRequestMap().get("query").toString(); |
| 456 | assertEquals(elem1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 457 | } |
| 458 | |
| 459 | @Test |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 460 | public void testOPALL() throws QueryException { |
Joachim Bingel | 89cceac | 2014-01-08 15:51:08 +0000 | [diff] [blame] | 461 | query="#ALL(gehen /w1:10 voran)"; |
Joachim Bingel | e98d088 | 2014-01-21 12:58:54 +0000 | [diff] [blame] | 462 | String all1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 463 | "{@type=korap:sequence, @inOrder=false, " + |
| 464 | "@constraints=[" + |
| 465 | "{@type=korap:distance, @measure=w, @min=1, @max=10}" + |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 466 | "], " + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 467 | "@operands=[" + |
| 468 | "{@type=korap:token, @value={@type=korap:term, @value=gehen, @attr=orth, @relation==}}," + |
| 469 | "{@type=korap:token, @value={@type=korap:term, @value=voran, @attr=orth, @relation==}}" + |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 470 | "]" + |
| 471 | "}"; |
Joachim Bingel | 89cceac | 2014-01-08 15:51:08 +0000 | [diff] [blame] | 472 | ppt = new CosmasTree(query); |
| 473 | map = ppt.getRequestMap().get("query").toString(); |
| 474 | assertEquals(all1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 475 | } |
| 476 | |
| 477 | @Test |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 478 | public void testOPNHIT() throws QueryException { |
Joachim Bingel | 89cceac | 2014-01-08 15:51:08 +0000 | [diff] [blame] | 479 | query="#NHIT(gehen /w1:10 voran)"; |
| 480 | String nhit1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 481 | "{@type=korap:sequence, @inOrder=false, " + |
| 482 | "@constraints=[" + |
| 483 | "{@type=korap:distance, @measure=w, @min=1, @max=10}" + |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 484 | "], " + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 485 | "@operands=[" + |
| 486 | "{@type=korap:token, @value={@type=korap:term, @value=gehen, @attr=orth, @relation==}}," + |
| 487 | "{@type=korap:token, @value={@type=korap:term, @value=voran, @attr=orth, @relation==}}" + |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 488 | "]" + |
| 489 | "}"; |
Joachim Bingel | 89cceac | 2014-01-08 15:51:08 +0000 | [diff] [blame] | 490 | ppt = new CosmasTree(query); |
| 491 | map = ppt.getRequestMap().get("query").toString(); |
| 492 | assertEquals(nhit1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 493 | } |
| 494 | |
| 495 | @Test |
Joachim Bingel | 87480d0 | 2014-01-17 14:07:46 +0000 | [diff] [blame] | 496 | public void testOPBED() throws QueryException { |
Joachim Bingel | eecc765 | 2014-01-11 17:21:07 +0000 | [diff] [blame] | 497 | query = "#BED(der , sa)"; |
| 498 | String bed1 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 499 | "{@type=korap:group, @relation=position, @position=startswith, @operands=[" + |
| 500 | "{@type=korap:span, @value=s}," + |
| 501 | "{@type=korap:token, @value={@type=korap:term, @value=der, @attr=orth, @relation==}}" + |
Joachim Bingel | eecc765 | 2014-01-11 17:21:07 +0000 | [diff] [blame] | 502 | "]}"; |
| 503 | ppt = new CosmasTree(query); |
| 504 | map = ppt.getRequestMap().get("query").toString(); |
| 505 | assertEquals(bed1.replaceAll(" ", ""), map.replaceAll(" ", "")); |
| 506 | |
| 507 | query = "#BED(der Mann , +pe)"; |
| 508 | String bed2 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 509 | "{@type=korap:group, @relation=position, @position=endswith, @operands=[" + |
| 510 | "{@type=korap:span, @value=p}," + |
| 511 | "{@type=korap:sequence, @operands=[" + |
| 512 | "{@type=korap:token, @value={@type=korap:term, @value=der, @attr=orth, @relation==}}," + |
| 513 | "{@type=korap:token, @value={@type=korap:term, @value=Mann, @attr=orth, @relation==}}" + |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 514 | "]}" + |
Joachim Bingel | eecc765 | 2014-01-11 17:21:07 +0000 | [diff] [blame] | 515 | "]}"; |
| 516 | ppt = new CosmasTree(query); |
| 517 | map = ppt.getRequestMap().get("query").toString(); |
| 518 | assertEquals(bed2.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 519 | |
| 520 | query = "#BED(der Mann , sa,-pa)"; |
| 521 | String bed3 = |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 522 | "{@type=korap:group, @relation=and, @operands=[" + |
| 523 | "{@type=korap:group, @relation=position, @position=startswith, @operands=[" + |
| 524 | "{@type=korap:span, @value=s}," + |
| 525 | "{@type=korap:sequence, @operands=[" + |
| 526 | "{@type=korap:token, @value={@type=korap:term, @value=der, @attr=orth, @relation==}}," + |
| 527 | "{@type=korap:token, @value={@type=korap:term, @value=Mann, @attr=orth, @relation==}}" + |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 528 | "]}" + |
| 529 | "]}," + |
Joachim Bingel | ba9a0ab | 2014-01-29 10:12:25 +0000 | [diff] [blame^] | 530 | "{@type=korap:group, @relation=position, @position=startswith, @exclude=true, @operands=[" + |
| 531 | "{@type=korap:span, @value=p}," + |
| 532 | "{@type=korap:sequence, @operands=[" + |
| 533 | "{@type=korap:token, @value={@type=korap:term, @value=der, @attr=orth, @relation==}}," + |
| 534 | "{@type=korap:token, @value={@type=korap:term, @value=Mann, @attr=orth, @relation==}}" + |
Joachim Bingel | 3f0850c | 2014-01-17 16:50:10 +0000 | [diff] [blame] | 535 | "]}" + |
| 536 | "]}" + |
| 537 | "]}"; |
| 538 | ppt = new CosmasTree(query); |
| 539 | map = ppt.getRequestMap().get("query").toString(); |
| 540 | assertEquals(bed3.replaceAll(" ", ""), map.replaceAll(" ", "")); |
Joachim Bingel | d5161a1 | 2014-01-08 11:15:49 +0000 | [diff] [blame] | 541 | } |
| 542 | |
Joachim Bingel | b5f7bf0 | 2014-01-07 16:36:54 +0000 | [diff] [blame] | 543 | } |
| 544 | |