Branch data Line data Source code
1 : : /* queryparsertest.cc: Tests of Xapian::QueryParser
2 : : *
3 : : * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009,2010,2011 Olly Betts
4 : : * Copyright (C) 2007,2009 Lemur Consulting Ltd
5 : : *
6 : : * This program is free software; you can redistribute it and/or
7 : : * modify it under the terms of the GNU General Public License as
8 : : * published by the Free Software Foundation; either version 2 of the
9 : : * License, or (at your option) any later version.
10 : : *
11 : : * This program is distributed in the hope that it will be useful,
12 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 : : * GNU General Public License for more details.
15 : : *
16 : : * You should have received a copy of the GNU General Public License
17 : : * along with this program; if not, write to the Free Software
18 : : * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
19 : : * USA
20 : : */
21 : :
22 : : #include <config.h>
23 : :
24 : : #include <xapian.h>
25 : :
26 : : #include "cputimer.h"
27 : : #include "str.h"
28 : : #include "stringutils.h"
29 : : #include "utils.h"
30 : :
31 : : #include <cmath>
32 : : #include <iostream>
33 : : #include <string>
34 : : #include <vector>
35 : :
36 : : using namespace std;
37 : :
38 : : #define TESTCASE(S) {#S, test_##S}
39 : : #define END_OF_TESTCASES {0, 0}
40 : :
41 : : #include "testsuite.h"
42 : : #include "testutils.h"
43 : :
44 : : struct test {
45 : : const char *query;
46 : : const char *expect;
47 : : };
48 : :
49 : : static const test test_or_queries[] = {
50 : : { "simple-example", "(simple:(pos=1) PHRASE 2 example:(pos=2))" },
51 : : { "time_t", "Ztime_t:(pos=1)" },
52 : : { "stock -cooking", "(Zstock:(pos=1) AND_NOT Zcook:(pos=2))" },
53 : : { "foo -baz bar", "((Zfoo:(pos=1) OR Zbar:(pos=3)) AND_NOT Zbaz:(pos=2))" },
54 : : { "d- school report", "(Zd:(pos=1) OR Zschool:(pos=2) OR Zreport:(pos=3))" },
55 : : { "gtk+ -gnome", "(Zgtk+:(pos=1) AND_NOT Zgnome:(pos=2))" },
56 : : { "c++ -d--", "(Zc++:(pos=1) AND_NOT Zd:(pos=2))" },
57 : : { "Mg2+ Cl-", "(mg2+:(pos=1) OR cl:(pos=2))" },
58 : : { "\"c++ library\"", "(c++:(pos=1) PHRASE 2 library:(pos=2))" },
59 : : { "A&L A&RMCO AD&D", "(a&l:(pos=1) OR a&rmco:(pos=2) OR ad&d:(pos=3))" },
60 : : { "C# vs C++", "(c#:(pos=1) OR Zvs:(pos=2) OR c++:(pos=3))" },
61 : : { "j##", "Zj##:(pos=1)" },
62 : : { "a#b", "(Za:(pos=1) OR Zb:(pos=2))" },
63 : : { "O.K. U.N.C.L.E XY.Z.", "(ok:(pos=1) OR uncle:(pos=2) OR (xy:(pos=3) PHRASE 2 z:(pos=4)))" },
64 : : { "author:orwell animal farm", "(ZAorwel:(pos=1) OR Zanim:(pos=2) OR Zfarm:(pos=3))" },
65 : : { "author:Orwell Animal Farm", "(Aorwell:(pos=1) OR animal:(pos=2) OR farm:(pos=3))" },
66 : : // Regression test for bug reported in 0.9.6.
67 : : { "author:\"orwell\" title:\"animal\"", "(Aorwell:(pos=1) OR XTanimal:(pos=2))" },
68 : : // Regression test for bug related to one reported in 0.9.6.
69 : : { "author:(orwell) title:(animal)", "(ZAorwel:(pos=1) OR ZXTanim:(pos=2))" },
70 : : // Regression test for bug caused by fix for previous bug.
71 : : { "author:\"milne, a.a.\"", "(Amilne:(pos=1) PHRASE 3 Aa:(pos=2) PHRASE 3 Aa:(pos=3))" },
72 : : { "author:\"milne a.a.\"", "(Amilne:(pos=1) PHRASE 3 Aa:(pos=2) PHRASE 3 Aa:(pos=3))" },
73 : : // Regression test for bug reported in 0.9.7.
74 : : { "site:/path/name", "0 * H/path/name" },
75 : : // Regression test for bug introduced (and fixed) in SVN prior to 1.0.0.
76 : : { "author:/path/name", "(Apath:(pos=1) PHRASE 2 Aname:(pos=2))" },
77 : : // Feature tests for change to allow phrase generators after prefix in 1.2.4.
78 : : { "author:/path", "ZApath:(pos=1)" },
79 : : { "author:-Foo", "Afoo:(pos=1)" },
80 : : { "author:/", "Zauthor:(pos=1)" },
81 : : { "author::", "Zauthor:(pos=1)" },
82 : : { "author:/ foo", "(Zauthor:(pos=1) OR Zfoo:(pos=2))" },
83 : : { "author:: foo", "(Zauthor:(pos=1) OR Zfoo:(pos=2))" },
84 : : { "author::foo", "(author:(pos=1) PHRASE 2 foo:(pos=2))" },
85 : : { "author:/ AND foo", "(Zauthor:(pos=1) AND Zfoo:(pos=2))" },
86 : : { "author:: AND foo", "(Zauthor:(pos=1) AND Zfoo:(pos=2))" },
87 : : { "foo AND author:/", "(Zfoo:(pos=1) AND Zauthor:(pos=2))" },
88 : : { "foo AND author::", "(Zfoo:(pos=1) AND Zauthor:(pos=2))" },
89 : : // Regression test for bug introduced into (and fixed) in SVN prior to 1.0.0.
90 : : { "author:(title::case)", "(Atitle:(pos=1) PHRASE 2 Acase:(pos=2))" },
91 : : // Regression test for bug fixed in 1.0.4 - the '+' would be ignored there
92 : : // because the whitespace after the '"' wasn't noticed.
93 : : { "\"hello world\" +python", "(Zpython:(pos=3) AND_MAYBE (hello:(pos=1) PHRASE 2 world:(pos=2)))" },
94 : : // In 1.1.0, NON_SPACING_MARK was added as a word character.
95 : : { "\xd8\xa7\xd9\x84\xd8\xb1\xd9\x91\xd8\xad\xd9\x85\xd9\x86", "Z\xd8\xa7\xd9\x84\xd8\xb1\xd9\x91\xd8\xad\xd9\x85\xd9\x86:(pos=1)" },
96 : : // In 1.1.4, ENCLOSING_MARK and COMBINING_SPACING_MARK were added, and
97 : : // code to ignore several zero-width space characters was added.
98 : : { "\xe1\x80\x9d\xe1\x80\xae\xe2\x80\x8b\xe1\x80\x80\xe1\x80\xae\xe2\x80\x8b\xe1\x80\x95\xe1\x80\xad\xe2\x80\x8b\xe1\x80\x9e\xe1\x80\xaf\xe1\x80\xb6\xe1\x80\xb8\xe2\x80\x8b\xe1\x80\x85\xe1\x80\xbd\xe1\x80\xb2\xe2\x80\x8b\xe1\x80\x9e\xe1\x80\xb0\xe2\x80\x8b\xe1\x80\x99\xe1\x80\xbb\xe1\x80\xac\xe1\x80\xb8\xe1\x80\x80", "Z\xe1\x80\x9d\xe1\x80\xae\xe1\x80\x80\xe1\x80\xae\xe1\x80\x95\xe1\x80\xad\xe1\x80\x9e\xe1\x80\xaf\xe1\x80\xb6\xe1\x80\xb8\xe1\x80\x85\xe1\x80\xbd\xe1\x80\xb2\xe1\x80\x9e\xe1\x80\xb0\xe1\x80\x99\xe1\x80\xbb\xe1\x80\xac\xe1\x80\xb8\xe1\x80\x80:(pos=1)" },
99 : : { "unmatched\"", "unmatched:(pos=1)" },
100 : : { "unmatched \" \" ", "Zunmatch:(pos=1)" },
101 : : { "hyphen-ated\" ", "(hyphen:(pos=1) PHRASE 2 ated:(pos=2))" },
102 : : { "hyphen-ated\" \"", "(hyphen:(pos=1) PHRASE 2 ated:(pos=2))" },
103 : : { "\"1.4\"", "1.4:(pos=1)" },
104 : : { "\"1.\"", "1:(pos=1)" },
105 : : { "\"A#.B.\"", "(a#:(pos=1) PHRASE 2 b:(pos=2))" },
106 : : { "\" Xapian QueryParser\" parses queries", "((xapian:(pos=1) PHRASE 2 queryparser:(pos=2)) OR Zpars:(pos=3) OR Zqueri:(pos=4))" },
107 : : { "\" xapian queryParser\" parses queries", "((xapian:(pos=1) PHRASE 2 queryparser:(pos=2)) OR Zpars:(pos=3) OR Zqueri:(pos=4))" },
108 : : { "h\xc3\xb6hle", "Zh\xc3\xb6hle:(pos=1)" },
109 : : { "one +two three", "(Ztwo:(pos=2) AND_MAYBE (Zone:(pos=1) OR Zthree:(pos=3)))" },
110 : : { "subject:test other", "(ZXTtest:(pos=1) OR Zother:(pos=2))" },
111 : : { "subject:\"space flight\"", "(XTspace:(pos=1) PHRASE 2 XTflight:(pos=2))" },
112 : : { "author:(twain OR poe) OR flight", "(ZAtwain:(pos=1) OR ZApoe:(pos=2) OR Zflight:(pos=3))" },
113 : : { "author:(twain OR title:pit OR poe)", "(ZAtwain:(pos=1) OR ZXTpit:(pos=2) OR ZApoe:(pos=3))" },
114 : : { "title:2001 title:space", "(XT2001:(pos=1) OR ZXTspace:(pos=2))" },
115 : : { "(title:help)", "ZXThelp:(pos=1)" },
116 : : { "beer NOT \"orange juice\"", "(Zbeer:(pos=1) AND_NOT (orange:(pos=2) PHRASE 2 juice:(pos=3)))" },
117 : : { "beer AND NOT lager", "(Zbeer:(pos=1) AND_NOT Zlager:(pos=2))" },
118 : : { "beer AND -lager", "(Zbeer:(pos=1) AND_NOT Zlager:(pos=2))" },
119 : : { "beer AND +lager", "(Zbeer:(pos=1) AND Zlager:(pos=2))" },
120 : : { "A OR B NOT C", "(a:(pos=1) OR (b:(pos=2) AND_NOT c:(pos=3)))" },
121 : : { "A OR B AND NOT C", "(a:(pos=1) OR (b:(pos=2) AND_NOT c:(pos=3)))" },
122 : : { "A OR B AND -C", "(a:(pos=1) OR (b:(pos=2) AND_NOT c:(pos=3)))" },
123 : : { "A OR B AND +C", "(a:(pos=1) OR (b:(pos=2) AND c:(pos=3)))" },
124 : : { "A OR B XOR C", "(a:(pos=1) OR (b:(pos=2) XOR c:(pos=3)))" },
125 : : { "A XOR B NOT C", "(a:(pos=1) XOR (b:(pos=2) AND_NOT c:(pos=3)))" },
126 : : { "one AND two", "(Zone:(pos=1) AND Ztwo:(pos=2))" },
127 : : { "one A.N.D. two", "(Zone:(pos=1) OR and:(pos=2) OR Ztwo:(pos=3))" },
128 : : { "one \xc3\x81ND two", "(Zone:(pos=1) OR \xc3\xa1nd:(pos=2) OR Ztwo:(pos=3))" },
129 : : { "one author:AND two", "(Zone:(pos=1) OR Aand:(pos=2) OR Ztwo:(pos=3))" },
130 : : { "author:hyphen-ated", "(Ahyphen:(pos=1) PHRASE 2 Aated:(pos=2))" },
131 : : { "cvs site:xapian.org", "(Zcvs:(pos=1) FILTER Hxapian.org)" },
132 : : { "cvs -site:xapian.org", "(Zcvs:(pos=1) AND_NOT Hxapian.org)" },
133 : : { "foo -site:xapian.org bar", "((Zfoo:(pos=1) OR Zbar:(pos=2)) AND_NOT Hxapian.org)" },
134 : : { "site:xapian.org mail", "(Zmail:(pos=1) FILTER Hxapian.org)" },
135 : : { "-site:xapian.org mail", "(Zmail:(pos=1) AND_NOT Hxapian.org)" },
136 : : { "mail AND -site:xapian.org", "(Zmail:(pos=1) AND_NOT 0 * Hxapian.org)" },
137 : : { "-Wredundant-decls", "(wredundant:(pos=1) PHRASE 2 decls:(pos=2))" },
138 : : { "site:xapian.org", "0 * Hxapian.org" },
139 : : { "mug +site:xapian.org -site:cvs.xapian.org", "((Zmug:(pos=1) FILTER Hxapian.org) AND_NOT Hcvs.xapian.org)" },
140 : : { "mug -site:cvs.xapian.org +site:xapian.org", "((Zmug:(pos=1) FILTER Hxapian.org) AND_NOT Hcvs.xapian.org)" },
141 : : { "mug +site:xapian.org AND -site:cvs.xapian.org", "((Zmug:(pos=1) FILTER Hxapian.org) AND_NOT 0 * Hcvs.xapian.org)" },
142 : : { "mug site:xapian.org AND -site:cvs.xapian.org", "((Zmug:(pos=1) FILTER Hxapian.org) AND_NOT 0 * Hcvs.xapian.org)" },
143 : : { "mug site:xapian.org AND +site:cvs.xapian.org", "((Zmug:(pos=1) FILTER Hxapian.org) AND 0 * Hcvs.xapian.org)" },
144 : : { "NOT windows", "Syntax: <expression> NOT <expression>" },
145 : : { "a AND (NOT b)", "Syntax: <expression> NOT <expression>" },
146 : : { "AND NOT windows", "Syntax: <expression> AND NOT <expression>" },
147 : : { "AND -windows", "Syntax: <expression> AND <expression>" },
148 : : { "gordian NOT", "Syntax: <expression> NOT <expression>" },
149 : : { "gordian AND NOT", "Syntax: <expression> AND NOT <expression>" },
150 : : { "gordian AND -", "Syntax: <expression> AND <expression>" },
151 : : { "foo OR (something AND)", "Syntax: <expression> AND <expression>" },
152 : : { "OR foo", "Syntax: <expression> OR <expression>" },
153 : : { "XOR", "Syntax: <expression> XOR <expression>" },
154 : : { "hard\xa0space", "(Zhard:(pos=1) OR Zspace:(pos=2))" },
155 : : { " white\r\nspace\ttest ", "(Zwhite:(pos=1) OR Zspace:(pos=2) OR Ztest:(pos=3))" },
156 : : { "one AND two three", "(Zone:(pos=1) AND (Ztwo:(pos=2) OR Zthree:(pos=3)))" },
157 : : { "one two AND three", "((Zone:(pos=1) OR Ztwo:(pos=2)) AND Zthree:(pos=3))" },
158 : : { "one AND two/three", "(Zone:(pos=1) AND (two:(pos=2) PHRASE 2 three:(pos=3)))" },
159 : : { "one AND /two/three", "(Zone:(pos=1) AND (two:(pos=2) PHRASE 2 three:(pos=3)))" },
160 : : { "one AND/two/three", "(Zone:(pos=1) AND (two:(pos=2) PHRASE 2 three:(pos=3)))" },
161 : : { "one +/two/three", "((two:(pos=2) PHRASE 2 three:(pos=3)) AND_MAYBE Zone:(pos=1))" },
162 : : { "one//two", "(one:(pos=1) PHRASE 2 two:(pos=2))" },
163 : : { "\"missing quote", "(missing:(pos=1) PHRASE 2 quote:(pos=2))" },
164 : : { "DVD+RW", "(dvd:(pos=1) OR rw:(pos=2))" }, // Would a phrase be better?
165 : : { "+\"must have\" optional", "((must:(pos=1) PHRASE 2 have:(pos=2)) AND_MAYBE Zoption:(pos=3))" },
166 : : { "one NEAR two NEAR three", "(one:(pos=1) NEAR 12 two:(pos=2) NEAR 12 three:(pos=3))" },
167 : : { "something NEAR/3 else", "(something:(pos=1) NEAR 4 else:(pos=2))" },
168 : : { "a NEAR/6 b NEAR c", "(a:(pos=1) NEAR 8 b:(pos=2) NEAR 8 c:(pos=3))" },
169 : : { "something ADJ else", "(something:(pos=1) PHRASE 11 else:(pos=2))" },
170 : : { "something ADJ/3 else", "(something:(pos=1) PHRASE 4 else:(pos=2))" },
171 : : { "a ADJ/6 b ADJ c", "(a:(pos=1) PHRASE 8 b:(pos=2) PHRASE 8 c:(pos=3))" },
172 : : // Regression test - Unicode character values were truncated to 8 bits
173 : : // before testing C_isdigit(), so this rather artificial example parsed
174 : : // to: (a:(pos=1) NEAR 262 b:(pos=2))
175 : : { "a NEAR/\xc4\xb5 b", "(Za:(pos=1) OR (near:(pos=2) PHRASE 2 \xc4\xb5:(pos=3)) OR Zb:(pos=4))" },
176 : : { "a ADJ/\xc4\xb5 b", "(Za:(pos=1) OR (adj:(pos=2) PHRASE 2 \xc4\xb5:(pos=3)) OR Zb:(pos=4))" },
177 : : // Regression test - the first two cases were parsed as if the '/' were a
178 : : // space, which was inconsistent with the second two. Fixed in 1.2.5.
179 : : { "a NEAR/b", "(Za:(pos=1) OR (near:(pos=2) PHRASE 2 b:(pos=3)))" },
180 : : { "a ADJ/b", "(Za:(pos=1) OR (adj:(pos=2) PHRASE 2 b:(pos=3)))" },
181 : : { "a NEAR/b c", "(Za:(pos=1) OR (near:(pos=2) PHRASE 2 b:(pos=3)) OR Zc:(pos=4))" },
182 : : { "a ADJ/b c", "(Za:(pos=1) OR (adj:(pos=2) PHRASE 2 b:(pos=3)) OR Zc:(pos=4))" },
183 : : // Regression tests - + and - didn't work on bracketed subexpressions prior
184 : : // to 1.0.2.
185 : : { "+(one two) three", "((Zone:(pos=1) OR Ztwo:(pos=2)) AND_MAYBE Zthree:(pos=3))" },
186 : : { "zero -(one two)", "(Zzero:(pos=1) AND_NOT (Zone:(pos=2) OR Ztwo:(pos=3)))" },
187 : : // Feature tests that ':' is inserted between prefix and term correctly:
188 : : { "category:Foo", "0 * XCAT:Foo" },
189 : : { "category:foo", "0 * XCATfoo" },
190 : : { "category:\xc3\x96oo", "0 * XCAT\xc3\x96oo" },
191 : : // Feature tests for quoted boolean terms:
192 : : { "category:\"Hello world\"", "0 * XCAT:Hello world" },
193 : : { "category:\"literal \"\"\"", "0 * XCATliteral \"" },
194 : : { "category:\"(unterminated)", "0 * XCAT(unterminated)" },
195 : : // Real world examples from tweakers.net:
196 : : { "Call to undefined function: imagecreate()", "(call:(pos=1) OR Zto:(pos=2) OR Zundefin:(pos=3) OR Zfunction:(pos=4) OR imagecreate:(pos=5))" },
197 : : { "mysql_fetch_row(): supplied argument is not a valid MySQL result resource", "(mysql_fetch_row:(pos=1) OR Zsuppli:(pos=2) OR Zargument:(pos=3) OR Zis:(pos=4) OR Znot:(pos=5) OR Za:(pos=6) OR Zvalid:(pos=7) OR mysql:(pos=8) OR Zresult:(pos=9) OR Zresourc:(pos=10))" },
198 : : { "php date() nedelands", "(Zphp:(pos=1) OR date:(pos=2) OR Znedeland:(pos=3))" },
199 : : { "wget domein --http-user", "(Zwget:(pos=1) OR Zdomein:(pos=2) OR (http:(pos=3) PHRASE 2 user:(pos=4)))" },
200 : : { "@home problemen", "(Zhome:(pos=1) OR Zproblemen:(pos=2))" },
201 : : { "'ipacsum'", "Zipacsum:(pos=1)" },
202 : : { "canal + ", "Zcanal:(pos=1)" },
203 : : { "/var/run/mysqld/mysqld.sock", "(var:(pos=1) PHRASE 5 run:(pos=2) PHRASE 5 mysqld:(pos=3) PHRASE 5 mysqld:(pos=4) PHRASE 5 sock:(pos=5))" },
204 : : { "\"QSI-161 drivers\"", "(qsi:(pos=1) PHRASE 3 161:(pos=2) PHRASE 3 drivers:(pos=3))" },
205 : : { "\"e-cube\" barebone", "((e:(pos=1) PHRASE 2 cube:(pos=2)) OR Zbarebon:(pos=3))" },
206 : : { "\"./httpd: symbol not found: dlopen\"", "(httpd:(pos=1) PHRASE 5 symbol:(pos=2) PHRASE 5 not:(pos=3) PHRASE 5 found:(pos=4) PHRASE 5 dlopen:(pos=5))" },
207 : : { "ERROR 2003: Can't connect to MySQL server on 'localhost' (10061)", "(error:(pos=1) OR 2003:(pos=2) OR can't:(pos=3) OR Zconnect:(pos=4) OR Zto:(pos=5) OR mysql:(pos=6) OR Zserver:(pos=7) OR Zon:(pos=8) OR Zlocalhost:(pos=9) OR 10061:(pos=10))" },
208 : : { "location.href = \"\"", "(location:(pos=1) PHRASE 2 href:(pos=2))" },
209 : : { "method=\"post\" action=\"\">", "(method:(pos=1) OR post:(pos=2) OR action:(pos=3))" },
210 : : { "behuizing 19\" inch", "(Zbehuiz:(pos=1) OR 19:(pos=2) OR inch:(pos=3))" },
211 : : { "19\" rack", "(19:(pos=1) OR rack:(pos=2))" },
212 : : { "3,5\" mainboard", "(3,5:(pos=1) OR mainboard:(pos=2))" },
213 : : { "553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)", "(553:(pos=1) OR Zsorri:(pos=2) OR Zthat:(pos=3) OR Zdomain:(pos=4) OR Zisn't:(pos=5) OR Zin:(pos=6) OR Zmy:(pos=7) OR Zlist:(pos=8) OR Zof:(pos=9) OR Zallow:(pos=10) OR Zrcpthost:(pos=11) OR 5.7.1:(pos=12))" },
214 : : { "data error (clic redundancy check)", "(Zdata:(pos=1) OR Zerror:(pos=2) OR Zclic:(pos=3) OR Zredund:(pos=4) OR Zcheck:(pos=5))" },
215 : : { "? mediaplayer 9\"", "(Zmediaplay:(pos=1) OR 9:(pos=2))" },
216 : : { "date(\"w\")", "(date:(pos=1) OR w:(pos=2))" },
217 : : { "Syntaxisfout (operator ontbreekt ASP", "(syntaxisfout:(pos=1) OR Zoper:(pos=2) OR Zontbreekt:(pos=3) OR asp:(pos=4))" },
218 : : { "Request.ServerVariables(\"logon_user\")", "((request:(pos=1) PHRASE 2 servervariables:(pos=2)) OR logon_user:(pos=3))" },
219 : : { "ASP \"request.form\" van \\\"enctype=\"MULTIPART/FORM-DATA\"\\\"", "(asp:(pos=1) OR (request:(pos=2) PHRASE 2 form:(pos=3)) OR Zvan:(pos=4) OR enctype:(pos=5) OR (multipart:(pos=6) PHRASE 3 form:(pos=7) PHRASE 3 data:(pos=8)))" },
220 : : { "USER ftp (Login failed): Invalid shell: /sbin/nologin", "(user:(pos=1) OR Zftp:(pos=2) OR login:(pos=3) OR Zfail:(pos=4) OR invalid:(pos=5) OR Zshell:(pos=6) OR (sbin:(pos=7) PHRASE 2 nologin:(pos=8)))" },
221 : : { "ip_masq_new(proto=TCP)", "(ip_masq_new:(pos=1) OR proto:(pos=2) OR tcp:(pos=3))" },
222 : : { "\"document.write(\"", "(document:(pos=1) PHRASE 2 write:(pos=2))" },
223 : : { "ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)", "(error:(pos=1) OR 1045:(pos=2) OR access:(pos=3) OR Zdeni:(pos=4) OR Zfor:(pos=5) OR Zuser:(pos=6) OR (root:(pos=7) PHRASE 2 localhost:(pos=8)) OR using:(pos=9) OR Zpassword:(pos=10) OR no:(pos=11))" },
224 : : { "TIP !! subtitles op TV-out (via DVD max g400)", "(tip:(pos=1) OR Zsubtitl:(pos=2) OR Zop:(pos=3) OR (tv:(pos=4) PHRASE 2 out:(pos=5)) OR Zvia:(pos=6) OR dvd:(pos=7) OR Zmax:(pos=8) OR Zg400:(pos=9))" },
225 : : { "Gigabyte 8PE667 (de Ultra versie) of Asus A7N8X Deluxe", "(gigabyte:(pos=1) OR 8pe667:(pos=2) OR Zde:(pos=3) OR ultra:(pos=4) OR Zversi:(pos=5) OR Zof:(pos=6) OR asus:(pos=7) OR a7n8x:(pos=8) OR deluxe:(pos=9))" },
226 : : { "\"1) Ze testen 8x AF op de GFFX tegen \"", "(1:(pos=1) PHRASE 9 ze:(pos=2) PHRASE 9 testen:(pos=3) PHRASE 9 8x:(pos=4) PHRASE 9 af:(pos=5) PHRASE 9 op:(pos=6) PHRASE 9 de:(pos=7) PHRASE 9 gffx:(pos=8) PHRASE 9 tegen:(pos=9))" },
227 : : { "\") Ze houden geen rekening met de kwaliteit van AF. Als ze dat gedaan hadden dan waren ze tot de conclusie gekomen dat Performance AF (dus Bilinear AF) op de 9700Pro goed te vergelijken is met Balanced AF op de GFFX. En dan hadden ze ook gezien dat de GFFX niet kan tippen aan de Quality AF van de 9700Pro.\"", "(ze:(pos=1) PHRASE 59 houden:(pos=2) PHRASE 59 geen:(pos=3) PHRASE 59 rekening:(pos=4) PHRASE 59 met:(pos=5) PHRASE 59 de:(pos=6) PHRASE 59 kwaliteit:(pos=7) PHRASE 59 van:(pos=8) PHRASE 59 af:(pos=9) PHRASE 59 als:(pos=10) PHRASE 59 ze:(pos=11) PHRASE 59 dat:(pos=12) PHRASE 59 gedaan:(pos=13) PHRASE 59 hadden:(pos=14) PHRASE 59 dan:(pos=15) PHRASE 59 waren:(pos=16) PHRASE 59 ze:(pos=17) PHRASE 59 tot:(pos=18) PHRASE 59 de:(pos=19) PHRASE 59 conclusie:(pos=20) PHRASE 59 gekomen:(pos=21) PHRASE 59 dat:(pos=22) PHRASE 59 performance:(pos=23) PHRASE 59 af:(pos=24) PHRASE 59 dus:(pos=25) PHRASE 59 bilinear:(pos=26) PHRASE 59 af:(pos=27) PHRASE 59 op:(pos=28) PHRASE 59 de:(pos=29) PHRASE 59 9700pro:(pos=30) PHRASE 59 goed:(pos=31) PHRASE 59 te:(pos=32) PHRASE 59 vergelijken:(pos=33) PHRASE 59 is:(pos=34) PHRASE 59 met:(pos=35) PHRASE 59 balanced:(pos=36) PHRASE 59 af:(pos=37) PHRASE 59 op:(pos=38) PHRASE 59 de:(pos=39) PHRASE 59 gffx:(pos=40) PHRASE 59 en:(pos=41) PHRASE 59 dan:(pos=42) PHRASE 59 hadden:(pos=43) PHRASE 59 ze:(pos=44) PHRASE 59 ook:(pos=45) PHRASE 59 gezien:(pos=46) PHRASE 59 dat:(pos=47) PHRASE 59 de:(pos=48) PHRASE 59 gffx:(pos=49) PHRASE 59 niet:(pos=50) PHRASE 59 kan:(pos=51) PHRASE 59 tippen:(pos=52) PHRASE 59 aan:(pos=53) PHRASE 59 de:(pos=54) PHRASE 59 quality:(pos=55) PHRASE 59 af:(pos=56) PHRASE 59 van:(pos=57) PHRASE 59 de:(pos=58) PHRASE 59 9700pro:(pos=59))" },
228 : : { "\"Ze houden geen rekening met de kwaliteit van AF. Als ze dat gedaan hadden dan waren ze tot de conclusie gekomen dat Performance AF (dus Bilinear AF) op de 9700Pro goed te vergelijken is met Balanced AF op de GFFX. En dan hadden ze ook gezien dat de GFFX niet kan tippen aan de Quality AF van de 9700Pro.\"", "(ze:(pos=1) PHRASE 59 houden:(pos=2) PHRASE 59 geen:(pos=3) PHRASE 59 rekening:(pos=4) PHRASE 59 met:(pos=5) PHRASE 59 de:(pos=6) PHRASE 59 kwaliteit:(pos=7) PHRASE 59 van:(pos=8) PHRASE 59 af:(pos=9) PHRASE 59 als:(pos=10) PHRASE 59 ze:(pos=11) PHRASE 59 dat:(pos=12) PHRASE 59 gedaan:(pos=13) PHRASE 59 hadden:(pos=14) PHRASE 59 dan:(pos=15) PHRASE 59 waren:(pos=16) PHRASE 59 ze:(pos=17) PHRASE 59 tot:(pos=18) PHRASE 59 de:(pos=19) PHRASE 59 conclusie:(pos=20) PHRASE 59 gekomen:(pos=21) PHRASE 59 dat:(pos=22) PHRASE 59 performance:(pos=23) PHRASE 59 af:(pos=24) PHRASE 59 dus:(pos=25) PHRASE 59 bilinear:(pos=26) PHRASE 59 af:(pos=27) PHRASE 59 op:(pos=28) PHRASE 59 de:(pos=29) PHRASE 59 9700pro:(pos=30) PHRASE 59 goed:(pos=31) PHRASE 59 te:(pos=32) PHRASE 59 vergelijken:(pos=33) PHRASE 59 is:(pos=34) PHRASE 59 met:(pos=35) PHRASE 59 balanced:(pos=36) PHRASE 59 af:(pos=37) PHRASE 59 op:(pos=38) PHRASE 59 de:(pos=39) PHRASE 59 gffx:(pos=40) PHRASE 59 en:(pos=41) PHRASE 59 dan:(pos=42) PHRASE 59 hadden:(pos=43) PHRASE 59 ze:(pos=44) PHRASE 59 ook:(pos=45) PHRASE 59 gezien:(pos=46) PHRASE 59 dat:(pos=47) PHRASE 59 de:(pos=48) PHRASE 59 gffx:(pos=49) PHRASE 59 niet:(pos=50) PHRASE 59 kan:(pos=51) PHRASE 59 tippen:(pos=52) PHRASE 59 aan:(pos=53) PHRASE 59 de:(pos=54) PHRASE 59 quality:(pos=55) PHRASE 59 af:(pos=56) PHRASE 59 van:(pos=57) PHRASE 59 de:(pos=58) PHRASE 59 9700pro:(pos=59))" },
229 : : { "$structure = imap_header($mbox, $tt);", "(Zstructur:(pos=1) OR imap_header:(pos=2) OR Zmbox:(pos=3) OR Ztt:(pos=4))" },
230 : : { "\"ifup: Could not get a valid interface name: -> skipped\"", "(ifup:(pos=1) PHRASE 9 could:(pos=2) PHRASE 9 not:(pos=3) PHRASE 9 get:(pos=4) PHRASE 9 a:(pos=5) PHRASE 9 valid:(pos=6) PHRASE 9 interface:(pos=7) PHRASE 9 name:(pos=8) PHRASE 9 skipped:(pos=9))" },
231 : : { "Er kan geen combinatie van filters worden gevonden om de gegevensstroom te genereren. (Error=80040218)", "(er:(pos=1) OR Zkan:(pos=2) OR Zgeen:(pos=3) OR Zcombinati:(pos=4) OR Zvan:(pos=5) OR Zfilter:(pos=6) OR Zworden:(pos=7) OR Zgevonden:(pos=8) OR Zom:(pos=9) OR Zde:(pos=10) OR Zgegevensstroom:(pos=11) OR Zte:(pos=12) OR Zgenereren:(pos=13) OR error:(pos=14) OR 80040218:(pos=15))" },
232 : : { "ereg_replace(\"\\\\\",\"\\/\"", "ereg_replace:(pos=1)" },
233 : : { "\\\\\"divx+geen+geluid\\\\\"", "(divx:(pos=1) PHRASE 3 geen:(pos=2) PHRASE 3 geluid:(pos=3))" },
234 : : { "lcase(\"string\")", "(lcase:(pos=1) OR string:(pos=2))" },
235 : : { "isEmpty( ) functie in visual basic", "(isempty:(pos=1) OR Zfuncti:(pos=2) OR Zin:(pos=3) OR Zvisual:(pos=4) OR Zbasic:(pos=5))" },
236 : : { "*** stop: 0x0000001E (0xC0000005,0x00000000,0x00000000,0x00000000)", "(Zstop:(pos=1) OR 0x0000001e:(pos=2) OR 0xc0000005,0x00000000,0x00000000,0x00000000:(pos=3))" },
237 : : { "\"ctrl+v+c+a fout\"", "(ctrl:(pos=1) PHRASE 5 v:(pos=2) PHRASE 5 c:(pos=3) PHRASE 5 a:(pos=4) PHRASE 5 fout:(pos=5))" },
238 : : { "Server.CreateObject(\"ADODB.connection\")", "((server:(pos=1) PHRASE 2 createobject:(pos=2)) OR (adodb:(pos=3) PHRASE 2 connection:(pos=4)))" },
239 : : { "Presario 6277EA-XP model P4/28 GHz-120GB-DVD-CDRW (512MBWXP) (470048-012)", "(presario:(pos=1) OR (6277ea:(pos=2) PHRASE 2 xp:(pos=3)) OR Zmodel:(pos=4) OR (p4:(pos=5) PHRASE 2 28:(pos=6)) OR (ghz:(pos=7) PHRASE 4 120gb:(pos=8) PHRASE 4 dvd:(pos=9) PHRASE 4 cdrw:(pos=10)) OR 512mbwxp:(pos=11) OR (470048:(pos=12) PHRASE 2 012:(pos=13)))" },
240 : : { "Failed to connect agent. (AGENT=dbaxchg2, EC=UserId =NUll)", "(failed:(pos=1) OR Zto:(pos=2) OR Zconnect:(pos=3) OR Zagent:(pos=4) OR agent:(pos=5) OR Zdbaxchg2:(pos=6) OR ec:(pos=7) OR userid:(pos=8) OR null:(pos=9))" },
241 : : { "delphi CreateOleObject(\"MSXML2.DomDocument\")", "(Zdelphi:(pos=1) OR createoleobject:(pos=2) OR (msxml2:(pos=3) PHRASE 2 domdocument:(pos=4)))" },
242 : : { "Unhandled exeption in IEXPLORE.EXE (FTAPP.DLL)", "(unhandled:(pos=1) OR Zexept:(pos=2) OR Zin:(pos=3) OR (iexplore:(pos=4) PHRASE 2 exe:(pos=5)) OR (ftapp:(pos=6) PHRASE 2 dll:(pos=7)))" },
243 : : { "IBM High Rate Wireless LAN PCI Adapter (Low Profile Enabled)", "(ibm:(pos=1) OR high:(pos=2) OR rate:(pos=3) OR wireless:(pos=4) OR lan:(pos=5) OR pci:(pos=6) OR adapter:(pos=7) OR low:(pos=8) OR profile:(pos=9) OR enabled:(pos=10))" },
244 : : { "asp ' en \"", "(Zasp:(pos=1) OR Zen:(pos=2))" },
245 : : { "Hercules 3D Prophet 8500 LE 64MB (OEM, Radeon 8500 LE)", "(hercules:(pos=1) OR 3d:(pos=2) OR prophet:(pos=3) OR 8500:(pos=4) OR le:(pos=5) OR 64mb:(pos=6) OR oem:(pos=7) OR radeon:(pos=8) OR 8500:(pos=9) OR le:(pos=10))" },
246 : : { "session_set_cookie_params(echo \"hoi\")", "(session_set_cookie_params:(pos=1) OR Zecho:(pos=2) OR hoi:(pos=3))" },
247 : : { "windows update werkt niet (windows se", "(Zwindow:(pos=1) OR Zupdat:(pos=2) OR Zwerkt:(pos=3) OR Zniet:(pos=4) OR Zwindow:(pos=5) OR Zse:(pos=6))" },
248 : : { "De statuscode van de fout is ( 0 x 4 , 0 , 0 , 0 )", "(de:(pos=1) OR Zstatuscod:(pos=2) OR Zvan:(pos=3) OR Zde:(pos=4) OR Zfout:(pos=5) OR Zis:(pos=6) OR 0:(pos=7) OR Zx:(pos=8) OR 4:(pos=9) OR 0:(pos=10) OR 0:(pos=11) OR 0:(pos=12))" },
249 : : { "sony +(u20 u-20)", "((Zu20:(pos=2) OR (u:(pos=3) PHRASE 2 20:(pos=4))) AND_MAYBE Zsoni:(pos=1))" },
250 : : { "[crit] (17)File exists: unable to create scoreboard (name-based shared memory failure)", "(Zcrit:(pos=1) OR 17:(pos=2) OR file:(pos=3) OR Zexist:(pos=4) OR Zunabl:(pos=5) OR Zto:(pos=6) OR Zcreat:(pos=7) OR Zscoreboard:(pos=8) OR (name:(pos=9) PHRASE 2 based:(pos=10)) OR Zshare:(pos=11) OR Zmemori:(pos=12) OR Zfailur:(pos=13))" },
251 : : { "directories lokaal php (uitlezen OR inladen)", "(Zdirectori:(pos=1) OR Zlokaal:(pos=2) OR Zphp:(pos=3) OR Zuitlezen:(pos=4) OR Zinladen:(pos=5))" },
252 : : { "(multi pc modem)+ (line sync)", "(Zmulti:(pos=1) OR Zpc:(pos=2) OR Zmodem:(pos=3) OR Zline:(pos=4) OR Zsync:(pos=5))" },
253 : : { "xp 5.1.2600.0 (xpclient.010817-1148)", "(Zxp:(pos=1) OR 5.1.2600.0:(pos=2) OR (xpclient:(pos=3) PHRASE 3 010817:(pos=4) PHRASE 3 1148:(pos=5)))" },
254 : : { "DirectDraw test results: Failure at step 5 (User verification of rectangles): HRESULT = 0x00000000 (error code) Direct3D 7 test results: Failure at step 32 (User verification of Direct3D rendering): HRESULT = 0x00000000 (error code) Direct3D 8 test results: Failure at step 32 (User verification of Direct3D rendering): HRESULT = 0x00000000 (error code) Direct3D 9 test results: Failure at step 32 (User verification of Direct3D rendering): HRESULT = 0x00000000 (error code)", "(directdraw:(pos=1) OR Ztest:(pos=2) OR Zresult:(pos=3) OR failure:(pos=4) OR Zat:(pos=5) OR Zstep:(pos=6) OR 5:(pos=7) OR user:(pos=8) OR Zverif:(pos=9) OR Zof:(pos=10) OR Zrectangl:(pos=11) OR hresult:(pos=12) OR 0x00000000:(pos=13) OR Zerror:(pos=14) OR Zcode:(pos=15) OR direct3d:(pos=16) OR 7:(pos=17) OR Ztest:(pos=18) OR Zresult:(pos=19) OR failure:(pos=20) OR Zat:(pos=21) OR Zstep:(pos=22) OR 32:(pos=23) OR user:(pos=24) OR Zverif:(pos=25) OR Zof:(pos=26) OR direct3d:(pos=27) OR Zrender:(pos=28) OR hresult:(pos=29) OR 0x00000000:(pos=30) OR Zerror:(pos=31) OR Zcode:(pos=32) OR direct3d:(pos=33) OR 8:(pos=34) OR Ztest:(pos=35) OR Zresult:(pos=36) OR failure:(pos=37) OR Zat:(pos=38) OR Zstep:(pos=39) OR 32:(pos=40) OR user:(pos=41) OR Zverif:(pos=42) OR Zof:(pos=43) OR direct3d:(pos=44) OR Zrender:(pos=45) OR hresult:(pos=46) OR 0x00000000:(pos=47) OR Zerror:(pos=48) OR Zcode:(pos=49) OR direct3d:(pos=50) OR 9:(pos=51) OR Ztest:(pos=52) OR Zresult:(pos=53) OR failure:(pos=54) OR Zat:(pos=55) OR Zstep:(pos=56) OR 32:(pos=57) OR user:(pos=58) OR Zverif:(pos=59) OR Zof:(pos=60) OR direct3d:(pos=61) OR Zrender:(pos=62) OR hresult:(pos=63) OR 0x00000000:(pos=64) OR Zerror:(pos=65) OR Zcode:(pos=66))" },
255 : : { "Thermaltake Aquarius II waterkoeling (kompleet voor P4 en XP)", "(thermaltake:(pos=1) OR aquarius:(pos=2) OR ii:(pos=3) OR Zwaterkoel:(pos=4) OR Zkompleet:(pos=5) OR Zvoor:(pos=6) OR p4:(pos=7) OR Zen:(pos=8) OR xp:(pos=9))" },
256 : : { "E3501 unable to add job to database (EC=-2005)", "(e3501:(pos=1) OR Zunabl:(pos=2) OR Zto:(pos=3) OR Zadd:(pos=4) OR Zjob:(pos=5) OR Zto:(pos=6) OR Zdatabas:(pos=7) OR ec:(pos=8) OR 2005:(pos=9))" },
257 : : { "\"arp -s\" ip veranderen", "((arp:(pos=1) PHRASE 2 s:(pos=2)) OR Zip:(pos=3) OR Zveranderen:(pos=4))" },
258 : : { "header(\"content-type: application/octet-stream\");", "(header:(pos=1) OR (content:(pos=2) PHRASE 2 type:(pos=3)) OR (application:(pos=4) PHRASE 3 octet:(pos=5) PHRASE 3 stream:(pos=6)))" },
259 : : { "$datum = date(\"d-m-Y\");", "(Zdatum:(pos=1) OR date:(pos=2) OR (d:(pos=3) PHRASE 3 m:(pos=4) PHRASE 3 y:(pos=5)))" },
260 : : { "\"'\" +asp", "Zasp:(pos=1)" },
261 : : { "+session +[", "Zsession:(pos=1)" },
262 : : { "Dit apparaat kan niet starten. (Code 10)", "(dit:(pos=1) OR Zapparaat:(pos=2) OR Zkan:(pos=3) OR Zniet:(pos=4) OR Zstarten:(pos=5) OR code:(pos=6) OR 10:(pos=7))" },
263 : : { "\"You cannot use the Administration program while the Domino Server is running. Either shut down the Domino Server (but keep the file server running) or choose the ican labeled 'Lotus Notes' instead.\"", "(you:(pos=1) PHRASE 32 cannot:(pos=2) PHRASE 32 use:(pos=3) PHRASE 32 the:(pos=4) PHRASE 32 administration:(pos=5) PHRASE 32 program:(pos=6) PHRASE 32 while:(pos=7) PHRASE 32 the:(pos=8) PHRASE 32 domino:(pos=9) PHRASE 32 server:(pos=10) PHRASE 32 is:(pos=11) PHRASE 32 running:(pos=12) PHRASE 32 either:(pos=13) PHRASE 32 shut:(pos=14) PHRASE 32 down:(pos=15) PHRASE 32 the:(pos=16) PHRASE 32 domino:(pos=17) PHRASE 32 server:(pos=18) PHRASE 32 but:(pos=19) PHRASE 32 keep:(pos=20) PHRASE 32 the:(pos=21) PHRASE 32 file:(pos=22) PHRASE 32 server:(pos=23) PHRASE 32 running:(pos=24) PHRASE 32 or:(pos=25) PHRASE 32 choose:(pos=26) PHRASE 32 the:(pos=27) PHRASE 32 ican:(pos=28) PHRASE 32 labeled:(pos=29) PHRASE 32 lotus:(pos=30) PHRASE 32 notes:(pos=31) PHRASE 32 instead:(pos=32))" },
264 : : { "\"+irq +veranderen +xp\"", "(irq:(pos=1) PHRASE 3 veranderen:(pos=2) PHRASE 3 xp:(pos=3))" },
265 : : { "\"is not a member of 'operator``global namespace''' + c++", "(is:(pos=1) PHRASE 9 not:(pos=2) PHRASE 9 a:(pos=3) PHRASE 9 member:(pos=4) PHRASE 9 of:(pos=5) PHRASE 9 operator:(pos=6) PHRASE 9 global:(pos=7) PHRASE 9 namespace:(pos=8) PHRASE 9 c++:(pos=9))" },
266 : : { "mkdir() failed (File exists) php", "(mkdir:(pos=1) OR Zfail:(pos=2) OR file:(pos=3) OR Zexist:(pos=4) OR Zphp:(pos=5))" },
267 : : { "laatsteIndex(int n)", "(laatsteindex:(pos=1) OR Zint:(pos=2) OR Zn:(pos=3))" },
268 : : { "\"line+in\" OR \"c8783\"", "((line:(pos=1) PHRASE 2 in:(pos=2)) OR c8783:(pos=3))" },
269 : : { "if ($_POST['Submit'])", "(Zif:(pos=1) OR _post:(pos=2) OR submit:(pos=3))" },
270 : : { "NEC DVD+-RW ND-1300A", "(nec:(pos=1) OR (dvd+:(pos=2) PHRASE 2 rw:(pos=3)) OR (nd:(pos=4) PHRASE 2 1300a:(pos=5)))" },
271 : : { "*String not found* (*String not found*.)", "(string:(pos=1) OR Znot:(pos=2) OR found:(pos=3) OR string:(pos=4) OR Znot:(pos=5) OR found:(pos=6))" },
272 : : { "MSI G4Ti4200-TD 128MB (GeForce4 Ti4200)", "(msi:(pos=1) OR (g4ti4200:(pos=2) PHRASE 2 td:(pos=3)) OR 128mb:(pos=4) OR geforce4:(pos=5) OR ti4200:(pos=6))" },
273 : : { "href=\"#\"", "href:(pos=1)" },
274 : : { "Request.ServerVariables(\"REMOTE_USER\") javascript", "((request:(pos=1) PHRASE 2 servervariables:(pos=2)) OR remote_user:(pos=3) OR Zjavascript:(pos=4))" },
275 : : { "XF86Config(-4) waar", "(xf86config:(pos=1) OR 4:(pos=2) OR Zwaar:(pos=3))" },
276 : : { "Unknown (tag 2000)", "(unknown:(pos=1) OR Ztag:(pos=2) OR 2000:(pos=3))" },
277 : : { "KT4V(MS-6712)", "(kt4v:(pos=1) OR (ms:(pos=2) PHRASE 2 6712:(pos=3)))" },
278 : : { "scheduled+AND+nieuwsgroepen+AND+updaten", "(Zschedul:(pos=1) AND Znieuwsgroepen:(pos=2) AND Zupdaten:(pos=3))" },
279 : : { "137(netbios-ns)", "(137:(pos=1) OR (netbios:(pos=2) PHRASE 2 ns:(pos=3)))" },
280 : : { "HARWARE ERROR, TRACKING SERVO (4:0X09:0X01)", "(harware:(pos=1) OR error:(pos=2) OR tracking:(pos=3) OR servo:(pos=4) OR (4:(pos=5) PHRASE 3 0x09:(pos=6) PHRASE 3 0x01:(pos=7)))" },
281 : : { "Chr(10) wat is code van \" teken", "(chr:(pos=1) OR 10:(pos=2) OR Zwat:(pos=3) OR Zis:(pos=4) OR Zcode:(pos=5) OR Zvan:(pos=6) OR Zteken:(pos=7))" },
282 : : { "wat is code van \" teken", "(Zwat:(pos=1) OR Zis:(pos=2) OR Zcode:(pos=3) OR Zvan:(pos=4) OR teken:(pos=5))" },
283 : : { "The Jet VBA file (VBAJET.dll for 16-bit version, VBAJET32.dll version", "(the:(pos=1) OR jet:(pos=2) OR vba:(pos=3) OR Zfile:(pos=4) OR (vbajet:(pos=5) PHRASE 2 dll:(pos=6)) OR Zfor:(pos=7) OR (16:(pos=8) PHRASE 2 bit:(pos=9)) OR Zversion:(pos=10) OR (vbajet32:(pos=11) PHRASE 2 dll:(pos=12)) OR Zversion:(pos=13))" },
284 : : { "Permission denied (publickey,password,keyboard-interactive).", "(permission:(pos=1) OR Zdeni:(pos=2) OR Zpublickey:(pos=3) OR Zpassword:(pos=4) OR (keyboard:(pos=5) PHRASE 2 interactive:(pos=6)))" },
285 : : { "De lees- of schrijfbewerking (\"written\") op het geheugen is mislukt", "(de:(pos=1) OR Zlee:(pos=2) OR Zof:(pos=3) OR Zschrijfbewerk:(pos=4) OR written:(pos=5) OR Zop:(pos=6) OR Zhet:(pos=7) OR Zgeheugen:(pos=8) OR Zis:(pos=9) OR Zmislukt:(pos=10))" },
286 : : { "Primary IDE channel no 80 conductor cable installed\"", "(primary:(pos=1) OR ide:(pos=2) OR Zchannel:(pos=3) OR Zno:(pos=4) OR 80:(pos=5) OR Zconductor:(pos=6) OR Zcabl:(pos=7) OR installed:(pos=8))" },
287 : : { "\"2020 NEAR zoom\"", "(2020:(pos=1) PHRASE 3 near:(pos=2) PHRASE 3 zoom:(pos=3))" },
288 : : { "setcookie(\"naam\",\"$user\");", "(setcookie:(pos=1) OR naam:(pos=2) OR user:(pos=3))" },
289 : : { "MSI 645 Ultra (MS-6547) Ver1", "(msi:(pos=1) OR 645:(pos=2) OR ultra:(pos=3) OR (ms:(pos=4) PHRASE 2 6547:(pos=5)) OR ver1:(pos=6))" },
290 : : { "if ($HTTP", "(Zif:(pos=1) OR http:(pos=2))" },
291 : : { "data error(cyclic redundancy check)", "(Zdata:(pos=1) OR error:(pos=2) OR Zcyclic:(pos=3) OR Zredund:(pos=4) OR Zcheck:(pos=5))" },
292 : : { "UObject::StaticAllocateObject <- (NULL None) <- UObject::StaticConstructObject <- InitEngine", "((uobject:(pos=1) PHRASE 2 staticallocateobject:(pos=2)) OR null:(pos=3) OR none:(pos=4) OR (uobject:(pos=5) PHRASE 2 staticconstructobject:(pos=6)) OR initengine:(pos=7))" },
293 : : { "Failure at step 8 (Creating 3D Device)", "(failure:(pos=1) OR Zat:(pos=2) OR Zstep:(pos=3) OR 8:(pos=4) OR creating:(pos=5) OR 3d:(pos=6) OR device:(pos=7))" },
294 : : { "Call Shell(\"notepad.exe\",", "(call:(pos=1) OR shell:(pos=2) OR (notepad:(pos=3) PHRASE 2 exe:(pos=4)))" },
295 : : { "2.5\" harddisk converter", "(2.5:(pos=1) OR (harddisk:(pos=2) PHRASE 2 converter:(pos=3)))" }, // FIXME better if " didn't generate a phrase here...
296 : : { "creative labs \"dvd+rw\"", "(Zcreativ:(pos=1) OR Zlab:(pos=2) OR (dvd:(pos=3) PHRASE 2 rw:(pos=4)))" },
297 : : { "\"het beleid van deze computer staat u niet toe interactief", "(het:(pos=1) PHRASE 10 beleid:(pos=2) PHRASE 10 van:(pos=3) PHRASE 10 deze:(pos=4) PHRASE 10 computer:(pos=5) PHRASE 10 staat:(pos=6) PHRASE 10 u:(pos=7) PHRASE 10 niet:(pos=8) PHRASE 10 toe:(pos=9) PHRASE 10 interactief:(pos=10))" },
298 : : { "ati radeon \"driver cleaner", "(Zati:(pos=1) OR Zradeon:(pos=2) OR (driver:(pos=3) PHRASE 2 cleaner:(pos=4)))" },
299 : : { "\"../\" path", "Zpath:(pos=1)" },
300 : : { "(novell client) workstation only", "(Znovel:(pos=1) OR Zclient:(pos=2) OR Zworkstat:(pos=3) OR Zonli:(pos=4))" },
301 : : { "Unable to find libgd.(a|so) anywhere", "(unable:(pos=1) OR Zto:(pos=2) OR Zfind:(pos=3) OR Zlibgd:(pos=4) OR Za:(pos=5) OR Zso:(pos=6) OR Zanywher:(pos=7))" },
302 : : { "\"libstdc++-libc6.1-1.so.2\"", "(libstdc++:(pos=1) PHRASE 5 libc6.1:(pos=2) PHRASE 5 1:(pos=3) PHRASE 5 so:(pos=4) PHRASE 5 2:(pos=5))" },
303 : : { "ipsec_setup (/etc/ipsec.conf, line 1) cannot open configuration file \"/etc/ipsec.conf\" -- `' aborted", "(Zipsec_setup:(pos=1) OR (etc:(pos=2) PHRASE 3 ipsec:(pos=3) PHRASE 3 conf:(pos=4)) OR Zline:(pos=5) OR 1:(pos=6) OR Zcannot:(pos=7) OR Zopen:(pos=8) OR Zconfigur:(pos=9) OR Zfile:(pos=10) OR (etc:(pos=11) PHRASE 3 ipsec:(pos=12) PHRASE 3 conf:(pos=13)) OR Zabort:(pos=14))" },
304 : : { "Forwarden van domeinnaam (naar HTTP adres)", "(forwarden:(pos=1) OR Zvan:(pos=2) OR Zdomeinnaam:(pos=3) OR Znaar:(pos=4) OR http:(pos=5) OR Zadr:(pos=6))" },
305 : : { "Compaq HP, 146.8 GB (MPN-286716-B22) Hard Drives", "(compaq:(pos=1) OR hp:(pos=2) OR 146.8:(pos=3) OR gb:(pos=4) OR (mpn:(pos=5) PHRASE 3 286716:(pos=6) PHRASE 3 b22:(pos=7)) OR hard:(pos=8) OR drives:(pos=9))" },
306 : : { "httpd (no pid file) not running", "(Zhttpd:(pos=1) OR Zno:(pos=2) OR Zpid:(pos=3) OR Zfile:(pos=4) OR Znot:(pos=5) OR Zrun:(pos=6))" },
307 : : { "apache httpd (pid file) not running", "(Zapach:(pos=1) OR Zhttpd:(pos=2) OR Zpid:(pos=3) OR Zfile:(pos=4) OR Znot:(pos=5) OR Zrun:(pos=6))" },
308 : : { "Klasse is niet geregistreerd (Fout=80040154).", "(klasse:(pos=1) OR Zis:(pos=2) OR Zniet:(pos=3) OR Zgeregistreerd:(pos=4) OR fout:(pos=5) OR 80040154:(pos=6))" },
309 : : { "\"dvd+r\" \"dvd-r\"", "((dvd:(pos=1) PHRASE 2 r:(pos=2)) OR (dvd:(pos=3) PHRASE 2 r:(pos=4)))" },
310 : : { "\"=\" tekens uit csvfile", "(Zteken:(pos=1) OR Zuit:(pos=2) OR Zcsvfile:(pos=3))" },
311 : : { "libc.so.6(GLIBC_2.3)", "((libc:(pos=1) PHRASE 3 so:(pos=2) PHRASE 3 6:(pos=3)) OR glibc_2.3:(pos=4))" },
312 : : { "Sitecom Broadband xDSL / Cable Router 4S (DC-202)", "(sitecom:(pos=1) OR broadband:(pos=2) OR Zxdsl:(pos=3) OR cable:(pos=4) OR router:(pos=5) OR 4s:(pos=6) OR (dc:(pos=7) PHRASE 2 202:(pos=8)))" },
313 : : { "(t-mobile) bereik", "((t:(pos=1) PHRASE 2 mobile:(pos=2)) OR Zbereik:(pos=3))" },
314 : : { "error LNK2001: unresolved external symbol \"public", "(Zerror:(pos=1) OR lnk2001:(pos=2) OR Zunresolv:(pos=3) OR Zextern:(pos=4) OR Zsymbol:(pos=5) OR public:(pos=6))" },
315 : : { "patch linux exploit -p)", "(Zpatch:(pos=1) OR Zlinux:(pos=2) OR Zexploit:(pos=3) OR Zp:(pos=4))" },
316 : : { "MYD not found (Errcode: 2)", "(myd:(pos=1) OR Znot:(pos=2) OR Zfound:(pos=3) OR errcode:(pos=4) OR 2:(pos=5))" },
317 : : { "ob_start(\"ob_gzhandler\"); file download", "(ob_start:(pos=1) OR ob_gzhandler:(pos=2) OR Zfile:(pos=3) OR Zdownload:(pos=4))" },
318 : : { "ECS Elitegroup K7VZA (VIA VT8363/VT8363A)", "(ecs:(pos=1) OR elitegroup:(pos=2) OR k7vza:(pos=3) OR via:(pos=4) OR (vt8363:(pos=5) PHRASE 2 vt8363a:(pos=6)))" },
319 : : { "ASUS A7V8X (LAN + Serial-ATA + Firewire + Raid + Audio)", "(asus:(pos=1) OR a7v8x:(pos=2) OR lan:(pos=3) OR (serial:(pos=4) PHRASE 2 ata:(pos=5)) OR firewire:(pos=6) OR raid:(pos=7) OR audio:(pos=8))" },
320 : : { "Javascript:history.go(-1)", "((javascript:(pos=1) PHRASE 3 history:(pos=2) PHRASE 3 go:(pos=3)) OR 1:(pos=4))" },
321 : : { "java :) als icon", "(Zjava:(pos=1) OR Zal:(pos=2) OR Zicon:(pos=3))" },
322 : : { "onmouseover=setPointer(this", "(onmouseover:(pos=1) OR setpointer:(pos=2) OR Zthis:(pos=3))" },
323 : : { "\" in vbscript", "(in:(pos=1) PHRASE 2 vbscript:(pos=2))" },
324 : : { "IRC (FAQ OR (hulp NEAR bij))", "(irc:(pos=1) OR faq:(pos=2) OR (hulp:(pos=3) NEAR 11 bij:(pos=4)))" },
325 : : { "setProperty(\"McSquare\"+i, _xscale, _xscale++);", "(setproperty:(pos=1) OR mcsquare:(pos=2) OR Zi:(pos=3) OR _xscale:(pos=4) OR _xscale++:(pos=5))" },
326 : : { "[warn] Apache does not support line-end comments. Consider using quotes around argument: \"#-1\"", "(Zwarn:(pos=1) OR apache:(pos=2) OR Zdoe:(pos=3) OR Znot:(pos=4) OR Zsupport:(pos=5) OR (line:(pos=6) PHRASE 2 end:(pos=7)) OR Zcomment:(pos=8) OR consider:(pos=9) OR Zuse:(pos=10) OR Zquot:(pos=11) OR Zaround:(pos=12) OR Zargument:(pos=13) OR 1:(pos=14))" },
327 : : { "(php.ini) (memory_limit)", "((php:(pos=1) PHRASE 2 ini:(pos=2)) OR Zmemory_limit:(pos=3))" },
328 : : { "line 8: syntax error near unexpected token `kernel_thread(f'", "(Zline:(pos=1) OR 8:(pos=2) OR Zsyntax:(pos=3) OR Zerror:(pos=4) OR Znear:(pos=5) OR Zunexpect:(pos=6) OR Ztoken:(pos=7) OR kernel_thread:(pos=8) OR Zf:(pos=9))" },
329 : : { "VXD NAVEX()@)", "(vxd:(pos=1) OR navex:(pos=2))" },
330 : : { "\"Iiyama AS4314UT 17\" \"", "(iiyama:(pos=1) PHRASE 3 as4314ut:(pos=2) PHRASE 3 17:(pos=3))" },
331 : : { "include (\"$id.html\");", "(Zinclud:(pos=1) OR (id:(pos=2) PHRASE 2 html:(pos=3)))" },
332 : : { "include id.Today's date is: <? print (date (\"M d, Y\")); ?>hp", "(Zinclud:(pos=1) OR (id:(pos=2) PHRASE 2 today's:(pos=3)) OR Zdate:(pos=4) OR Zis:(pos=5) OR Zprint:(pos=6) OR Zdate:(pos=7) OR (m:(pos=8) PHRASE 3 d:(pos=9) PHRASE 3 y:(pos=10)) OR Zhp:(pos=11))" },
333 : : { "(program files\\common) opstarten", "(Zprogram:(pos=1) OR (files:(pos=2) PHRASE 2 common:(pos=3)) OR Zopstarten:(pos=4))" },
334 : : { "java \" string", "(Zjava:(pos=1) OR string:(pos=2))" },
335 : : { "+=", "" },
336 : : { "php +=", "Zphp:(pos=1)" },
337 : : { "[php] ereg_replace(\".\"", "(Zphp:(pos=1) OR ereg_replace:(pos=2))" },
338 : : { "\"echo -e\" kleur", "((echo:(pos=1) PHRASE 2 e:(pos=2)) OR Zkleur:(pos=3))" },
339 : : { "adobe premiere \"-1\"", "(Zadob:(pos=1) OR Zpremier:(pos=2) OR 1:(pos=3))" },
340 : : { "DVD brander \"+\" en \"-\"", "(dvd:(pos=1) OR Zbrander:(pos=2) OR Zen:(pos=3))" },
341 : : { "inspirion \"dvd+R\"", "(Zinspirion:(pos=1) OR (dvd:(pos=2) PHRASE 2 r:(pos=3)))" },
342 : : { "asp 0x80040E14)", "(Zasp:(pos=1) OR 0x80040e14:(pos=2))" },
343 : : { "\"e-tech motorola router", "(e:(pos=1) PHRASE 4 tech:(pos=2) PHRASE 4 motorola:(pos=3) PHRASE 4 router:(pos=4))" },
344 : : { "bluetooth '1.3.2.19\"", "(Zbluetooth:(pos=1) OR 1.3.2.19:(pos=2))" },
345 : : { "ms +-connect", "(Zms:(pos=1) OR Zconnect:(pos=2))" },
346 : : { "php+print+\"", "(Zphp:(pos=1) OR print+:(pos=2))" },
347 : : { "athlon 1400 :welke videokaart\"", "(Zathlon:(pos=1) OR 1400:(pos=2) OR Zwelk:(pos=3) OR videokaart:(pos=4))" },
348 : : { "+-dvd", "Zdvd:(pos=1)" },
349 : : { "glftpd \"-new-\"", "(Zglftpd:(pos=1) OR new:(pos=2))" },
350 : : { "\"scandisk + dos5.0", "(scandisk:(pos=1) PHRASE 2 dos5.0:(pos=2))" },
351 : : { "socket\\(\\)", "socket:(pos=1)" },
352 : : { "msn (e-tech) router", "(Zmsn:(pos=1) OR (e:(pos=2) PHRASE 2 tech:(pos=3)) OR Zrouter:(pos=4))" },
353 : : { "Het grote Epox 8k3a+ ervaring/prob topic\"", "(het:(pos=1) OR Zgrote:(pos=2) OR epox:(pos=3) OR 8k3a+:(pos=4) OR (ervaring:(pos=5) PHRASE 2 prob:(pos=6)) OR topic:(pos=7))" },
354 : : { "\"CF+bluetooth\"", "(cf:(pos=1) PHRASE 2 bluetooth:(pos=2))" },
355 : : { "kwaliteit (s-video) composite verschil tv out", "(Zkwaliteit:(pos=1) OR (s:(pos=2) PHRASE 2 video:(pos=3)) OR Zcomposit:(pos=4) OR Zverschil:(pos=5) OR Ztv:(pos=6) OR Zout:(pos=7))" },
356 : : { "Wie kan deze oude hardware nog gebruiken\" Deel", "(wie:(pos=1) OR Zkan:(pos=2) OR Zdeze:(pos=3) OR Zoud:(pos=4) OR Zhardwar:(pos=5) OR Znog:(pos=6) OR gebruiken:(pos=7) OR deel:(pos=8))" },
357 : : { "Public Declare Sub Sleep Lib \"kernel32\" (ByVal dwMilliseconds As Long)", "(public:(pos=1) OR declare:(pos=2) OR sub:(pos=3) OR sleep:(pos=4) OR lib:(pos=5) OR kernel32:(pos=6) OR byval:(pos=7) OR Zdwmillisecond:(pos=8) OR as:(pos=9) OR long:(pos=10))" },
358 : : { "for inclusion (include_path='.:/usr/share/php')", "(Zfor:(pos=1) OR Zinclus:(pos=2) OR include_path:(pos=3) OR (usr:(pos=4) PHRASE 3 share:(pos=5) PHRASE 3 php:(pos=6)))" },
359 : : { "\"muziek 2x zo snel\"\"", "(muziek:(pos=1) PHRASE 4 2x:(pos=2) PHRASE 4 zo:(pos=3) PHRASE 4 snel:(pos=4))" },
360 : : { "execCommand('inserthorizontalrule'", "(execcommand:(pos=1) OR Zinserthorizontalrul:(pos=2))" },
361 : : { "specs: IBM PS/2, Intel 8086 @ 25 mhz!!, 2 mb intern, 50 mb hd, 5.5\" floppy drive, toetsenbord en geen muis", "(Zspec:(pos=1) OR ibm:(pos=2) OR (ps:(pos=3) PHRASE 2 2:(pos=4)) OR intel:(pos=5) OR 8086:(pos=6) OR 25:(pos=7) OR Zmhz:(pos=8) OR 2:(pos=9) OR Zmb:(pos=10) OR Zintern:(pos=11) OR 50:(pos=12) OR Zmb:(pos=13) OR Zhd:(pos=14) OR 5.5:(pos=15) OR (floppy:(pos=16) PHRASE 6 drive:(pos=17) PHRASE 6 toetsenbord:(pos=18) PHRASE 6 en:(pos=19) PHRASE 6 geen:(pos=20) PHRASE 6 muis:(pos=21)))" },
362 : : { "History: GetEventTool <- GetMusicManager <- GetMusicScript <- DMCallRoutine <- AMusicScriptEvent::execCallRoutine <- UObject::execClassContext <- (U2GameInfo M08A1.U2GameInfo0 @ Function U2.U2GameInfo.NotifyLevelChangeEnd : 0075 line 744) <- UObject::ProcessEvent <- (U2GameInfo M08A1.U2GameInfo0, Function U2.U2GameInfo.NotifyLevelChangeEnd) <- UGameEngine::LoadMap <- LocalMapURL <- UGameEngine::Browse <- ServerTravel <- UGameEngine::Tick <- UpdateWorld <- MainLoop", "(history:(pos=1) OR geteventtool:(pos=2) OR getmusicmanager:(pos=3) OR getmusicscript:(pos=4) OR dmcallroutine:(pos=5) OR (amusicscriptevent:(pos=6) PHRASE 2 execcallroutine:(pos=7)) OR (uobject:(pos=8) PHRASE 2 execclasscontext:(pos=9)) OR u2gameinfo:(pos=10) OR (m08a1:(pos=11) PHRASE 2 u2gameinfo0:(pos=12)) OR function:(pos=13) OR (u2:(pos=14) PHRASE 3 u2gameinfo:(pos=15) PHRASE 3 notifylevelchangeend:(pos=16)) OR 0075:(pos=17) OR Zline:(pos=18) OR 744:(pos=19) OR (uobject:(pos=20) PHRASE 2 processevent:(pos=21)) OR u2gameinfo:(pos=22) OR (m08a1:(pos=23) PHRASE 2 u2gameinfo0:(pos=24)) OR function:(pos=25) OR (u2:(pos=26) PHRASE 3 u2gameinfo:(pos=27) PHRASE 3 notifylevelchangeend:(pos=28)) OR (ugameengine:(pos=29) PHRASE 2 loadmap:(pos=30)) OR localmapurl:(pos=31) OR (ugameengine:(pos=32) PHRASE 2 browse:(pos=33)) OR servertravel:(pos=34) OR (ugameengine:(pos=35) PHRASE 2 tick:(pos=36)) OR updateworld:(pos=37) OR mainloop:(pos=38))" },
363 : : { "Support AMD XP 2400+ & 2600+ (K7T Turbo2 only)", "(support:(pos=1) OR amd:(pos=2) OR xp:(pos=3) OR 2400+:(pos=4) OR 2600+:(pos=5) OR k7t:(pos=6) OR turbo2:(pos=7) OR Zonli:(pos=8))" },
364 : : { "'\"><br>bla</br>", "(br:(pos=1) PHRASE 3 bla:(pos=2) PHRASE 3 br:(pos=3))" },
365 : : { "The instruction at \"0x30053409\" referenced memory at \"0x06460504\". The memory could not be \"read'. Click OK to terminate the application.", "(the:(pos=1) OR Zinstruct:(pos=2) OR Zat:(pos=3) OR 0x30053409:(pos=4) OR Zreferenc:(pos=5) OR Zmemori:(pos=6) OR Zat:(pos=7) OR 0x06460504:(pos=8) OR the:(pos=9) OR Zmemori:(pos=10) OR Zcould:(pos=11) OR Znot:(pos=12) OR Zbe:(pos=13) OR (read:(pos=14) PHRASE 7 click:(pos=15) PHRASE 7 ok:(pos=16) PHRASE 7 to:(pos=17) PHRASE 7 terminate:(pos=18) PHRASE 7 the:(pos=19) PHRASE 7 application:(pos=20)))" },
366 : : { "\"(P5A-b)\"", "(p5a:(pos=1) PHRASE 2 b:(pos=2))" },
367 : : { "(13,5 > 13) == no-go!", "(13,5:(pos=1) OR 13:(pos=2) OR (no:(pos=3) PHRASE 2 go:(pos=4)))" },
368 : : { "eth not found \"ifconfig -a\"", "(Zeth:(pos=1) OR Znot:(pos=2) OR Zfound:(pos=3) OR (ifconfig:(pos=4) PHRASE 2 a:(pos=5)))" },
369 : : { "<META NAME=\"ROBOTS", "(meta:(pos=1) OR name:(pos=2) OR robots:(pos=3))" },
370 : : { "lp0: using parport0 (interrupt-driven)", "(Zlp0:(pos=1) OR Zuse:(pos=2) OR Zparport0:(pos=3) OR (interrupt:(pos=4) PHRASE 2 driven:(pos=5)))" },
371 : : { "ULTRA PC-TUNING, COOLING & MODDING (4,6)", "(ultra:(pos=1) OR (pc:(pos=2) PHRASE 2 tuning:(pos=3)) OR cooling:(pos=4) OR modding:(pos=5) OR 4,6:(pos=6))" },
372 : : { "512MB PC2700 DDR SDRAM Rood (Dane-Elec)", "(512mb:(pos=1) OR pc2700:(pos=2) OR ddr:(pos=3) OR sdram:(pos=4) OR rood:(pos=5) OR (dane:(pos=6) PHRASE 2 elec:(pos=7)))" },
373 : : { "header(\"Content Type: text/html\");", "(header:(pos=1) OR content:(pos=2) OR type:(pos=3) OR (text:(pos=4) PHRASE 2 html:(pos=5)))" },
374 : : { "\"-RW\" \"+RW\"", "(rw:(pos=1) OR rw:(pos=2))" },
375 : : { "\"cresta digital answering machine", "(cresta:(pos=1) PHRASE 4 digital:(pos=2) PHRASE 4 answering:(pos=3) PHRASE 4 machine:(pos=4))" },
376 : : { "Arctic Super Silent PRO TC (Athlon/P3 - 2,3 GHz)", "(arctic:(pos=1) OR super:(pos=2) OR silent:(pos=3) OR pro:(pos=4) OR tc:(pos=5) OR (athlon:(pos=6) PHRASE 2 p3:(pos=7)) OR 2,3:(pos=8) OR ghz:(pos=9))" },
377 : : { "c++ fopen \"r+t\"", "(Zc++:(pos=1) OR Zfopen:(pos=2) OR (r:(pos=3) PHRASE 2 t:(pos=4)))" },
378 : : { "c++ fopen (r+t)", "(Zc++:(pos=1) OR Zfopen:(pos=2) OR Zr:(pos=3) OR Zt:(pos=4))" },
379 : : { "\"DVD+R\"", "(dvd:(pos=1) PHRASE 2 r:(pos=2))" },
380 : : { "Class.forName(\"jdbc.odbc.JdbcOdbcDriver\");", "((class:(pos=1) PHRASE 2 forname:(pos=2)) OR (jdbc:(pos=3) PHRASE 3 odbc:(pos=4) PHRASE 3 jdbcodbcdriver:(pos=5)))" },
381 : : { "perl(find.pl)", "(perl:(pos=1) OR (find:(pos=2) PHRASE 2 pl:(pos=3)))" },
382 : : { "\"-5v\" voeding", "(5v:(pos=1) OR Zvoed:(pos=2))" },
383 : : { "\"-5v\" power supply", "(5v:(pos=1) OR Zpower:(pos=2) OR Zsuppli:(pos=3))" },
384 : : { "An Error occurred whie attempting to initialize the Borland Database Engine (error $2108)", "(an:(pos=1) OR error:(pos=2) OR Zoccur:(pos=3) OR Zwhie:(pos=4) OR Zattempt:(pos=5) OR Zto:(pos=6) OR Ziniti:(pos=7) OR Zthe:(pos=8) OR borland:(pos=9) OR database:(pos=10) OR engine:(pos=11) OR Zerror:(pos=12) OR 2108:(pos=13))" },
385 : : { "(error $2108) Borland", "(Zerror:(pos=1) OR 2108:(pos=2) OR borland:(pos=3))" },
386 : : { "On Friday 04 April 2003 09:32, Edwin van Eersel wrote: > ik voel me eigenlijk wel behoorlijk kut :)", "(on:(pos=1) OR friday:(pos=2) OR 04:(pos=3) OR april:(pos=4) OR 2003:(pos=5) OR (09:(pos=6) PHRASE 2 32:(pos=7)) OR edwin:(pos=8) OR Zvan:(pos=9) OR eersel:(pos=10) OR Zwrote:(pos=11) OR Zik:(pos=12) OR Zvoel:(pos=13) OR Zme:(pos=14) OR Zeigenlijk:(pos=15) OR Zwel:(pos=16) OR Zbehoorlijk:(pos=17) OR Zkut:(pos=18))" },
387 : : { "Elektrotechniek + \"hoe bevalt het?\"\"", "(elektrotechniek:(pos=1) OR (hoe:(pos=2) PHRASE 3 bevalt:(pos=3) PHRASE 3 het:(pos=4)))" },
388 : : { "Shortcuts in menu (java", "(shortcuts:(pos=1) OR Zin:(pos=2) OR Zmenu:(pos=3) OR Zjava:(pos=4))" },
389 : : { "detonator+settings\"", "(Zdeton:(pos=1) OR settings:(pos=2))" },
390 : : { "(ez-bios) convert", "((ez:(pos=1) PHRASE 2 bios:(pos=2)) OR Zconvert:(pos=3))" },
391 : : { "Sparkle 7100M4 64MB (GeForce4 MX440)", "(sparkle:(pos=1) OR 7100m4:(pos=2) OR 64mb:(pos=3) OR geforce4:(pos=4) OR mx440:(pos=5))" },
392 : : { "freebsd \"boek OR newbie\"", "(Zfreebsd:(pos=1) OR (boek:(pos=2) PHRASE 3 or:(pos=3) PHRASE 3 newbie:(pos=4)))" },
393 : : { "for (;;) c++", "(Zfor:(pos=1) OR Zc++:(pos=2))" },
394 : : { "1700+-2100+", "(1700+:(pos=1) PHRASE 2 2100+:(pos=2))" },
395 : : { "PHP Warning: Invalid library (maybe not a PHP library) 'libmysqlclient.so'", "(php:(pos=1) OR warning:(pos=2) OR invalid:(pos=3) OR Zlibrari:(pos=4) OR Zmayb:(pos=5) OR Znot:(pos=6) OR Za:(pos=7) OR php:(pos=8) OR Zlibrari:(pos=9) OR (libmysqlclient:(pos=10) PHRASE 2 so:(pos=11)))" },
396 : : { "NEC DV-5800B (Bul", "(nec:(pos=1) OR (dv:(pos=2) PHRASE 2 5800b:(pos=3)) OR bul:(pos=4))" },
397 : : { "org.jdom.input.SAXBuilder.<init>(SAXBuilder.java)", "((org:(pos=1) PHRASE 4 jdom:(pos=2) PHRASE 4 input:(pos=3) PHRASE 4 saxbuilder:(pos=4)) OR init:(pos=5) OR (saxbuilder:(pos=6) PHRASE 2 java:(pos=7)))" },
398 : : { "AMD Athlon XP 2500+ (1,83GHz, 512KB)", "(amd:(pos=1) OR athlon:(pos=2) OR xp:(pos=3) OR 2500+:(pos=4) OR 1,83ghz:(pos=5) OR 512kb:(pos=6))" },
399 : : { "'q ben\"", "(Zq:(pos=1) OR ben:(pos=2))" },
400 : : { "getsmbfilepwent: malformed password entry (uid not number)", "(Zgetsmbfilepw:(pos=1) OR Zmalform:(pos=2) OR Zpassword:(pos=3) OR Zentri:(pos=4) OR Zuid:(pos=5) OR Znot:(pos=6) OR Znumber:(pos=7))" },
401 : : { "\xc3\xb6ude onderdelen\"", "(Z\xc3\xb6ude:(pos=1) OR onderdelen:(pos=2))" },
402 : : { "Heeft iemand enig idee waarom de pioneer (zelf met originele firmware van pioneer) bij mij niet wil flashen ?" "?", "(heeft:(pos=1) OR Ziemand:(pos=2) OR Zenig:(pos=3) OR Zide:(pos=4) OR Zwaarom:(pos=5) OR Zde:(pos=6) OR Zpioneer:(pos=7) OR Zzelf:(pos=8) OR Zmet:(pos=9) OR Zoriginel:(pos=10) OR Zfirmwar:(pos=11) OR Zvan:(pos=12) OR Zpioneer:(pos=13) OR Zbij:(pos=14) OR Zmij:(pos=15) OR Zniet:(pos=16) OR Zwil:(pos=17) OR Zflashen:(pos=18))" }, // Split ? and ? to avoid trigram problems
403 : : { "asus a7v266 bios nieuw -(a7v266-e)", "((Zasus:(pos=1) OR Za7v266:(pos=2) OR Zbio:(pos=3) OR Znieuw:(pos=4)) AND_NOT (a7v266:(pos=5) PHRASE 2 e:(pos=6)))" },
404 : : { "cybercom \"dvd+r\"", "(Zcybercom:(pos=1) OR (dvd:(pos=2) PHRASE 2 r:(pos=3)))" },
405 : : { "AMD PCNET Family Ethernet Adapter (PCI-ISA)", "(amd:(pos=1) OR pcnet:(pos=2) OR family:(pos=3) OR ethernet:(pos=4) OR adapter:(pos=5) OR (pci:(pos=6) PHRASE 2 isa:(pos=7)))" },
406 : : { "relais +/-", "Zrelai:(pos=1)" },
407 : : { "formules (slepen OR doortrekken) excel", "(Zformul:(pos=1) OR Zslepen:(pos=2) OR Zdoortrekken:(pos=3) OR Zexcel:(pos=4))" },
408 : : { "\"%English", "english:(pos=1)" },
409 : : { "select max( mysql", "(Zselect:(pos=1) OR max:(pos=2) OR Zmysql:(pos=3))" },
410 : : { "leejow(saait", "(leejow:(pos=1) OR Zsaait:(pos=2))" },
411 : : { "'Windows 2000 Advanced Server\" netwerkverbinding valt steeds weg", "(windows:(pos=1) OR 2000:(pos=2) OR advanced:(pos=3) OR server:(pos=4) OR (netwerkverbinding:(pos=5) PHRASE 4 valt:(pos=6) PHRASE 4 steeds:(pos=7) PHRASE 4 weg:(pos=8)))" },
412 : : { "K7T Turbo 2 (MS-6330)", "(k7t:(pos=1) OR turbo:(pos=2) OR 2:(pos=3) OR (ms:(pos=4) PHRASE 2 6330:(pos=5)))" },
413 : : { "failed to receive data from the client agent. (ec=1)", "(Zfail:(pos=1) OR Zto:(pos=2) OR Zreceiv:(pos=3) OR Zdata:(pos=4) OR Zfrom:(pos=5) OR Zthe:(pos=6) OR Zclient:(pos=7) OR Zagent:(pos=8) OR ec:(pos=9) OR 1:(pos=10))" },
414 : : { "\"cannot find -lz\"", "(cannot:(pos=1) PHRASE 3 find:(pos=2) PHRASE 3 lz:(pos=3))" },
415 : : { "undefined reference to `mysql_drop_db'\"", "(Zundefin:(pos=1) OR Zrefer:(pos=2) OR Zto:(pos=3) OR Zmysql_drop_db:(pos=4))" },
416 : : { "search form asp \"%'", "(Zsearch:(pos=1) OR Zform:(pos=2) OR Zasp:(pos=3))" },
417 : : { "(dvd+r) kwaliteit", "(Zdvd:(pos=1) OR Zr:(pos=2) OR Zkwaliteit:(pos=3))" },
418 : : { "Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 35 bytes)", "(fatal:(pos=1) OR Zerror:(pos=2) OR allowed:(pos=3) OR Zmemori:(pos=4) OR Zsize:(pos=5) OR Zof:(pos=6) OR 8388608:(pos=7) OR Zbyte:(pos=8) OR Zexhaust:(pos=9) OR Ztri:(pos=10) OR Zto:(pos=11) OR Zalloc:(pos=12) OR 35:(pos=13) OR Zbyte:(pos=14))" },
419 : : { "geluid (schokt OR hapert)", "(Zgeluid:(pos=1) OR Zschokt:(pos=2) OR Zhapert:(pos=3))" },
420 : : { "Het wordt pas echt leuk als het hard staat!! >:)", "(het:(pos=1) OR Zwordt:(pos=2) OR Zpas:(pos=3) OR Zecht:(pos=4) OR Zleuk:(pos=5) OR Zal:(pos=6) OR Zhet:(pos=7) OR Zhard:(pos=8) OR Zstaat:(pos=9))" },
421 : : { "Uw configuratie bestand bevat instellingen (root zonder wachtwoord) die betrekking hebben tot de standaard MySQL account. Uw MySQL server draait met deze standaard waardes, en is open voor ongewilde toegang, het wordt dus aangeraden dit op te lossen", "(uw:(pos=1) OR Zconfigurati:(pos=2) OR Zbestand:(pos=3) OR Zbevat:(pos=4) OR Zinstellingen:(pos=5) OR Zroot:(pos=6) OR Zzonder:(pos=7) OR Zwachtwoord:(pos=8) OR Zdie:(pos=9) OR Zbetrekk:(pos=10) OR Zhebben:(pos=11) OR Ztot:(pos=12) OR Zde:(pos=13) OR Zstandaard:(pos=14) OR mysql:(pos=15) OR Zaccount:(pos=16) OR uw:(pos=17) OR mysql:(pos=18) OR Zserver:(pos=19) OR Zdraait:(pos=20) OR Zmet:(pos=21) OR Zdeze:(pos=22) OR Zstandaard:(pos=23) OR Zwaard:(pos=24) OR Zen:(pos=25) OR Zis:(pos=26) OR Zopen:(pos=27) OR Zvoor:(pos=28) OR Zongewild:(pos=29) OR Ztoegang:(pos=30) OR Zhet:(pos=31) OR Zwordt:(pos=32) OR Zdus:(pos=33) OR Zaangeraden:(pos=34) OR Zdit:(pos=35) OR Zop:(pos=36) OR Zte:(pos=37) OR Zlossen:(pos=38))" },
422 : : { "(library qt-mt) not found", "(Zlibrari:(pos=1) OR (qt:(pos=2) PHRASE 2 mt:(pos=3)) OR Znot:(pos=4) OR Zfound:(pos=5))" },
423 : : { "Qt (>= Qt 3.0.3) (library qt-mt) not found", "(qt:(pos=1) OR qt:(pos=2) OR 3.0.3:(pos=3) OR Zlibrari:(pos=4) OR (qt:(pos=5) PHRASE 2 mt:(pos=6)) OR Znot:(pos=7) OR Zfound:(pos=8))" },
424 : : { "setup was unable to find (or could not read) the language specific setup resource dll, unable to continue. Please reboot and try again.", "(Zsetup:(pos=1) OR Zwas:(pos=2) OR Zunabl:(pos=3) OR Zto:(pos=4) OR Zfind:(pos=5) OR Zor:(pos=6) OR Zcould:(pos=7) OR Znot:(pos=8) OR Zread:(pos=9) OR Zthe:(pos=10) OR Zlanguag:(pos=11) OR Zspecif:(pos=12) OR Zsetup:(pos=13) OR Zresourc:(pos=14) OR Zdll:(pos=15) OR Zunabl:(pos=16) OR Zto:(pos=17) OR Zcontinu:(pos=18) OR please:(pos=19) OR Zreboot:(pos=20) OR Zand:(pos=21) OR Ztri:(pos=22) OR Zagain:(pos=23))" },
425 : : { "Titan TTC-D5TB(4/CU35)", "(titan:(pos=1) OR (ttc:(pos=2) PHRASE 2 d5tb:(pos=3)) OR (4:(pos=4) PHRASE 2 cu35:(pos=5)))" },
426 : : { "[php] date( min", "(Zphp:(pos=1) OR date:(pos=2) OR Zmin:(pos=3))" },
427 : : { "EPOX EP-8RDA+ (nForce2 SPP+MCP-T) Rev. 1.1", "(epox:(pos=1) OR (ep:(pos=2) PHRASE 2 8rda+:(pos=3)) OR Znforce2:(pos=4) OR spp:(pos=5) OR (mcp:(pos=6) PHRASE 2 t:(pos=7)) OR rev:(pos=8) OR 1.1:(pos=9))" },
428 : : { "554 5.4.6 Too many hops 53 (25 max)", "(554:(pos=1) OR 5.4.6:(pos=2) OR too:(pos=3) OR Zmani:(pos=4) OR Zhop:(pos=5) OR 53:(pos=6) OR 25:(pos=7) OR Zmax:(pos=8))" },
429 : : { "ik had toch nog een vraagje: er zijn nu eigenlijk alleen maar schijfjes van 4.7GB alleen straks zullen er vast schijfjes van meer dan 4.7GB komen. Zal deze brander dit wel kunnen schijven?" "?(na bijvoorbeeld een firmware update?) ben erg benieuwd", "(Zik:(pos=1) OR Zhad:(pos=2) OR Ztoch:(pos=3) OR Znog:(pos=4) OR Zeen:(pos=5) OR Zvraagj:(pos=6) OR Zer:(pos=7) OR Zzijn:(pos=8) OR Znu:(pos=9) OR Zeigenlijk:(pos=10) OR Zalleen:(pos=11) OR Zmaar:(pos=12) OR Zschijfj:(pos=13) OR Zvan:(pos=14) OR 4.7gb:(pos=15) OR Zalleen:(pos=16) OR Zstrak:(pos=17) OR Zzullen:(pos=18) OR Zer:(pos=19) OR Zvast:(pos=20) OR Zschijfj:(pos=21) OR Zvan:(pos=22) OR Zmeer:(pos=23) OR Zdan:(pos=24) OR 4.7gb:(pos=25) OR Zkomen:(pos=26) OR zal:(pos=27) OR Zdeze:(pos=28) OR Zbrander:(pos=29) OR Zdit:(pos=30) OR Zwel:(pos=31) OR Zkunnen:(pos=32) OR Zschijven:(pos=33) OR Zna:(pos=34) OR Zbijvoorbeeld:(pos=35) OR Zeen:(pos=36) OR Zfirmwar:(pos=37) OR Zupdat:(pos=38) OR Zben:(pos=39) OR Zerg:(pos=40) OR Zbenieuwd:(pos=41))" }, // Split ? and ? to avoid trigram problems
430 : : { "ati linux drivers (4.3.0)", "(Zati:(pos=1) OR Zlinux:(pos=2) OR Zdriver:(pos=3) OR 4.3.0:(pos=4))" },
431 : : { "ENCAPSED_AND_WHITESPACE", "encapsed_and_whitespace:(pos=1)" },
432 : : { "lpadmin: add-printer (set device) failed: client-error-not-possible", "(Zlpadmin:(pos=1) OR (add:(pos=2) PHRASE 2 printer:(pos=3)) OR Zset:(pos=4) OR Zdevic:(pos=5) OR Zfail:(pos=6) OR (client:(pos=7) PHRASE 4 error:(pos=8) PHRASE 4 not:(pos=9) PHRASE 4 possible:(pos=10)))" },
433 : : { "welke dvd \"+r\" media", "(Zwelk:(pos=1) OR Zdvd:(pos=2) OR r:(pos=3) OR Zmedia:(pos=4))" },
434 : : { "Warning: stat failed for fotos(errno=2 - No such file or directory)", "(warning:(pos=1) OR Zstat:(pos=2) OR Zfail:(pos=3) OR Zfor:(pos=4) OR fotos:(pos=5) OR errno:(pos=6) OR 2:(pos=7) OR no:(pos=8) OR Zsuch:(pos=9) OR Zfile:(pos=10) OR Zor:(pos=11) OR Zdirectori:(pos=12))" },
435 : : { "dvd +/-", "Zdvd:(pos=1)" },
436 : : { "7vaxp +voltage mod\"", "(Zvoltag:(pos=2) AND_MAYBE (7vaxp:(pos=1) OR mod:(pos=3)))" },
437 : : { "lpt port (SPP/EPP) is enabled", "(Zlpt:(pos=1) OR Zport:(pos=2) OR (spp:(pos=3) PHRASE 2 epp:(pos=4)) OR Zis:(pos=5) OR Zenabl:(pos=6))" },
438 : : { "getenv(\"HTTP_REFERER\")", "(getenv:(pos=1) OR http_referer:(pos=2))" },
439 : : { "Error setting display mode: CreateDevice failed (D3DERR_DRIVERINTERNALERROR)", "(error:(pos=1) OR Zset:(pos=2) OR Zdisplay:(pos=3) OR Zmode:(pos=4) OR createdevice:(pos=5) OR Zfail:(pos=6) OR d3derr_driverinternalerror:(pos=7))" },
440 : : { "Exception number: c0000005 (access violation)", "(exception:(pos=1) OR Znumber:(pos=2) OR Zc0000005:(pos=3) OR Zaccess:(pos=4) OR Zviolat:(pos=5))" },
441 : : { "header(\"Content-type:application/octetstream\");", "(header:(pos=1) OR (content:(pos=2) PHRASE 4 type:(pos=3) PHRASE 4 application:(pos=4) PHRASE 4 octetstream:(pos=5)))" },
442 : : { "java.security.AccessControlException: access denied (java.lang.RuntimePermission accessClassInPackage.sun.jdbc.odbc)", "((java:(pos=1) PHRASE 3 security:(pos=2) PHRASE 3 accesscontrolexception:(pos=3)) OR Zaccess:(pos=4) OR Zdeni:(pos=5) OR (java:(pos=6) PHRASE 3 lang:(pos=7) PHRASE 3 runtimepermission:(pos=8)) OR (accessclassinpackage:(pos=9) PHRASE 4 sun:(pos=10) PHRASE 4 jdbc:(pos=11) PHRASE 4 odbc:(pos=12)))" },
443 : : { "(001.part.met", "(001:(pos=1) PHRASE 3 part:(pos=2) PHRASE 3 met:(pos=3))" },
444 : : { "Warning: mail(): Use the -f option (5th param) to include valid reply-to address ! in /usr/home/vdb/www/mail.php on line 79", "(warning:(pos=1) OR mail:(pos=2) OR use:(pos=3) OR Zthe:(pos=4) OR Zf:(pos=5) OR Zoption:(pos=6) OR 5th:(pos=7) OR Zparam:(pos=8) OR Zto:(pos=9) OR Zinclud:(pos=10) OR Zvalid:(pos=11) OR (reply:(pos=12) PHRASE 2 to:(pos=13)) OR Zaddress:(pos=14) OR Zin:(pos=15) OR (usr:(pos=16) PHRASE 6 home:(pos=17) PHRASE 6 vdb:(pos=18) PHRASE 6 www:(pos=19) PHRASE 6 mail:(pos=20) PHRASE 6 php:(pos=21)) OR Zon:(pos=22) OR Zline:(pos=23) OR 79:(pos=24))" },
445 : : { "PHP Use the -f option (5th param)", "((php:(pos=1) OR use:(pos=2) OR Zthe:(pos=3) OR Zoption:(pos=5) OR 5th:(pos=6) OR Zparam:(pos=7)) AND_NOT Zf:(pos=4))" },
446 : : { "dvd \"+\" \"-\"", "Zdvd:(pos=1)" },
447 : : { "bericht ( %)", "Zbericht:(pos=1)" },
448 : : { "2500+ of 2600+ (niett OC)", "(2500+:(pos=1) OR Zof:(pos=2) OR 2600+:(pos=3) OR Zniett:(pos=4) OR oc:(pos=5))" },
449 : : { "maxtor windows xp werkt The drivers for this device are not installed. (Code 28)", "(Zmaxtor:(pos=1) OR Zwindow:(pos=2) OR Zxp:(pos=3) OR Zwerkt:(pos=4) OR the:(pos=5) OR Zdriver:(pos=6) OR Zfor:(pos=7) OR Zthis:(pos=8) OR Zdevic:(pos=9) OR Zare:(pos=10) OR Znot:(pos=11) OR Zinstal:(pos=12) OR code:(pos=13) OR 28:(pos=14))" },
450 : : { "Warning: stat failed for /mnt/web/react/got/react/board/non-www/headlines/tnet-headlines.txt (errno=2 - No such file or directory) in /mnt/web/react/got/react/global/non-www/templates/got/functions.inc.php on line 303", "(warning:(pos=1) OR Zstat:(pos=2) OR Zfail:(pos=3) OR Zfor:(pos=4) OR (mnt:(pos=5) PHRASE 12 web:(pos=6) PHRASE 12 react:(pos=7) PHRASE 12 got:(pos=8) PHRASE 12 react:(pos=9) PHRASE 12 board:(pos=10) PHRASE 12 non:(pos=11) PHRASE 12 www:(pos=12) PHRASE 12 headlines:(pos=13) PHRASE 12 tnet:(pos=14) PHRASE 12 headlines:(pos=15) PHRASE 12 txt:(pos=16)) OR errno:(pos=17) OR 2:(pos=18) OR no:(pos=19) OR Zsuch:(pos=20) OR Zfile:(pos=21) OR Zor:(pos=22) OR Zdirectori:(pos=23) OR Zin:(pos=24) OR (mnt:(pos=25) PHRASE 13 web:(pos=26) PHRASE 13 react:(pos=27) PHRASE 13 got:(pos=28) PHRASE 13 react:(pos=29) PHRASE 13 global:(pos=30) PHRASE 13 non:(pos=31) PHRASE 13 www:(pos=32) PHRASE 13 templates:(pos=33) PHRASE 13 got:(pos=34) PHRASE 13 functions:(pos=35) PHRASE 13 inc:(pos=36) PHRASE 13 php:(pos=37)) OR Zon:(pos=38) OR Zline:(pos=39) OR 303:(pos=40))" },
451 : : { "apm: BIOS version 1.2 Flags 0x03 (Driver version 1.16)", "(Zapm:(pos=1) OR bios:(pos=2) OR Zversion:(pos=3) OR 1.2:(pos=4) OR flags:(pos=5) OR 0x03:(pos=6) OR driver:(pos=7) OR Zversion:(pos=8) OR 1.16:(pos=9))" },
452 : : { "GA-8IHXP(3.0)", "((ga:(pos=1) PHRASE 2 8ihxp:(pos=2)) OR 3.0:(pos=3))" },
453 : : { "8IHXP(3.0)", "(8ihxp:(pos=1) OR 3.0:(pos=2))" },
454 : : { "na\xc2\xb7si (de ~ (m.))", "(Zna\xc2\xb7si:(pos=1) OR Zde:(pos=2) OR Zm:(pos=3))" },
455 : : { "header(\"Content-Disposition: attachment;", "(header:(pos=1) OR (content:(pos=2) PHRASE 3 disposition:(pos=3) PHRASE 3 attachment:(pos=4)))" },
456 : : { "\"header(\"Content-Disposition: attachment;\"", "(header:(pos=1) OR (content:(pos=2) PHRASE 2 disposition:(pos=3)) OR Zattach:(pos=4))" },
457 : : { "\"Beep -f\"", "(beep:(pos=1) PHRASE 2 f:(pos=2))" },
458 : : { "kraan NEAR (Elektrisch OR Electrisch)", "(Zkraan:(pos=1) OR near:(pos=2) OR elektrisch:(pos=3) OR or:(pos=4) OR electrisch:(pos=5))" },
459 : : { "checking for Qt... configure: error: Qt (>= Qt 3.0.2) (headers and libraries) not found. Please check your installation!", "(Zcheck:(pos=1) OR Zfor:(pos=2) OR qt:(pos=3) OR Zconfigur:(pos=4) OR Zerror:(pos=5) OR qt:(pos=6) OR qt:(pos=7) OR 3.0.2:(pos=8) OR Zheader:(pos=9) OR Zand:(pos=10) OR Zlibrari:(pos=11) OR Znot:(pos=12) OR Zfound:(pos=13) OR please:(pos=14) OR Zcheck:(pos=15) OR Zyour:(pos=16) OR Zinstal:(pos=17))" },
460 : : { "parse error, unexpected '\\\"', expecting T_STRING or T_VARIABLE or T_NUM_STRING", "(Zpars:(pos=1) OR Zerror:(pos=2) OR Zunexpect:(pos=3) OR (expecting:(pos=4) PHRASE 6 t_string:(pos=5) PHRASE 6 or:(pos=6) PHRASE 6 t_variable:(pos=7) PHRASE 6 or:(pos=8) PHRASE 6 t_num_string:(pos=9)))" },
461 : : { "ac3 (0x2000) \"Dolby Laboratories,", "(Zac3:(pos=1) OR 0x2000:(pos=2) OR (dolby:(pos=3) PHRASE 2 laboratories:(pos=4)))" },
462 : : { "Movie.FileName=(\"../../../~animations/\"+lesson1.recordset.fields('column3')+\"Intro.avi\")", "((movie:(pos=1) PHRASE 2 filename:(pos=2)) OR animations:(pos=3) OR (lesson1:(pos=4) PHRASE 3 recordset:(pos=5) PHRASE 3 fields:(pos=6)) OR Zcolumn3:(pos=7) OR (intro:(pos=8) PHRASE 2 avi:(pos=9)))" },
463 : : { "502 Permission Denied - Permission Denied - news.chello.nl -- http://www.chello.nl/ (Typhoon v1.2.3)", "(502:(pos=1) OR permission:(pos=2) OR denied:(pos=3) OR permission:(pos=4) OR denied:(pos=5) OR (news:(pos=6) PHRASE 3 chello:(pos=7) PHRASE 3 nl:(pos=8)) OR (http:(pos=9) PHRASE 4 www:(pos=10) PHRASE 4 chello:(pos=11) PHRASE 4 nl:(pos=12)) OR typhoon:(pos=13) OR Zv1.2.3:(pos=14))" },
464 : : { "Motion JPEG (MJPEG codec)", "(motion:(pos=1) OR jpeg:(pos=2) OR mjpeg:(pos=3) OR Zcodec:(pos=4))" },
465 : : { ": zoomtext\"", "zoomtext:(pos=1)" },
466 : : { "Your SORT command does not seem to support the \"-r -n -k 7\"", "(your:(pos=1) OR sort:(pos=2) OR Zcommand:(pos=3) OR Zdoe:(pos=4) OR Znot:(pos=5) OR Zseem:(pos=6) OR Zto:(pos=7) OR Zsupport:(pos=8) OR Zthe:(pos=9) OR (r:(pos=10) PHRASE 4 n:(pos=11) PHRASE 4 k:(pos=12) PHRASE 4 7:(pos=13)))" },
467 : : { "Geef de naam van de MSDOS prompt op C:\\\\WINDOWS.COM\\\"", "(geef:(pos=1) OR Zde:(pos=2) OR Znaam:(pos=3) OR Zvan:(pos=4) OR Zde:(pos=5) OR msdos:(pos=6) OR Zprompt:(pos=7) OR Zop:(pos=8) OR (c:(pos=9) PHRASE 3 windows:(pos=10) PHRASE 3 com:(pos=11)))" },
468 : : { "\"\"wa is fase\"", "(Zwa:(pos=1) OR Zis:(pos=2) OR fase:(pos=3))" },
469 : : { "<v:imagedata src=\"", "((v:(pos=1) PHRASE 2 imagedata:(pos=2)) OR src:(pos=3))" },
470 : : { "system(play ringin.wav); ?>", "(system:(pos=1) OR Zplay:(pos=2) OR (ringin:(pos=3) PHRASE 2 wav:(pos=4)))" },
471 : : { "\"perfect NEAR systems\"", "(perfect:(pos=1) PHRASE 3 near:(pos=2) PHRASE 3 systems:(pos=3))" },
472 : : { "LoadLibrary(\"mainta/gamex86.dll\") failed", "(loadlibrary:(pos=1) OR (mainta:(pos=2) PHRASE 3 gamex86:(pos=3) PHRASE 3 dll:(pos=4)) OR Zfail:(pos=5))" },
473 : : { "DATE_FORMAT('1997-10-04 22:23:00', '%W %M %Y');", "(date_format:(pos=1) OR (1997:(pos=2) PHRASE 3 10:(pos=3) PHRASE 3 04:(pos=4)) OR (22:(pos=5) PHRASE 3 23:(pos=6) PHRASE 3 00:(pos=7)) OR w:(pos=8) OR m:(pos=9) OR y:(pos=10))" },
474 : : { "secundaire IDE-controller (dubbele fifo)", "(Zsecundair:(pos=1) OR (ide:(pos=2) PHRASE 2 controller:(pos=3)) OR Zdubbel:(pos=4) OR Zfifo:(pos=5))" },
475 : : { "\"Postal2+Explorer.exe\"", "(postal2:(pos=1) PHRASE 3 explorer:(pos=2) PHRASE 3 exe:(pos=3))" },
476 : : { "COUNT(*)", "count:(pos=1)" },
477 : : { "Nuttige Windows progs (1/11)", "(nuttige:(pos=1) OR windows:(pos=2) OR Zprog:(pos=3) OR (1:(pos=4) PHRASE 2 11:(pos=5)))" },
478 : : { "if(usercode==passcode==)", "(if:(pos=1) OR usercode:(pos=2) OR passcode:(pos=3))" },
479 : : { "lg 8160b (dvd+r)", "(Zlg:(pos=1) OR 8160b:(pos=2) OR Zdvd:(pos=3) OR Zr:(pos=4))" },
480 : : { "iPAQ Pocket PC 2002 End User Update (EUU - Service Pack)", "(Zipaq:(pos=1) OR pocket:(pos=2) OR pc:(pos=3) OR 2002:(pos=4) OR end:(pos=5) OR user:(pos=6) OR update:(pos=7) OR euu:(pos=8) OR service:(pos=9) OR pack:(pos=10))" },
481 : : { "'ipod pakt tags niet\"", "(Zipod:(pos=1) OR Zpakt:(pos=2) OR Ztag:(pos=3) OR niet:(pos=4))" },
482 : : { "\"DVD+/-R\"", "(dvd+:(pos=1) PHRASE 2 r:(pos=2))" },
483 : : { "\"DVD+R DVD-R\"", "(dvd:(pos=1) PHRASE 4 r:(pos=2) PHRASE 4 dvd:(pos=3) PHRASE 4 r:(pos=4))" },
484 : : { "php ;) in een array zetten", "(Zphp:(pos=1) OR Zin:(pos=2) OR Zeen:(pos=3) OR Zarray:(pos=4) OR Zzetten:(pos=5))" },
485 : : { "De inhoud van uw advertentie is niet geschikt voor plaatsing op marktplaats! (001", "(de:(pos=1) OR Zinhoud:(pos=2) OR Zvan:(pos=3) OR Zuw:(pos=4) OR Zadvertenti:(pos=5) OR Zis:(pos=6) OR Zniet:(pos=7) OR Zgeschikt:(pos=8) OR Zvoor:(pos=9) OR Zplaats:(pos=10) OR Zop:(pos=11) OR Zmarktplaat:(pos=12) OR 001:(pos=13))" },
486 : : { "creative (soundblaster OR sb) 128", "(Zcreativ:(pos=1) OR Zsoundblast:(pos=2) OR Zsb:(pos=3) OR 128:(pos=4))" },
487 : : { "Can't open file: (errno: 145)", "(can't:(pos=1) OR Zopen:(pos=2) OR Zfile:(pos=3) OR Zerrno:(pos=4) OR 145:(pos=5))" },
488 : : { "Formateren lukt niet(98,XP)", "(formateren:(pos=1) OR Zlukt:(pos=2) OR niet:(pos=3) OR 98:(pos=4) OR xp:(pos=5))" },
489 : : { "access denied (java.io.", "(Zaccess:(pos=1) OR Zdeni:(pos=2) OR (java:(pos=3) PHRASE 2 io:(pos=4)))" },
490 : : { "(access denied (java.io.)", "(Zaccess:(pos=1) OR Zdeni:(pos=2) OR (java:(pos=3) PHRASE 2 io:(pos=4)))" },
491 : : { "wil niet installeren ( crc fouten)", "(Zwil:(pos=1) OR Zniet:(pos=2) OR Zinstalleren:(pos=3) OR Zcrc:(pos=4) OR Zfouten:(pos=5))" },
492 : : { "(DVD+RW) brandsoftware meerdere", "(dvd:(pos=1) OR rw:(pos=2) OR Zbrandsoftwar:(pos=3) OR Zmeerder:(pos=4))" },
493 : : { "(database OF databases) EN geheugen", "(Zdatabas:(pos=1) OR of:(pos=2) OR Zdatabas:(pos=3) OR en:(pos=4) OR Zgeheugen:(pos=5))" },
494 : : { "(server 2003) winroute", "(Zserver:(pos=1) OR 2003:(pos=2) OR Zwinrout:(pos=3))" },
495 : : { "54MHz (kanaal 2 VHF) tot tenminste 806 MHz (kanaal 69 UHF)", "(54mhz:(pos=1) OR Zkanaal:(pos=2) OR 2:(pos=3) OR vhf:(pos=4) OR Ztot:(pos=5) OR Ztenminst:(pos=6) OR 806:(pos=7) OR mhz:(pos=8) OR Zkanaal:(pos=9) OR 69:(pos=10) OR uhf:(pos=11))" },
496 : : { "(draadloos OR wireless) netwerk", "(Zdraadloo:(pos=1) OR Zwireless:(pos=2) OR Znetwerk:(pos=3))" },
497 : : { "localtime(time(NULL));", "(localtime:(pos=1) OR time:(pos=2) OR null:(pos=3))" },
498 : : { "ob_start(\"ob_gzhandler\");", "(ob_start:(pos=1) OR ob_gzhandler:(pos=2))" },
499 : : { "PPP Closed : LCP Time-out (VPN-0)", "(ppp:(pos=1) OR closed:(pos=2) OR lcp:(pos=3) OR (time:(pos=4) PHRASE 2 out:(pos=5)) OR (vpn:(pos=6) PHRASE 2 0:(pos=7)))" },
500 : : { "COM+-gebeurtenissysteem", "(com+:(pos=1) PHRASE 2 gebeurtenissysteem:(pos=2))" },
501 : : { "rcpthosts (#5.7.1)", "(Zrcpthost:(pos=1) OR 5.7.1:(pos=2))" },
502 : : { "Dit apparaat werkt niet goed omdat Windows de voor dit apparaat vereiste stuurprogramma's niet kan laden. (Code 31)", "(dit:(pos=1) OR Zapparaat:(pos=2) OR Zwerkt:(pos=3) OR Zniet:(pos=4) OR Zgo:(pos=5) OR Zomdat:(pos=6) OR windows:(pos=7) OR Zde:(pos=8) OR Zvoor:(pos=9) OR Zdit:(pos=10) OR Zapparaat:(pos=11) OR Zvereist:(pos=12) OR Zstuurprogramma:(pos=13) OR Zniet:(pos=14) OR Zkan:(pos=15) OR Zladen:(pos=16) OR code:(pos=17) OR 31:(pos=18))" },
503 : : { "window.open( scrollbar", "((window:(pos=1) PHRASE 2 open:(pos=2)) OR Zscrollbar:(pos=3))" },
504 : : { "T68i truc ->", "(t68i:(pos=1) OR Ztruc:(pos=2))" },
505 : : { "T68i ->", "t68i:(pos=1)" },
506 : : { "\"de lijn is bezet\"\"", "(de:(pos=1) PHRASE 4 lijn:(pos=2) PHRASE 4 is:(pos=3) PHRASE 4 bezet:(pos=4))" },
507 : : { "if (eregi(\"", "(Zif:(pos=1) OR eregi:(pos=2))" },
508 : : { "This device is not working properly because Windows cannot load the drivers required for this device. (Code 31)", "(this:(pos=1) OR Zdevic:(pos=2) OR Zis:(pos=3) OR Znot:(pos=4) OR Zwork:(pos=5) OR Zproper:(pos=6) OR Zbecaus:(pos=7) OR windows:(pos=8) OR Zcannot:(pos=9) OR Zload:(pos=10) OR Zthe:(pos=11) OR Zdriver:(pos=12) OR Zrequir:(pos=13) OR Zfor:(pos=14) OR Zthis:(pos=15) OR Zdevic:(pos=16) OR code:(pos=17) OR 31:(pos=18))" },
509 : : { "execCommand(\"Paste\");", "(execcommand:(pos=1) OR paste:(pos=2))" },
510 : : { "\"-1 unread\"", "(1:(pos=1) PHRASE 2 unread:(pos=2))" },
511 : : { "\"www.historical-fire-engines", "(www:(pos=1) PHRASE 4 historical:(pos=2) PHRASE 4 fire:(pos=3) PHRASE 4 engines:(pos=4))" },
512 : : { "\"DVD+RW\" erase", "((dvd:(pos=1) PHRASE 2 rw:(pos=2)) OR Zeras:(pos=3))" },
513 : : { "[showjekamer)", "Zshowjekam:(pos=1)" },
514 : : { "The description for Event ID 1 in Source True Vector Engine ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURC", "(the:(pos=1) OR Zdescript:(pos=2) OR Zfor:(pos=3) OR event:(pos=4) OR id:(pos=5) OR 1:(pos=6) OR Zin:(pos=7) OR source:(pos=8) OR true:(pos=9) OR vector:(pos=10) OR engine:(pos=11) OR Zcannot:(pos=12) OR Zbe:(pos=13) OR Zfound:(pos=14) OR the:(pos=15) OR Zlocal:(pos=16) OR Zcomput:(pos=17) OR Zmay:(pos=18) OR Znot:(pos=19) OR Zhave:(pos=20) OR Zthe:(pos=21) OR Znecessari:(pos=22) OR Zregistri:(pos=23) OR Zinform:(pos=24) OR Zor:(pos=25) OR Zmessag:(pos=26) OR dll:(pos=27) OR Zfile:(pos=28) OR Zto:(pos=29) OR Zdisplay:(pos=30) OR Zmessag:(pos=31) OR Zfrom:(pos=32) OR Za:(pos=33) OR Zremot:(pos=34) OR Zcomput:(pos=35) OR you:(pos=36) OR Zmay:(pos=37) OR Zbe:(pos=38) OR Zabl:(pos=39) OR Zto:(pos=40) OR Zuse:(pos=41) OR Zthe:(pos=42) OR auxsourc:(pos=43))" },
515 : : { "org.apache.jasper.JasperException: This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application", "((org:(pos=1) PHRASE 4 apache:(pos=2) PHRASE 4 jasper:(pos=3) PHRASE 4 jasperexception:(pos=4)) OR this:(pos=5) OR Zabsolut:(pos=6) OR Zuri:(pos=7) OR (http:(pos=8) PHRASE 6 java:(pos=9) PHRASE 6 sun:(pos=10) PHRASE 6 com:(pos=11) PHRASE 6 jstl:(pos=12) PHRASE 6 core:(pos=13)) OR Zcannot:(pos=14) OR Zbe:(pos=15) OR Zresolv:(pos=16) OR Zin:(pos=17) OR Zeither:(pos=18) OR (web:(pos=19) PHRASE 2 xml:(pos=20)) OR Zor:(pos=21) OR Zthe:(pos=22) OR Zjar:(pos=23) OR Zfile:(pos=24) OR Zdeploy:(pos=25) OR Zwith:(pos=26) OR Zthis:(pos=27) OR Zapplic:(pos=28))" },
516 : : { "This absolute uri (http://java.sun.com/jstl/core) cannot be resolved in either web.xml or the jar files deployed with this application", "(this:(pos=1) OR Zabsolut:(pos=2) OR Zuri:(pos=3) OR (http:(pos=4) PHRASE 6 java:(pos=5) PHRASE 6 sun:(pos=6) PHRASE 6 com:(pos=7) PHRASE 6 jstl:(pos=8) PHRASE 6 core:(pos=9)) OR Zcannot:(pos=10) OR Zbe:(pos=11) OR Zresolv:(pos=12) OR Zin:(pos=13) OR Zeither:(pos=14) OR (web:(pos=15) PHRASE 2 xml:(pos=16)) OR Zor:(pos=17) OR Zthe:(pos=18) OR Zjar:(pos=19) OR Zfile:(pos=20) OR Zdeploy:(pos=21) OR Zwith:(pos=22) OR Zthis:(pos=23) OR Zapplic:(pos=24))" },
517 : : { "vervangen # \"/", "Zvervangen:(pos=1)" },
518 : : { "vervangen # /\"", "Zvervangen:(pos=1)" },
519 : : { "while(list($key, $val) = each($HTTP_POST_VARS))", "(while:(pos=1) OR list:(pos=2) OR Zkey:(pos=3) OR Zval:(pos=4) OR each:(pos=5) OR http_post_vars:(pos=6))" },
520 : : { "PowerDVD does not support the current display mode. (DDraw Overlay mode is recommended)", "(powerdvd:(pos=1) OR Zdoe:(pos=2) OR Znot:(pos=3) OR Zsupport:(pos=4) OR Zthe:(pos=5) OR Zcurrent:(pos=6) OR Zdisplay:(pos=7) OR Zmode:(pos=8) OR ddraw:(pos=9) OR overlay:(pos=10) OR Zmode:(pos=11) OR Zis:(pos=12) OR Zrecommend:(pos=13))" },
521 : : { "Warning: Unexpected character in input: '' (ASCII=92) state=1 highlight", "(warning:(pos=1) OR unexpected:(pos=2) OR Zcharact:(pos=3) OR Zin:(pos=4) OR Zinput:(pos=5) OR ascii:(pos=6) OR 92:(pos=7) OR state:(pos=8) OR 1:(pos=9) OR Zhighlight:(pos=10))" },
522 : : { "error: Qt-1.4 (headers and libraries) not found. Please check your installation!", "(Zerror:(pos=1) OR (qt:(pos=2) PHRASE 2 1.4:(pos=3)) OR Zheader:(pos=4) OR Zand:(pos=5) OR Zlibrari:(pos=6) OR Znot:(pos=7) OR Zfound:(pos=8) OR please:(pos=9) OR Zcheck:(pos=10) OR Zyour:(pos=11) OR Zinstal:(pos=12))" },
523 : : { "Error while initializing the sound driver: device /dev/dsp can't be opened (No such device) The sound server will continue, using the null output device.", "(error:(pos=1) OR Zwhile:(pos=2) OR Ziniti:(pos=3) OR Zthe:(pos=4) OR Zsound:(pos=5) OR Zdriver:(pos=6) OR Zdevic:(pos=7) OR (dev:(pos=8) PHRASE 2 dsp:(pos=9)) OR Zcan't:(pos=10) OR Zbe:(pos=11) OR Zopen:(pos=12) OR no:(pos=13) OR Zsuch:(pos=14) OR Zdevic:(pos=15) OR the:(pos=16) OR Zsound:(pos=17) OR Zserver:(pos=18) OR Zwill:(pos=19) OR Zcontinu:(pos=20) OR Zuse:(pos=21) OR Zthe:(pos=22) OR Znull:(pos=23) OR Zoutput:(pos=24) OR Zdevic:(pos=25))" },
524 : : { "mag mijn waarschuwing nu weg ? ;)", "(Zmag:(pos=1) OR Zmijn:(pos=2) OR Zwaarschuw:(pos=3) OR Znu:(pos=4) OR Zweg:(pos=5))" },
525 : : { "Abit NF7-S (nForce 2 Chipset) Rev 2.0", "(abit:(pos=1) OR (nf7:(pos=2) PHRASE 2 s:(pos=3)) OR Znforc:(pos=4) OR 2:(pos=5) OR chipset:(pos=6) OR rev:(pos=7) OR 2.0:(pos=8))" },
526 : : { "Setup Could Not Verify the Integrity of the File\" Error Message Occurs When You Try to Install Windows XP Service Pack 1", "(setup:(pos=1) OR could:(pos=2) OR not:(pos=3) OR verify:(pos=4) OR Zthe:(pos=5) OR integrity:(pos=6) OR Zof:(pos=7) OR Zthe:(pos=8) OR file:(pos=9) OR (error:(pos=10) PHRASE 13 message:(pos=11) PHRASE 13 occurs:(pos=12) PHRASE 13 when:(pos=13) PHRASE 13 you:(pos=14) PHRASE 13 try:(pos=15) PHRASE 13 to:(pos=16) PHRASE 13 install:(pos=17) PHRASE 13 windows:(pos=18) PHRASE 13 xp:(pos=19) PHRASE 13 service:(pos=20) PHRASE 13 pack:(pos=21) PHRASE 13 1:(pos=22)))" },
527 : : { "(browser 19) citrix", "(Zbrowser:(pos=1) OR 19:(pos=2) OR Zcitrix:(pos=3))" },
528 : : { "preg_replace (.*?)", "Zpreg_replac:(pos=1)" },
529 : : { "formule excel #naam\"?\"", "(Zformul:(pos=1) OR Zexcel:(pos=2) OR naam:(pos=3))" },
530 : : { "->", "" },
531 : : { "De instructie op 0x77f436f7 verwijst naar geheugen op 0x007f4778. De lees-of schrijfbewerking (\"written\") op het geheugen is mislukt", "(de:(pos=1) OR Zinstructi:(pos=2) OR Zop:(pos=3) OR 0x77f436f7:(pos=4) OR Zverwijst:(pos=5) OR Znaar:(pos=6) OR Zgeheugen:(pos=7) OR Zop:(pos=8) OR 0x007f4778:(pos=9) OR de:(pos=10) OR (lees:(pos=11) PHRASE 2 of:(pos=12)) OR Zschrijfbewerk:(pos=13) OR written:(pos=14) OR Zop:(pos=15) OR Zhet:(pos=16) OR Zgeheugen:(pos=17) OR Zis:(pos=18) OR Zmislukt:(pos=19))" },
532 : : { "<iframe src=\"www.tweakers.net></iframe>", "(Zifram:(pos=1) OR src:(pos=2) OR (www:(pos=3) PHRASE 4 tweakers:(pos=4) PHRASE 4 net:(pos=5) PHRASE 4 iframe:(pos=6)))" },
533 : : { "\"rpm -e httpd\"", "(rpm:(pos=1) PHRASE 3 e:(pos=2) PHRASE 3 httpd:(pos=3))" },
534 : : { "automatisch op All Flis (*.*)", "(Zautomatisch:(pos=1) OR Zop:(pos=2) OR all:(pos=3) OR flis:(pos=4))" },
535 : : { "(Windows; U; Windows NT 5.1; en-US; rv:1.3b) Gecko/20030210", "(windows:(pos=1) OR u:(pos=2) OR windows:(pos=3) OR nt:(pos=4) OR 5.1:(pos=5) OR (en:(pos=6) PHRASE 2 us:(pos=7)) OR (rv:(pos=8) PHRASE 2 1.3b:(pos=9)) OR (gecko:(pos=10) PHRASE 2 20030210:(pos=11)))" },
536 : : { "en-US; rv:1.3b) Gecko/20030210", "((en:(pos=1) PHRASE 2 us:(pos=2)) OR (rv:(pos=3) PHRASE 2 1.3b:(pos=4)) OR (gecko:(pos=5) PHRASE 2 20030210:(pos=6)))" },
537 : : { "\"en-US; rv:1.3b) Gecko/20030210\"", "(en:(pos=1) PHRASE 6 us:(pos=2) PHRASE 6 rv:(pos=3) PHRASE 6 1.3b:(pos=4) PHRASE 6 gecko:(pos=5) PHRASE 6 20030210:(pos=6))" },
538 : : { "(./) chmod.sh", "(chmod:(pos=1) PHRASE 2 sh:(pos=2))" },
539 : : { "document.write(ssg(\" html", "((document:(pos=1) PHRASE 2 write:(pos=2)) OR ssg:(pos=3) OR html:(pos=4))" },
540 : : { "superstack \"mac+adressen\"", "(Zsuperstack:(pos=1) OR (mac:(pos=2) PHRASE 2 adressen:(pos=3)))" },
541 : : { "IIS getenv(REMOTE_HOST)_", "(iis:(pos=1) OR getenv:(pos=2) OR remote_host:(pos=3) OR _:(pos=4))" },
542 : : { "IIS en getenv(REMOTE_HOST)", "(iis:(pos=1) OR Zen:(pos=2) OR getenv:(pos=3) OR remote_host:(pos=4))" },
543 : : { "php getenv(\"HTTP_REFERER\")", "(Zphp:(pos=1) OR getenv:(pos=2) OR http_referer:(pos=3))" },
544 : : { "nec+-1300", "(nec+:(pos=1) PHRASE 2 1300:(pos=2))" },
545 : : { "smbpasswd script \"-s\"", "(Zsmbpasswd:(pos=1) OR Zscript:(pos=2) OR s:(pos=3))" },
546 : : { "leestekens \" \xc3\xb6 \xc3\xab", "(Zleesteken:(pos=1) OR (\xc3\xb6:(pos=2) PHRASE 2 \xc3\xab:(pos=3)))" },
547 : : { "freesco and (all seeing eye)", "(Zfreesco:(pos=1) OR Zand:(pos=2) OR Zall:(pos=3) OR Zsee:(pos=4) OR Zeye:(pos=5))" },
548 : : { "('all seeing eye') and freesco", "(Zall:(pos=1) OR Zsee:(pos=2) OR Zeye:(pos=3) OR Zand:(pos=4) OR Zfreesco:(pos=5))" },
549 : : { "\"[......\"", "" },
550 : : { "Error = 11004 (500 No Data (Winsock error #11004))", "(error:(pos=1) OR 11004:(pos=2) OR 500:(pos=3) OR no:(pos=4) OR data:(pos=5) OR winsock:(pos=6) OR Zerror:(pos=7) OR 11004:(pos=8))" },
551 : : { "gegevensfout (cyclishe redundantiecontrole)", "(Zgegevensfout:(pos=1) OR Zcyclish:(pos=2) OR Zredundantiecontrol:(pos=3))" },
552 : : { "firmware versie waar NEC\"", "(Zfirmwar:(pos=1) OR Zversi:(pos=2) OR Zwaar:(pos=3) OR nec:(pos=4))" },
553 : : { "nu.nl \"-1\"", "((nu:(pos=1) PHRASE 2 nl:(pos=2)) OR 1:(pos=3))" },
554 : : { "provider+-webspace", "(provider+:(pos=1) PHRASE 2 webspace:(pos=2))" },
555 : : { "verschil \"dvd+rw\" \"dvd-rw\"", "(Zverschil:(pos=1) OR (dvd:(pos=2) PHRASE 2 rw:(pos=3)) OR (dvd:(pos=4) PHRASE 2 rw:(pos=5)))" },
556 : : { "(dhcp client) + hangt", "(Zdhcp:(pos=1) OR Zclient:(pos=2) OR Zhangt:(pos=3))" },
557 : : { "MSI 875P Neo-FIS2R (Intel 875P)", "(msi:(pos=1) OR 875p:(pos=2) OR (neo:(pos=3) PHRASE 2 fis2r:(pos=4)) OR intel:(pos=5) OR 875p:(pos=6))" },
558 : : { "voeding passief gekoeld\"", "(Zvoed:(pos=1) OR Zpassief:(pos=2) OR gekoeld:(pos=3))" },
559 : : { "if (mysql_num_rows($resultaat)==1)", "(Zif:(pos=1) OR mysql_num_rows:(pos=2) OR Zresultaat:(pos=3) OR 1:(pos=4))" },
560 : : { "Server.CreateObject(\"Persits.Upload.1\")", "((server:(pos=1) PHRASE 2 createobject:(pos=2)) OR (persits:(pos=3) PHRASE 3 upload:(pos=4) PHRASE 3 1:(pos=5)))" },
561 : : { "if(cod>9999999)cod=parseInt(cod/64)", "(if:(pos=1) OR cod:(pos=2) OR 9999999:(pos=3) OR cod:(pos=4) OR parseint:(pos=5) OR (cod:(pos=6) PHRASE 2 64:(pos=7)))" },
562 : : { "if (cod>9999999", "(Zif:(pos=1) OR cod:(pos=2) OR 9999999:(pos=3))" },
563 : : { "\"rm -rf /bin/laden\"", "(rm:(pos=1) PHRASE 4 rf:(pos=2) PHRASE 4 bin:(pos=3) PHRASE 4 laden:(pos=4))" },
564 : : { "\">>> 0) & 0xFF\"", "(0:(pos=1) PHRASE 2 0xff:(pos=2))" },
565 : : { "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\"> document.body.scrollHeight", "(doctype:(pos=1) OR html:(pos=2) OR public:(pos=3) OR (w3c:(pos=4) PHRASE 5 dtd:(pos=5) PHRASE 5 html:(pos=6) PHRASE 5 4.01:(pos=7) PHRASE 5 en:(pos=8)) OR (document:(pos=9) PHRASE 3 body:(pos=10) PHRASE 3 scrollheight:(pos=11)))" },
566 : : { "<BR>window.resizeBy(offsetX,offsetY)<P>kweet", "(br:(pos=1) OR (window:(pos=2) PHRASE 2 resizeby:(pos=3)) OR Zoffsetx:(pos=4) OR Zoffseti:(pos=5) OR p:(pos=6) OR Zkweet:(pos=7))" },
567 : : { "linux humor :)", "(Zlinux:(pos=1) OR Zhumor:(pos=2))" },
568 : : { "ClassFactory kan aangevraagde klasse niet leveren (Fout=80040111)", "(classfactory:(pos=1) OR Zkan:(pos=2) OR Zaangevraagd:(pos=3) OR Zklass:(pos=4) OR Zniet:(pos=5) OR Zleveren:(pos=6) OR fout:(pos=7) OR 80040111:(pos=8))" },
569 : : { "remote_smtp defer (-44)", "(Zremote_smtp:(pos=1) OR Zdefer:(pos=2) OR 44:(pos=3))" },
570 : : { "txtlogin.getText().trim().toUpperCase().intern() == inuser[2 * (i - 1) + 2].trim().toUpperCase().intern() && txtpass.getText().trim().toUpperCase().intern() == inuser[2 * (i - 1) + 3].trim().toUpperCase().intern())", "((txtlogin:(pos=1) PHRASE 2 gettext:(pos=2)) OR trim:(pos=3) OR touppercase:(pos=4) OR intern:(pos=5) OR inuser:(pos=6) OR 2:(pos=7) OR Zi:(pos=8) OR 1:(pos=9) OR 2:(pos=10) OR trim:(pos=11) OR touppercase:(pos=12) OR intern:(pos=13) OR (txtpass:(pos=14) PHRASE 2 gettext:(pos=15)) OR trim:(pos=16) OR touppercase:(pos=17) OR intern:(pos=18) OR inuser:(pos=19) OR 2:(pos=20) OR Zi:(pos=21) OR 1:(pos=22) OR 3:(pos=23) OR trim:(pos=24) OR touppercase:(pos=25) OR intern:(pos=26))" },
571 : : { "Koper + amoniak (NH2", "(koper:(pos=1) OR Zamoniak:(pos=2) OR nh2:(pos=3))" },
572 : : { "nec dvd -/+r", "((Znec:(pos=1) OR Zdvd:(pos=2)) AND_NOT Zr:(pos=3))" }, // Not ideal at all - "-" shouldn't fire here...
573 : : { "er is een gereserveerde fout (-1104) opgetreden", "(Zer:(pos=1) OR Zis:(pos=2) OR Zeen:(pos=3) OR Zgereserveerd:(pos=4) OR Zfout:(pos=5) OR 1104:(pos=6) OR Zopgetreden:(pos=7))" },
574 : : { "Cor \\(CCN\\)'\" <cor.kloet@ccn.controlec.nl>", "(cor:(pos=1) OR ccn:(pos=2) OR (cor:(pos=3) PHRASE 5 kloet:(pos=4) PHRASE 5 ccn:(pos=5) PHRASE 5 controlec:(pos=6) PHRASE 5 nl:(pos=7)))" },
575 : : { "Warning: Failed opening for inclusion (include_path='') in Unknown on line 0", "(warning:(pos=1) OR failed:(pos=2) OR Zopen:(pos=3) OR Zfor:(pos=4) OR Zinclus:(pos=5) OR include_path:(pos=6) OR Zin:(pos=7) OR unknown:(pos=8) OR Zon:(pos=9) OR Zline:(pos=10) OR 0:(pos=11))" },
576 : : { "\"~\" + \"c:\\\"", "Zc:(pos=1)" },
577 : : { "mysql count(*)", "(Zmysql:(pos=1) OR count:(pos=2))" },
578 : : { "for %f in (*.*) do", "(Zfor:(pos=1) OR Zf:(pos=2) OR Zin:(pos=3) OR Zdo:(pos=4))" },
579 : : { "raar \"~\" bestand", "(Zraar:(pos=1) OR Zbestand:(pos=2))" },
580 : : { "NEC DVD +-R/RW 1300", "(nec:(pos=1) OR dvd:(pos=2) OR (r:(pos=3) PHRASE 2 rw:(pos=4)) OR 1300:(pos=5))" },
581 : : { "approved (ref: 38446-263)", "(Zapprov:(pos=1) OR Zref:(pos=2) OR (38446:(pos=3) PHRASE 2 263:(pos=4)))" },
582 : : { "GA-7VRXP(2.0)", "((ga:(pos=1) PHRASE 2 7vrxp:(pos=2)) OR 2.0:(pos=3))" },
583 : : { "~ Could not retrieve directory listing for \"/\"", "(could:(pos=1) OR Znot:(pos=2) OR Zretriev:(pos=3) OR Zdirectori:(pos=4) OR Zlist:(pos=5) OR Zfor:(pos=6))" },
584 : : { "asp CreateObject(\"Word.Document\")", "(Zasp:(pos=1) OR createobject:(pos=2) OR (word:(pos=3) PHRASE 2 document:(pos=4)))" },
585 : : { "De lees- of schrijfbewerking (\"written\") op het geheugen is mislukt.", "(de:(pos=1) OR Zlee:(pos=2) OR Zof:(pos=3) OR Zschrijfbewerk:(pos=4) OR written:(pos=5) OR Zop:(pos=6) OR Zhet:(pos=7) OR Zgeheugen:(pos=8) OR Zis:(pos=9) OR Zmislukt:(pos=10))" },
586 : : { "putStr (map (\\x -> chr (round (21/2 * x^3 - 92 * x^2 + 503/2 * x - 105))) [1..4])", "(Zputstr:(pos=1) OR Zmap:(pos=2) OR ((Zx:(pos=3) OR Zround:(pos=5) OR (21:(pos=6) PHRASE 2 2:(pos=7)) OR Zx:(pos=8) OR 3:(pos=9) OR 92:(pos=10) OR Zx:(pos=11) OR 2:(pos=12) OR (503:(pos=13) PHRASE 2 2:(pos=14)) OR Zx:(pos=15) OR 105:(pos=16)) AND_NOT Zchr:(pos=4)) OR (1:(pos=17) PHRASE 2 4:(pos=18)))" },
587 : : { "parent.document.getElementById(\\\"leftmenu\\\").cols", "((parent:(pos=1) PHRASE 3 document:(pos=2) PHRASE 3 getelementbyid:(pos=3)) OR leftmenu:(pos=4) OR Zcol:(pos=5))" },
588 : : { "<% if not isEmpty(Request.QueryString) then", "(Zif:(pos=1) OR Znot:(pos=2) OR isempty:(pos=3) OR (request:(pos=4) PHRASE 2 querystring:(pos=5)) OR Zthen:(pos=6))" },
589 : : { "Active Desktop (Hier issie)", "(active:(pos=1) OR desktop:(pos=2) OR hier:(pos=3) OR Zissi:(pos=4))" },
590 : : { "Asus A7V8X (LAN + Sound)", "(asus:(pos=1) OR a7v8x:(pos=2) OR lan:(pos=3) OR sound:(pos=4))" },
591 : : { "Novell This pentium class machine (or greater) lacks some required CPU feature(s", "(novell:(pos=1) OR this:(pos=2) OR Zpentium:(pos=3) OR Zclass:(pos=4) OR Zmachin:(pos=5) OR Zor:(pos=6) OR Zgreater:(pos=7) OR Zlack:(pos=8) OR Zsome:(pos=9) OR Zrequir:(pos=10) OR cpu:(pos=11) OR feature:(pos=12) OR Zs:(pos=13))" },
592 : : { "sql server install fails error code (-1)", "(Zsql:(pos=1) OR Zserver:(pos=2) OR Zinstal:(pos=3) OR Zfail:(pos=4) OR Zerror:(pos=5) OR Zcode:(pos=6) OR 1:(pos=7))" },
593 : : { "session_register(\"login\");", "(session_register:(pos=1) OR login:(pos=2))" },
594 : : { "\"kylix+ndmb\"", "(kylix:(pos=1) PHRASE 2 ndmb:(pos=2))" },
595 : : { "Cannot find imap library (libc-client.a).", "(cannot:(pos=1) OR Zfind:(pos=2) OR Zimap:(pos=3) OR Zlibrari:(pos=4) OR (libc:(pos=5) PHRASE 3 client:(pos=6) PHRASE 3 a:(pos=7)))" },
596 : : { "If ($_SESSION[\"Login\"] == 1)", "(if:(pos=1) OR _session:(pos=2) OR login:(pos=3) OR 1:(pos=4))" },
597 : : { "You have an error in your SQL syntax near '1')' at line 1", "(you:(pos=1) OR Zhave:(pos=2) OR Zan:(pos=3) OR Zerror:(pos=4) OR Zin:(pos=5) OR Zyour:(pos=6) OR sql:(pos=7) OR Zsyntax:(pos=8) OR Znear:(pos=9) OR 1:(pos=10) OR Zat:(pos=11) OR Zline:(pos=12) OR 1:(pos=13))" },
598 : : { "ASRock K7VT2 (incl. LAN)", "(asrock:(pos=1) OR k7vt2:(pos=2) OR Zincl:(pos=3) OR lan:(pos=4))" },
599 : : { "+windows98 +(geen communicatie) +ie5", "(Zwindows98:(pos=1) AND (Zgeen:(pos=2) OR Zcommunicati:(pos=3)) AND Zie5:(pos=4))" },
600 : : { "\"xterm -fn\"", "(xterm:(pos=1) PHRASE 2 fn:(pos=2))" },
601 : : { "IRQL_NOT_LESS_OR_EQUAL", "irql_not_less_or_equal:(pos=1)" },
602 : : { "access query \"NOT IN\"", "(Zaccess:(pos=1) OR Zqueri:(pos=2) OR (not:(pos=3) PHRASE 2 in:(pos=4)))" },
603 : : { "\"phrase one \"phrase two\"", "((phrase:(pos=1) PHRASE 2 one:(pos=2)) OR Zphrase:(pos=3) OR two:(pos=4))" }, // FIXME: 2 phrases better?
604 : : { "NEAR 207 46 249 27", "(near:(pos=1) OR 207:(pos=2) OR 46:(pos=3) OR 249:(pos=4) OR 27:(pos=5))" },
605 : : { "- NEAR 12V voeding", "(near:(pos=1) OR 12v:(pos=2) OR Zvoed:(pos=3))" },
606 : : { "waarom \"~\" in directorynaam", "(Zwaarom:(pos=1) OR Zin:(pos=2) OR Zdirectorynaam:(pos=3))" },
607 : : { "cd'r NEAR toebehoren", "(cd'r:(pos=1) NEAR 11 toebehoren:(pos=2))" },
608 : : { "site:1 site:2", "0 * (H1 OR H2)" },
609 : : { "site:1 site2:2", "0 * (H1 AND J2)" },
610 : : { "site:1 site:2 site2:2", "0 * ((H1 OR H2) AND J2)" },
611 : : { "site:1 OR site:2", "(0 * H1 OR 0 * H2)" },
612 : : { "site:1 AND site:2", "(0 * H1 AND 0 * H2)" },
613 : : { "foo AND site:2", "(Zfoo:(pos=1) AND 0 * H2)" },
614 : : // Non-exclusive boolean prefixes feature tests (ticket#402):
615 : : { "category:1 category:2", "0 * (XCAT1 AND XCAT2)" },
616 : : { "category:1 site2:2", "0 * (J2 AND XCAT1)" },
617 : : { "category:1 category:2 site2:2", "0 * (J2 AND XCAT1 AND XCAT2)" },
618 : : { "category:1 OR category:2", "(0 * XCAT1 OR 0 * XCAT2)" },
619 : : { "category:1 AND category:2", "(0 * XCAT1 AND 0 * XCAT2)" },
620 : : { "foo AND category:2", "(Zfoo:(pos=1) AND 0 * XCAT2)" },
621 : : #if 0
622 : : { "A site:1 site:2", "(a FILTER (H1 OR H2))" },
623 : : { "A (site:1 OR site:2)", "(a FILTER (H1 OR H2))" },
624 : : { "A (site:1 OR site:2)", "(a FILTER (H1 OR H2))" },
625 : : { "A site:1 site2:2", "(a FILTER (H1 AND J2))" },
626 : : { "A site:1 site:2 site2:2", "(a FILTER ((H1 OR H2) AND J2))" },
627 : : { "A site:1 OR site:2", "(a FILTER (H1 OR H2))" },
628 : : { "A site:1 AND site:2", "(a FILTER (H1 AND H2))" },
629 : : #endif
630 : : { "site:xapian.org OR site:www.xapian.org", "(0 * Hxapian.org OR 0 * Hwww.xapian.org)" },
631 : : { "site:xapian.org site:www.xapian.org", "0 * (Hxapian.org OR Hwww.xapian.org)" },
632 : : { "site:xapian.org AND site:www.xapian.org", "(0 * Hxapian.org AND 0 * Hwww.xapian.org)" },
633 : : { "Xapian site:xapian.org site:www.xapian.org", "(xapian:(pos=1) FILTER (Hxapian.org OR Hwww.xapian.org))" },
634 : : { "author:richard author:olly writer:charlie", "(ZArichard:(pos=1) OR ZAolli:(pos=2) OR ZAcharli:(pos=3))"},
635 : : { "author:richard NEAR title:book", "(Arichard:(pos=1) NEAR 11 XTbook:(pos=2))"},
636 : : { "authortitle:richard NEAR title:book", "((Arichard:(pos=1) NEAR 11 XTbook:(pos=2)) OR (XTrichard:(pos=1) NEAR 11 XTbook:(pos=2)))"},
637 : : { "multisite:xapian.org", "0 * (Hxapian.org OR Jxapian.org)"},
638 : : { "authortitle:richard", "(ZArichard:(pos=1) OR ZXTrichard:(pos=1))"},
639 : : { "multisite:xapian.org site:www.xapian.org author:richard authortitle:richard", "((ZArichard:(pos=1) OR ZArichard:(pos=2) OR ZXTrichard:(pos=2)) FILTER (Hwww.xapian.org AND (Hxapian.org OR Jxapian.org)))"},
640 : : { "authortitle:richard-boulton", "((Arichard:(pos=1) PHRASE 2 Aboulton:(pos=2)) OR (XTrichard:(pos=1) PHRASE 2 XTboulton:(pos=2)))"},
641 : : { "authortitle:\"richard boulton\"", "((Arichard:(pos=1) PHRASE 2 Aboulton:(pos=2)) OR (XTrichard:(pos=1) PHRASE 2 XTboulton:(pos=2)))"},
642 : : // Some CJK tests.
643 : : { "久有归天愿", "(久:(pos=1) AND 久有:(pos=1) AND 有:(pos=1) AND 有归:(pos=1) AND 归:(pos=1) AND 归天:(pos=1) AND 天:(pos=1) AND 天愿:(pos=1) AND 愿:(pos=1))" },
644 : : { "title:久有 归 天愿", "((XT久:(pos=1) AND XT久有:(pos=1) AND XT有:(pos=1)) OR 归:(pos=2) OR (天:(pos=3) AND 天愿:(pos=3) AND 愿:(pos=3)))" },
645 : : { "h众ello万众", "(Zh:(pos=1) OR 众:(pos=2) OR Zello:(pos=3) OR (万:(pos=4) AND 万众:(pos=4) AND 众:(pos=4)))" },
646 : : { "世(の中)TEST_tm", "(世:(pos=1) OR (の:(pos=2) AND の中:(pos=2) AND 中:(pos=2)) OR test_tm:(pos=3))" },
647 : : { "다녀 AND 와야", "(다:(pos=1) AND 다녀:(pos=1) AND 녀:(pos=1) AND 와:(pos=2) AND 와야:(pos=2) AND 야:(pos=2))" },
648 : : { "authortitle:학술 OR 연구를", "((A학:(pos=1) AND XT학:(pos=1) AND A학술:(pos=1) AND XT학술:(pos=1) AND A술:(pos=1) AND XT술:(pos=1)) OR (연:(pos=2) AND 연구:(pos=2) AND 구:(pos=2) AND 구를:(pos=2) AND 를:(pos=2)))" },
649 : : // FIXME: This should really generate a phrase search.
650 : : { "\"久有归\"", "(久:(pos=1) AND 久有:(pos=1) AND 有:(pos=1) AND 有归:(pos=1) AND 归:(pos=1))" },
651 : : // FIXME: this should work: { "久 NEAR 有", "(久:(pos=1) NEAR 11 有:(pos=2))" },
652 : : { NULL, NULL }
653 : : };
654 : :
655 : 1 : static bool test_queryparser1()
656 : : {
657 : 1 : Xapian::QueryParser queryparser;
658 : 1 : queryparser.set_stemmer(Xapian::Stem("english"));
659 : 1 : queryparser.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
660 : 1 : queryparser.add_prefix("author", "A");
661 : 1 : queryparser.add_prefix("writer", "A");
662 : 1 : queryparser.add_prefix("title", "XT");
663 : 1 : queryparser.add_prefix("subject", "XT");
664 : 1 : queryparser.add_prefix("authortitle", "A");
665 : 1 : queryparser.add_prefix("authortitle", "XT");
666 : 1 : queryparser.add_boolean_prefix("site", "H");
667 : 1 : queryparser.add_boolean_prefix("site2", "J");
668 : 1 : queryparser.add_boolean_prefix("multisite", "H");
669 : 1 : queryparser.add_boolean_prefix("multisite", "J");
670 : 1 : queryparser.add_boolean_prefix("category", "XCAT", false);
671 [ + - ][ - + ]: 6 : TEST_EXCEPTION(Xapian::InvalidOperationError,
[ # # ][ - + ]
672 : : queryparser.add_boolean_prefix("authortitle", "B");
673 : : );
674 [ + - ][ - + ]: 6 : TEST_EXCEPTION(Xapian::InvalidOperationError,
[ # # ][ - + ]
675 : : queryparser.add_prefix("multisite", "B");
676 : : );
677 [ + + ]: 568 : for (const test *p = test_or_queries; p->query; ++p) {
678 : 567 : string expect, parsed;
679 [ + - ]: 567 : if (p->expect)
680 : 567 : expect = p->expect;
681 : : else
682 : 0 : expect = "parse error";
683 : : try {
684 : 597 : Xapian::Query qobj = queryparser.parse_query(p->query);
685 : 557 : parsed = qobj.get_description();
686 : 557 : expect = string("Xapian::Query(") + expect + ')';
687 : 20 : } catch (const Xapian::QueryParserError &e) {
688 : 10 : parsed = e.get_msg();
689 : 0 : } catch (const Xapian::Error &e) {
690 : 0 : parsed = e.get_description();
691 : 0 : } catch (...) {
692 : 0 : parsed = "Unknown exception!";
693 : : }
694 : 567 : tout << "Query: " << p->query << '\n';
695 [ - + # # ]: 567 : TEST_STRINGS_EQUAL(parsed, expect);
696 : : }
697 : 1 : return true;
698 : : }
699 : :
700 : : static const test test_and_queries[] = {
701 : : { "internet explorer title:(http www)", "(Zinternet:(pos=1) AND Zexplor:(pos=2) AND ZXThttp:(pos=3) AND ZXTwww:(pos=4))" },
702 : : // Regression test for bug in 0.9.2 and earlier - this would give
703 : : // (two:(pos=2) AND_MAYBE (one:(pos=1) AND three:(pos=3)))
704 : : { "one +two three", "(Zone:(pos=1) AND Ztwo:(pos=2) AND Zthree:(pos=3))" },
705 : : { "hello -title:\"hello world\"", "(Zhello:(pos=1) AND_NOT (XThello:(pos=2) PHRASE 2 XTworld:(pos=3)))" },
706 : : // Regression test for bug fixed in 1.0.4 - the '-' would be ignored there
707 : : // because the whitespace after the '"' wasn't noticed.
708 : : { "\"hello world\" -C++", "((hello:(pos=1) PHRASE 2 world:(pos=2)) AND_NOT c++:(pos=3))" },
709 : : // Regression tests for bug fixed in 1.0.4 - queries with only boolean
710 : : // filter and HATE terms weren't accepted.
711 : : { "-cup site:world", "(0 * Hworld AND_NOT Zcup:(pos=1))" },
712 : : { "site:world -cup", "(0 * Hworld AND_NOT Zcup:(pos=1))" },
713 : : // Regression test for bug fixed in 1.0.4 - the KET token for ')' was lost.
714 : : { "(site:world) -cup", "(0 * Hworld AND_NOT Zcup:(pos=1))" },
715 : : // Regression test for bug fixed in 1.0.4 - a boolean filter term between
716 : : // probabilistic terms caused a parse error (probably broken during the
717 : : // addition of synonym support in 1.0.2).
718 : : { "foo site:xapian.org bar", "((Zfoo:(pos=1) AND Zbar:(pos=2)) FILTER Hxapian.org)" },
719 : : // Add coverage for other cases similar to the above.
720 : : { "a b site:xapian.org", "((Za:(pos=1) AND Zb:(pos=2)) FILTER Hxapian.org)" },
721 : : { "site:xapian.org a b", "((Za:(pos=1) AND Zb:(pos=2)) FILTER Hxapian.org)" },
722 : : // Some CJK tests.
723 : : { "author:험가 OR subject:万众 hello world!", "((A험:(pos=1) AND A험가:(pos=1) AND A가:(pos=1)) OR (XT万:(pos=2) AND XT万众:(pos=2) AND XT众:(pos=2) AND Zhello:(pos=3) AND Zworld:(pos=4)))" },
724 : : { "洛伊one儿差点two脸three", "(洛:(pos=1) AND 洛伊:(pos=1) AND 伊:(pos=1) AND Zone:(pos=2) AND 儿:(pos=3) AND 儿差:(pos=3) AND 差:(pos=3) AND 差点:(pos=3) AND 点:(pos=3) AND Ztwo:(pos=4) AND 脸:(pos=5) AND Zthree:(pos=6))" },
725 : : { NULL, NULL }
726 : : };
727 : :
728 : : // With default_op = OP_AND.
729 : 1 : static bool test_qp_default_op1()
730 : : {
731 : 1 : Xapian::QueryParser queryparser;
732 : 1 : queryparser.set_stemmer(Xapian::Stem("english"));
733 : 1 : queryparser.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
734 : 1 : queryparser.add_prefix("author", "A");
735 : 1 : queryparser.add_prefix("title", "XT");
736 : 1 : queryparser.add_prefix("subject", "XT");
737 : 1 : queryparser.add_boolean_prefix("site", "H");
738 : 1 : queryparser.set_default_op(Xapian::Query::OP_AND);
739 [ + + ]: 13 : for (const test *p = test_and_queries; p->query; ++p) {
740 : 12 : string expect, parsed;
741 [ + - ]: 12 : if (p->expect)
742 : 12 : expect = p->expect;
743 : : else
744 : 0 : expect = "parse error";
745 : : try {
746 : 12 : Xapian::Query qobj = queryparser.parse_query(p->query);
747 : 12 : parsed = qobj.get_description();
748 : 12 : expect = string("Xapian::Query(") + expect + ')';
749 : 0 : } catch (const Xapian::QueryParserError &e) {
750 : 0 : parsed = e.get_msg();
751 : 0 : } catch (const Xapian::Error &e) {
752 : 0 : parsed = e.get_description();
753 : 0 : } catch (...) {
754 : 0 : parsed = "Unknown exception!";
755 : : }
756 : 12 : tout << "Query: " << p->query << '\n';
757 [ - + # # ]: 12 : TEST_STRINGS_EQUAL(parsed, expect);
758 : : }
759 : 1 : return true;
760 : : }
761 : :
762 : : // Feature test for specify the default prefix (new in Xapian 1.0.0).
763 : 1 : static bool test_qp_default_prefix1()
764 : : {
765 : 1 : Xapian::QueryParser qp;
766 : 1 : qp.set_stemmer(Xapian::Stem("english"));
767 : 1 : qp.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
768 : 1 : qp.add_prefix("title", "XT");
769 : :
770 : 1 : Xapian::Query qobj;
771 : 1 : qobj = qp.parse_query("hello world", 0, "A");
772 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((ZAhello:(pos=1) OR ZAworld:(pos=2)))");
773 : 1 : qobj = qp.parse_query("me title:stuff", 0, "A");
774 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((ZAme:(pos=1) OR ZXTstuff:(pos=2)))");
775 : 1 : qobj = qp.parse_query("title:(stuff) me", Xapian::QueryParser::FLAG_BOOLEAN, "A");
776 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((ZXTstuff:(pos=1) OR ZAme:(pos=2)))");
777 : 1 : qobj = qp.parse_query("英国 title:文森hello", 0, "A");
778 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((A英:(pos=1) AND A英国:(pos=1) AND A国:(pos=1)) OR (XT文:(pos=2) AND XT文森:(pos=2) AND XT森:(pos=2)) OR ZAhello:(pos=3)))");
779 : 1 : return true;
780 : : }
781 : :
782 : : // Feature test for setting the default prefix with add_prefix()
783 : : // (new in Xapian 1.0.3).
784 : 1 : static bool test_qp_default_prefix2()
785 : : {
786 : 1 : Xapian::QueryParser qp;
787 : 1 : qp.set_stemmer(Xapian::Stem("english"));
788 : 1 : qp.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
789 : :
790 : : // test that default prefixes can only be set with add_prefix().
791 [ + - ][ - + ]: 6 : TEST_EXCEPTION(Xapian::UnimplementedError,
[ # # ][ - + ]
792 : : qp.add_boolean_prefix("", "B");
793 : : );
794 : :
795 : 1 : qp.add_prefix("title", "XT");
796 : 1 : qp.add_prefix("", "A");
797 : :
798 : 1 : Xapian::Query qobj;
799 : 1 : qobj = qp.parse_query("hello world", 0);
800 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((ZAhello:(pos=1) OR ZAworld:(pos=2)))");
801 : 1 : qobj = qp.parse_query("me title:stuff", 0);
802 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((ZAme:(pos=1) OR ZXTstuff:(pos=2)))");
803 : 1 : qobj = qp.parse_query("title:(stuff) me", Xapian::QueryParser::FLAG_BOOLEAN);
804 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((ZXTstuff:(pos=1) OR ZAme:(pos=2)))");
805 : :
806 : 1 : qobj = qp.parse_query("hello world", 0, "B");
807 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((ZBhello:(pos=1) OR ZBworld:(pos=2)))");
808 : 1 : qobj = qp.parse_query("me title:stuff", 0, "B");
809 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((ZBme:(pos=1) OR ZXTstuff:(pos=2)))");
810 : 1 : qobj = qp.parse_query("title:(stuff) me", Xapian::QueryParser::FLAG_BOOLEAN, "B");
811 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((ZXTstuff:(pos=1) OR ZBme:(pos=2)))");
812 : :
813 : 1 : qp.add_prefix("", "B");
814 : 1 : qobj = qp.parse_query("me-us title:(stuff) me", Xapian::QueryParser::FLAG_BOOLEAN);
815 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((Ame:(pos=1) PHRASE 2 Aus:(pos=2)) OR (Bme:(pos=1) PHRASE 2 Bus:(pos=2)) OR ZXTstuff:(pos=3) OR ZAme:(pos=4) OR ZBme:(pos=4)))");
816 : 1 : qobj = qp.parse_query("me-us title:(stuff) me", Xapian::QueryParser::FLAG_BOOLEAN, "C");
817 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((Cme:(pos=1) PHRASE 2 Cus:(pos=2)) OR ZXTstuff:(pos=3) OR ZCme:(pos=4)))");
818 : :
819 : 1 : qobj = qp.parse_query("me-us title:\"not-me\"", Xapian::QueryParser::FLAG_PHRASE);
820 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((Ame:(pos=1) PHRASE 2 Aus:(pos=2)) OR (Bme:(pos=1) PHRASE 2 Bus:(pos=2)) OR (XTnot:(pos=3) PHRASE 2 XTme:(pos=4))))");
821 : 1 : return true;
822 : : }
823 : :
824 : : // Test query with odd characters in.
825 : 1 : static bool test_qp_odd_chars1()
826 : : {
827 : 1 : Xapian::QueryParser qp;
828 : 1 : string query("\x01weird\x00stuff\x7f", 13);
829 : 1 : Xapian::Query qobj = qp.parse_query(query);
830 : 1 : tout << "Query: " << query << '\n';
831 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((weird:(pos=1) OR stuff:(pos=2)))"); // FIXME: should these be stemmed?
832 : 1 : return true;
833 : : }
834 : :
835 : : // Test right truncation.
836 : 1 : static bool test_qp_flag_wildcard1()
837 : : {
838 : : #ifndef XAPIAN_HAS_INMEMORY_BACKEND
839 : : SKIP_TEST("Testcase requires the InMemory backend which is disabled");
840 : : #else
841 : 1 : Xapian::WritableDatabase db(Xapian::InMemory::open());
842 : 1 : Xapian::Document doc;
843 : 1 : doc.add_term("abc");
844 : 1 : doc.add_term("main");
845 : 1 : doc.add_term("muscat");
846 : 1 : doc.add_term("muscle");
847 : 1 : doc.add_term("musclebound");
848 : 1 : doc.add_term("muscular");
849 : 1 : doc.add_term("mutton");
850 : 1 : db.add_document(doc);
851 : 1 : Xapian::QueryParser qp;
852 : 1 : qp.set_database(db);
853 : 1 : Xapian::Query qobj = qp.parse_query("ab*", Xapian::QueryParser::FLAG_WILDCARD);
854 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(abc:(pos=1))");
855 : 1 : qobj = qp.parse_query("muscle*", Xapian::QueryParser::FLAG_WILDCARD);
856 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((muscle:(pos=1) SYNONYM musclebound:(pos=1)))");
857 : 1 : qobj = qp.parse_query("meat*", Xapian::QueryParser::FLAG_WILDCARD);
858 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
859 : 1 : qobj = qp.parse_query("musc*", Xapian::QueryParser::FLAG_WILDCARD);
860 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((muscat:(pos=1) SYNONYM muscle:(pos=1) SYNONYM musclebound:(pos=1) SYNONYM muscular:(pos=1)))");
861 : 1 : qobj = qp.parse_query("mutt*", Xapian::QueryParser::FLAG_WILDCARD);
862 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(mutton:(pos=1))");
863 : : // Regression test (we weren't lowercasing terms before checking if they
864 : : // were in the database or not):
865 : 1 : qobj = qp.parse_query("mUTTON++");
866 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(mutton:(pos=1))");
867 : : // Regression test: check that wildcards work with +terms.
868 : : unsigned flags = Xapian::QueryParser::FLAG_WILDCARD |
869 : 1 : Xapian::QueryParser::FLAG_LOVEHATE;
870 : 1 : qobj = qp.parse_query("+mai* main", flags);
871 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((main:(pos=1) AND_MAYBE main:(pos=2)))");
872 : : // Regression test (if we had a +term which was a wildcard and wasn't
873 : : // present, the query could still match documents).
874 : 1 : qobj = qp.parse_query("foo* main", flags);
875 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(main:(pos=2))");
876 : 1 : qobj = qp.parse_query("main foo*", flags);
877 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(main:(pos=1))");
878 : 1 : qobj = qp.parse_query("+foo* main", flags);
879 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
880 : 1 : qobj = qp.parse_query("main +foo*", flags);
881 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
882 : 1 : qobj = qp.parse_query("foo* +main", flags);
883 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(main:(pos=2))");
884 : 1 : qobj = qp.parse_query("+main foo*", flags);
885 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(main:(pos=1))");
886 : 1 : qobj = qp.parse_query("+foo* +main", flags);
887 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
888 : 1 : qobj = qp.parse_query("+main +foo*", flags);
889 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
890 : 1 : qobj = qp.parse_query("foo* mai", flags);
891 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(mai:(pos=2))");
892 : 1 : qobj = qp.parse_query("mai foo*", flags);
893 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(mai:(pos=1))");
894 : 1 : qobj = qp.parse_query("+foo* mai", flags);
895 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
896 : 1 : qobj = qp.parse_query("mai +foo*", flags);
897 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
898 : 1 : qobj = qp.parse_query("foo* +mai", flags);
899 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(mai:(pos=2))");
900 : 1 : qobj = qp.parse_query("+mai foo*", flags);
901 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(mai:(pos=1))");
902 : 1 : qobj = qp.parse_query("+foo* +mai", flags);
903 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
904 : 1 : qobj = qp.parse_query("+mai +foo*", flags);
905 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
906 : 1 : qobj = qp.parse_query("-foo* main", flags);
907 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(main:(pos=2))");
908 : 1 : qobj = qp.parse_query("main -foo*", flags);
909 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(main:(pos=1))");
910 : 1 : qobj = qp.parse_query("main -foo* -bar", flags);
911 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((main:(pos=1) AND_NOT bar:(pos=3)))");
912 : 1 : qobj = qp.parse_query("main -bar -foo*", flags);
913 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((main:(pos=1) AND_NOT bar:(pos=2)))");
914 : : // Check with OP_AND too.
915 : 1 : qp.set_default_op(Xapian::Query::OP_AND);
916 : 1 : qobj = qp.parse_query("foo* main", flags);
917 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
918 : 1 : qobj = qp.parse_query("main foo*", flags);
919 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
920 : 1 : qp.set_default_op(Xapian::Query::OP_AND);
921 : 1 : qobj = qp.parse_query("+foo* main", flags);
922 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
923 : 1 : qobj = qp.parse_query("main +foo*", flags);
924 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
925 : 1 : qobj = qp.parse_query("-foo* main", flags);
926 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(main:(pos=2))");
927 : 1 : qobj = qp.parse_query("main -foo*", flags);
928 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(main:(pos=1))");
929 : : // Check empty wildcard followed by negation.
930 : 1 : qobj = qp.parse_query("foo* -main", Xapian::QueryParser::FLAG_WILDCARD);
931 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query()");
932 : : // Regression test for bug#484 fixed in 1.2.1 and 1.0.21.
933 : 1 : qobj = qp.parse_query("abc muscl* main", flags);
934 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((abc:(pos=1) AND (muscle:(pos=2) SYNONYM musclebound:(pos=2)) AND main:(pos=3)))");
935 : 1 : return true;
936 : : #endif
937 : : }
938 : :
939 : : // Test right truncation with prefixes.
940 : 1 : static bool test_qp_flag_wildcard2()
941 : : {
942 : : #ifndef XAPIAN_HAS_INMEMORY_BACKEND
943 : : SKIP_TEST("Testcase requires the InMemory backend which is disabled");
944 : : #else
945 : 1 : Xapian::WritableDatabase db(Xapian::InMemory::open());
946 : 1 : Xapian::Document doc;
947 : 1 : doc.add_term("Aheinlein");
948 : 1 : doc.add_term("Ahuxley");
949 : 1 : doc.add_term("hello");
950 : 1 : db.add_document(doc);
951 : 1 : Xapian::QueryParser qp;
952 : 1 : qp.set_database(db);
953 : 1 : qp.add_prefix("author", "A");
954 : 1 : Xapian::Query qobj;
955 : 1 : qobj = qp.parse_query("author:h*", Xapian::QueryParser::FLAG_WILDCARD);
956 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((Aheinlein:(pos=1) SYNONYM Ahuxley:(pos=1)))");
957 : 1 : qobj = qp.parse_query("author:h* test", Xapian::QueryParser::FLAG_WILDCARD);
958 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((Aheinlein:(pos=1) SYNONYM Ahuxley:(pos=1)) OR test:(pos=2)))");
959 : 1 : return true;
960 : : #endif
961 : : }
962 : :
963 : : // Test partial queries.
964 : 1 : static bool test_qp_flag_partial1()
965 : : {
966 : : #ifndef XAPIAN_HAS_INMEMORY_BACKEND
967 : : SKIP_TEST("Testcase requires the InMemory backend which is disabled");
968 : : #else
969 : 1 : Xapian::WritableDatabase db(Xapian::InMemory::open());
970 : 1 : Xapian::Document doc;
971 : 1 : Xapian::Stem stemmer("english");
972 : 1 : doc.add_term("abc");
973 : 1 : doc.add_term("main");
974 : 1 : doc.add_term("muscat");
975 : 1 : doc.add_term("muscle");
976 : 1 : doc.add_term("musclebound");
977 : 1 : doc.add_term("muscular");
978 : 1 : doc.add_term("mutton");
979 : 1 : doc.add_term("Z" + stemmer("outside"));
980 : 1 : doc.add_term("Z" + stemmer("out"));
981 : 1 : doc.add_term("outside");
982 : 1 : doc.add_term("out");
983 : 1 : doc.add_term("XTcove");
984 : 1 : doc.add_term("XTcows");
985 : 1 : doc.add_term("XTcowl");
986 : 1 : doc.add_term("XTcox");
987 : 1 : doc.add_term("ZXTcow");
988 : 1 : doc.add_term("XONEpartial");
989 : 1 : doc.add_term("XONEpartial2");
990 : 1 : doc.add_term("XTWOpartial3");
991 : 1 : doc.add_term("XTWOpartial4");
992 : 1 : db.add_document(doc);
993 : 1 : Xapian::QueryParser qp;
994 : 1 : qp.set_database(db);
995 : 1 : qp.set_stemmer(stemmer);
996 : 1 : qp.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
997 : 1 : qp.add_prefix("title", "XT");
998 : 1 : qp.add_prefix("double", "XONE");
999 : 1 : qp.add_prefix("double", "XTWO");
1000 : :
1001 : : // Check behaviour with unstemmed terms
1002 : 1 : Xapian::Query qobj = qp.parse_query("a", Xapian::QueryParser::FLAG_PARTIAL);
1003 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((abc:(pos=1) OR Za:(pos=1)))");
1004 : 1 : qobj = qp.parse_query("ab", Xapian::QueryParser::FLAG_PARTIAL);
1005 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((abc:(pos=1) OR Zab:(pos=1)))");
1006 : 1 : qobj = qp.parse_query("muscle", Xapian::QueryParser::FLAG_PARTIAL);
1007 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((muscle:(pos=1) SYNONYM musclebound:(pos=1)) OR Zmuscl:(pos=1)))");
1008 : 1 : qobj = qp.parse_query("meat", Xapian::QueryParser::FLAG_PARTIAL);
1009 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(Zmeat:(pos=1))");
1010 : 1 : qobj = qp.parse_query("musc", Xapian::QueryParser::FLAG_PARTIAL);
1011 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((muscat:(pos=1) SYNONYM muscle:(pos=1) SYNONYM musclebound:(pos=1) SYNONYM muscular:(pos=1)) OR Zmusc:(pos=1)))");
1012 : 1 : qobj = qp.parse_query("mutt", Xapian::QueryParser::FLAG_PARTIAL);
1013 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((mutton:(pos=1) OR Zmutt:(pos=1)))");
1014 : 1 : qobj = qp.parse_query("abc musc", Xapian::QueryParser::FLAG_PARTIAL);
1015 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((Zabc:(pos=1) OR (muscat:(pos=2) SYNONYM muscle:(pos=2) SYNONYM musclebound:(pos=2) SYNONYM muscular:(pos=2)) OR Zmusc:(pos=2)))");
1016 : 1 : qobj = qp.parse_query("a* mutt", Xapian::QueryParser::FLAG_PARTIAL | Xapian::QueryParser::FLAG_WILDCARD);
1017 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((abc:(pos=1) OR mutton:(pos=2) OR Zmutt:(pos=2)))");
1018 : :
1019 : : // Check behaviour with stemmed terms, and stem strategy STEM_SOME.
1020 : 1 : qobj = qp.parse_query("o", Xapian::QueryParser::FLAG_PARTIAL);
1021 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((out:(pos=1) SYNONYM outside:(pos=1)) OR Zo:(pos=1)))");
1022 : 1 : qobj = qp.parse_query("ou", Xapian::QueryParser::FLAG_PARTIAL);
1023 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((out:(pos=1) SYNONYM outside:(pos=1)) OR Zou:(pos=1)))");
1024 : 1 : qobj = qp.parse_query("out", Xapian::QueryParser::FLAG_PARTIAL);
1025 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((out:(pos=1) SYNONYM outside:(pos=1)) OR Zout:(pos=1)))");
1026 : 1 : qobj = qp.parse_query("outs", Xapian::QueryParser::FLAG_PARTIAL);
1027 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((outside:(pos=1) OR Zout:(pos=1)))");
1028 : 1 : qobj = qp.parse_query("outsi", Xapian::QueryParser::FLAG_PARTIAL);
1029 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((outside:(pos=1) OR Zoutsi:(pos=1)))");
1030 : 1 : qobj = qp.parse_query("outsid", Xapian::QueryParser::FLAG_PARTIAL);
1031 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((outside:(pos=1) OR Zoutsid:(pos=1)))");
1032 : 1 : qobj = qp.parse_query("outside", Xapian::QueryParser::FLAG_PARTIAL);
1033 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((outside:(pos=1) OR Zoutsid:(pos=1)))");
1034 : :
1035 : : // Check behaviour with capitalised terms, and stem strategy STEM_SOME.
1036 : 1 : qobj = qp.parse_query("Out", Xapian::QueryParser::FLAG_PARTIAL);
1037 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((out:(pos=1) SYNONYM outside:(pos=1)) OR out:(pos=1)))");
1038 : 1 : qobj = qp.parse_query("Outs", Xapian::QueryParser::FLAG_PARTIAL);
1039 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((outside:(pos=1) OR outs:(pos=1)))");
1040 : 1 : qobj = qp.parse_query("Outside", Xapian::QueryParser::FLAG_PARTIAL);
1041 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(outside:(pos=1,wqf=2))");
1042 : :
1043 : : // And now with stemming strategy STEM_ALL.
1044 : 1 : qp.set_stemming_strategy(Xapian::QueryParser::STEM_ALL);
1045 : 1 : qobj = qp.parse_query("Out", Xapian::QueryParser::FLAG_PARTIAL);
1046 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((out:(pos=1) SYNONYM outside:(pos=1)) OR out:(pos=1)))");
1047 : 1 : qobj = qp.parse_query("Outs", Xapian::QueryParser::FLAG_PARTIAL);
1048 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((outside:(pos=1) OR out:(pos=1)))");
1049 : 1 : qobj = qp.parse_query("Outside", Xapian::QueryParser::FLAG_PARTIAL);
1050 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((outside:(pos=1) OR outsid:(pos=1)))");
1051 : :
1052 : : // Check handling of a case with a prefix.
1053 : 1 : qp.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
1054 : 1 : qobj = qp.parse_query("title:cow", Xapian::QueryParser::FLAG_PARTIAL);
1055 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((XTcowl:(pos=1) SYNONYM XTcows:(pos=1)) OR ZXTcow:(pos=1)))");
1056 : 1 : qobj = qp.parse_query("title:cows", Xapian::QueryParser::FLAG_PARTIAL);
1057 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((XTcows:(pos=1) OR ZXTcow:(pos=1)))");
1058 : 1 : qobj = qp.parse_query("title:Cow", Xapian::QueryParser::FLAG_PARTIAL);
1059 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((XTcowl:(pos=1) SYNONYM XTcows:(pos=1)) OR XTcow:(pos=1)))");
1060 : 1 : qobj = qp.parse_query("title:Cows", Xapian::QueryParser::FLAG_PARTIAL);
1061 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(XTcows:(pos=1,wqf=2))");
1062 : :
1063 : : // Regression test - the initial version of the multi-prefix code would
1064 : : // inflate the wqf of the "parsed as normal" version of a partial term
1065 : : // by multiplying it by the number of prefixes mapped to.
1066 : 1 : qobj = qp.parse_query("double:vision", Xapian::QueryParser::FLAG_PARTIAL);
1067 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((ZXONEvision:(pos=1) SYNONYM ZXTWOvision:(pos=1)))");
1068 : :
1069 : : // Test handling of FLAG_PARTIAL when there's more than one prefix.
1070 : 1 : qobj = qp.parse_query("double:part", Xapian::QueryParser::FLAG_PARTIAL);
1071 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((XONEpartial:(pos=1) SYNONYM XONEpartial2:(pos=1) SYNONYM XTWOpartial3:(pos=1) SYNONYM XTWOpartial4:(pos=1)) OR (ZXONEpart:(pos=1) SYNONYM ZXTWOpart:(pos=1))))");
1072 : :
1073 : : // Test handling of FLAG_PARTIAL when there's more than one prefix, without
1074 : : // stemming.
1075 : 1 : qp.set_stemming_strategy(Xapian::QueryParser::STEM_NONE);
1076 : 1 : qobj = qp.parse_query("double:part", Xapian::QueryParser::FLAG_PARTIAL);
1077 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((XONEpartial:(pos=1) SYNONYM XONEpartial2:(pos=1) SYNONYM XTWOpartial3:(pos=1) SYNONYM XTWOpartial4:(pos=1)) OR (XONEpart:(pos=1) SYNONYM XTWOpart:(pos=1))))");
1078 : 1 : qobj = qp.parse_query("double:partial", Xapian::QueryParser::FLAG_PARTIAL);
1079 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query(((XONEpartial:(pos=1) SYNONYM XONEpartial2:(pos=1) SYNONYM XTWOpartial3:(pos=1) SYNONYM XTWOpartial4:(pos=1)) OR (XONEpartial:(pos=1) SYNONYM XTWOpartial:(pos=1))))");
1080 : :
1081 : 1 : return true;
1082 : : #endif
1083 : : }
1084 : :
1085 : 1 : static bool test_qp_flag_bool_any_case1()
1086 : : {
1087 : : using Xapian::QueryParser;
1088 : 1 : Xapian::QueryParser qp;
1089 : 1 : Xapian::Query qobj;
1090 : 1 : qobj = qp.parse_query("to and fro", QueryParser::FLAG_BOOLEAN | QueryParser::FLAG_BOOLEAN_ANY_CASE);
1091 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((to:(pos=1) AND fro:(pos=2)))");
1092 : 1 : qobj = qp.parse_query("to and fro", QueryParser::FLAG_BOOLEAN);
1093 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((to:(pos=1) OR and:(pos=2) OR fro:(pos=3)))");
1094 : : // Regression test for bug in 0.9.4 and earlier.
1095 : 1 : qobj = qp.parse_query("to And fro", QueryParser::FLAG_BOOLEAN | QueryParser::FLAG_BOOLEAN_ANY_CASE);
1096 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((to:(pos=1) AND fro:(pos=2)))");
1097 : 1 : qobj = qp.parse_query("to And fro", QueryParser::FLAG_BOOLEAN);
1098 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(qobj.get_description(), "Xapian::Query((to:(pos=1) OR and:(pos=2) OR fro:(pos=3)))");
1099 : 1 : return true;
1100 : : }
1101 : :
1102 : : static const test test_stop_queries[] = {
1103 : : { "test the queryparser", "(test:(pos=1) AND queryparser:(pos=3))" },
1104 : : // Regression test for bug in 0.9.6 and earlier. This would fail to
1105 : : // parse.
1106 : : { "test AND the AND queryparser", "(test:(pos=1) AND the:(pos=2) AND queryparser:(pos=3))" },
1107 : : // 0.9.6 and earlier ignored a stopword even if it was the only term.
1108 : : // More recent versions don't ever treat a single term as a stopword.
1109 : : { "the", "the:(pos=1)" },
1110 : : // 1.2.2 and earlier ignored an all-stopword query with multiple terms,
1111 : : // which prevents 'to be or not to be' for being searchable unless the
1112 : : // user made it into a phrase query or prefixed all terms with '+'
1113 : : // (ticket#245).
1114 : : { "an the a", "(an:(pos=1) AND the:(pos=2) AND a:(pos=3))" },
1115 : : // Regression test for bug in initial version of the patch for the
1116 : : // "all-stopword" case.
1117 : : { "the AND a an", "(the:(pos=1) AND a:(pos=2) AND an:(pos=3))" },
1118 : : { NULL, NULL }
1119 : : };
1120 : :
1121 : 1 : static bool test_qp_stopper1()
1122 : : {
1123 : 1 : Xapian::QueryParser qp;
1124 : 1 : const char * stopwords[] = { "a", "an", "the" };
1125 : 1 : Xapian::SimpleStopper stop(stopwords, stopwords + 3);
1126 : 1 : qp.set_stopper(&stop);
1127 : 1 : qp.set_default_op(Xapian::Query::OP_AND);
1128 [ + + ]: 6 : for (const test *p = test_stop_queries; p->query; ++p) {
1129 : 5 : string expect, parsed;
1130 [ + - ]: 5 : if (p->expect)
1131 : 5 : expect = p->expect;
1132 : : else
1133 : 0 : expect = "parse error";
1134 : : try {
1135 : 5 : Xapian::Query qobj = qp.parse_query(p->query);
1136 : 5 : parsed = qobj.get_description();
1137 : 5 : expect = string("Xapian::Query(") + expect + ')';
1138 : 0 : } catch (const Xapian::QueryParserError &e) {
1139 : 0 : parsed = e.get_msg();
1140 : 0 : } catch (const Xapian::Error &e) {
1141 : 0 : parsed = e.get_description();
1142 : 0 : } catch (...) {
1143 : 0 : parsed = "Unknown exception!";
1144 : : }
1145 : 5 : tout << "Query: " << p->query << '\n';
1146 [ - + # # ]: 5 : TEST_STRINGS_EQUAL(parsed, expect);
1147 : : }
1148 : 1 : return true;
1149 : : }
1150 : :
1151 : : static const test test_pure_not_queries[] = {
1152 : : { "NOT windows", "(<alldocuments> AND_NOT Zwindow:(pos=1))" },
1153 : : { "a AND (NOT b)", "(Za:(pos=1) AND (<alldocuments> AND_NOT Zb:(pos=2)))" },
1154 : : { "AND NOT windows", "Syntax: <expression> AND NOT <expression>" },
1155 : : { "gordian NOT", "Syntax: <expression> NOT <expression>" },
1156 : : { "gordian AND NOT", "Syntax: <expression> AND NOT <expression>" },
1157 : : { NULL, NULL }
1158 : : };
1159 : :
1160 : 1 : static bool test_qp_flag_pure_not1()
1161 : : {
1162 : : using Xapian::QueryParser;
1163 : 1 : Xapian::QueryParser qp;
1164 : 1 : qp.set_stemmer(Xapian::Stem("english"));
1165 : 1 : qp.set_stemming_strategy(QueryParser::STEM_SOME);
1166 [ + + ]: 6 : for (const test *p = test_pure_not_queries; p->query; ++p) {
1167 : 5 : string expect, parsed;
1168 [ + - ]: 5 : if (p->expect)
1169 : 5 : expect = p->expect;
1170 : : else
1171 : 0 : expect = "parse error";
1172 : : try {
1173 : : Xapian::Query qobj = qp.parse_query(p->query,
1174 : : QueryParser::FLAG_BOOLEAN |
1175 : 14 : QueryParser::FLAG_PURE_NOT);
1176 : 2 : parsed = qobj.get_description();
1177 : 2 : expect = string("Xapian::Query(") + expect + ')';
1178 : 6 : } catch (const Xapian::QueryParserError &e) {
1179 : 3 : parsed = e.get_msg();
1180 : 0 : } catch (const Xapian::Error &e) {
1181 : 0 : parsed = e.get_description();
1182 : 0 : } catch (...) {
1183 : 0 : parsed = "Unknown exception!";
1184 : : }
1185 : 5 : tout << "Query: " << p->query << '\n';
1186 [ - + # # ]: 5 : TEST_STRINGS_EQUAL(parsed, expect);
1187 : : }
1188 : 1 : return true;
1189 : : }
1190 : :
1191 : : // Debatable if this is a regression test or a feature test, as it's not
1192 : : // obvious is this was a bug fix or a new feature. Either way, it first
1193 : : // appeared in Xapian 1.0.0.
1194 : 1 : static bool test_qp_unstem_boolean_prefix()
1195 : : {
1196 : 1 : Xapian::QueryParser qp;
1197 : 1 : qp.add_boolean_prefix("test", "XTEST");
1198 : 1 : Xapian::Query q = qp.parse_query("hello test:foo");
1199 [ - + ][ # # ]: 1 : TEST_STRINGS_EQUAL(q.get_description(), "Xapian::Query((hello:(pos=1) FILTER XTESTfoo))");
1200 : 1 : Xapian::TermIterator u = qp.unstem_begin("XTESTfoo");
1201 [ - + ][ # # ]: 1 : TEST(u != qp.unstem_end("XTESTfoo"));
1202 [ - + ][ # # ]: 1 : TEST_EQUAL(*u, "test:foo");
1203 : 1 : ++u;
1204 [ - + ][ # # ]: 1 : TEST(u == qp.unstem_end("XTESTfoo"));
1205 : 1 : return true;
1206 : : }
1207 : :
1208 : : static const test test_value_range1_queries[] = {
1209 : : { "a..b", "VALUE_RANGE 1 a b" },
1210 : : { "$50..100", "VALUE_RANGE 1 $50 100" },
1211 : : { "$50..$100", "VALUE_RANGE 1 $50 $100" },
1212 : : { "02/03/1979..10/12/1980", "VALUE_RANGE 1 02/03/1979 10/12/1980" },
1213 : : { "a..b hello", "(hello:(pos=1) FILTER VALUE_RANGE 1 a b)" },
1214 : : { "hello a..b", "(hello:(pos=1) FILTER VALUE_RANGE 1 a b)" },
1215 : : { "hello a..b world", "((hello:(pos=1) OR world:(pos=2)) FILTER VALUE_RANGE 1 a b)" },
1216 : : { "hello a..b test:foo", "(hello:(pos=1) FILTER (VALUE_RANGE 1 a b AND XTESTfoo))" },
1217 : : { "hello a..b test:foo test:bar", "(hello:(pos=1) FILTER (VALUE_RANGE 1 a b AND (XTESTfoo OR XTESTbar)))" },
1218 : : { "hello a..b c..d test:foo", "(hello:(pos=1) FILTER ((VALUE_RANGE 1 a b OR VALUE_RANGE 1 c d) AND XTESTfoo))" },
1219 : : { "hello a..b c..d test:foo test:bar", "(hello:(pos=1) FILTER ((VALUE_RANGE 1 a b OR VALUE_RANGE 1 c d) AND (XTESTfoo OR XTESTbar)))" },
1220 : : { "-5..7", "VALUE_RANGE 1 -5 7" },
1221 : : { "hello -5..7", "(hello:(pos=1) FILTER VALUE_RANGE 1 -5 7)" },
1222 : : { "-5..7 hello", "(hello:(pos=1) FILTER VALUE_RANGE 1 -5 7)" },
1223 : : { "\"time flies\" 09:00..12:30", "((time:(pos=1) PHRASE 2 flies:(pos=2)) FILTER VALUE_RANGE 1 09:00 12:30)" },
1224 : : // Feature test for single-ended ranges (ticket#480):
1225 : : { "..b", "VALUE_RANGE 1 b" },
1226 : : { "a..", "VALUE_GE 1 a" },
1227 : : { NULL, NULL }
1228 : : };
1229 : :
1230 : : // Simple test of ValueRangeProcessor class.
1231 : 1 : static bool test_qp_value_range1()
1232 : : {
1233 : 1 : Xapian::QueryParser qp;
1234 : 1 : qp.add_boolean_prefix("test", "XTEST");
1235 : 1 : Xapian::StringValueRangeProcessor vrp(1);
1236 : 1 : qp.add_valuerangeprocessor(&vrp);
1237 [ + + ]: 18 : for (const test *p = test_value_range1_queries; p->query; ++p) {
1238 : 17 : string expect, parsed;
1239 [ + - ]: 17 : if (p->expect)
1240 : 17 : expect = p->expect;
1241 : : else
1242 : 0 : expect = "parse error";
1243 : : try {
1244 : 17 : Xapian::Query qobj = qp.parse_query(p->query);
1245 : 17 : parsed = qobj.get_description();
1246 : 17 : expect = string("Xapian::Query(") + expect + ')';
1247 : 0 : } catch (const Xapian::QueryParserError &e) {
1248 : 0 : parsed = e.get_msg();
1249 : 0 : } catch (const Xapian::Error &e) {
1250 : 0 : parsed = e.get_description();
1251 : 0 : } catch (...) {
1252 : 0 : parsed = "Unknown exception!";
1253 : : }
1254 : 17 : tout << "Query: " << p->query << '\n';
1255 [ - + # # ]: 17 : TEST_STRINGS_EQUAL(parsed, expect);
1256 : : }
1257 : 1 : return true;
1258 : : }
1259 : :
1260 : : static const test test_value_range2_queries[] = {
1261 : : { "a..b", "VALUE_RANGE 3 a b" },
1262 : : { "1..12", "VALUE_RANGE 2 \240 \256" },
1263 : : { "20070201..20070228", "VALUE_RANGE 1 20070201 20070228" },
1264 : : { "$10..20", "VALUE_RANGE 4 \255 \261" },
1265 : : { "$10..$20", "VALUE_RANGE 4 \255 \261" },
1266 : : // Feature test for single-ended ranges (ticket#480):
1267 : : { "$..20", "VALUE_RANGE 4 \261" },
1268 : : { "$10..", "VALUE_GE 4 \255" },
1269 : : { "12..42kg", "VALUE_RANGE 5 \256 \265@" },
1270 : : { "12kg..42kg", "VALUE_RANGE 5 \256 \265@" },
1271 : : { "12kg..42", "VALUE_RANGE 3 12kg 42" },
1272 : : { "10..$20", "VALUE_RANGE 3 10 $20" },
1273 : : { "1999-03-12..2020-12-30", "VALUE_RANGE 1 19990312 20201230" },
1274 : : { "1999/03/12..2020/12/30", "VALUE_RANGE 1 19990312 20201230" },
1275 : : { "1999.03.12..2020.12.30", "VALUE_RANGE 1 19990312 20201230" },
1276 : : // Feature test for single-ended ranges (ticket#480):
1277 : : { "..2020.12.30", "VALUE_RANGE 1 20201230" },
1278 : : { "1999.03.12..", "VALUE_GE 1 19990312" },
1279 : : { "12/03/99..12/04/01", "VALUE_RANGE 1 19990312 20010412" },
1280 : : { "03-12-99..04-14-01", "VALUE_RANGE 1 19990312 20010414" },
1281 : : { "(test:a..test:b hello)", "(hello:(pos=1) FILTER VALUE_RANGE 3 test:a test:b)" },
1282 : : { "12..42kg 5..6kg 1..12", "0 * (VALUE_RANGE 2 \240 \256 AND (VALUE_RANGE 5 \256 \265@ OR VALUE_RANGE 5 \251 \252))" },
1283 : : // Check that a VRP which fails to match doesn't remove a prefix or suffix.
1284 : : // 1.0.13/1.1.1 and earlier got this wrong in some cases.
1285 : : { "$12a..13", "VALUE_RANGE 3 $12a 13" },
1286 : : { "$12..13b", "VALUE_RANGE 3 $12 13b" },
1287 : : { "$12..12kg", "VALUE_RANGE 3 $12 12kg" },
1288 : : { "12..b12kg", "VALUE_RANGE 3 12 b12kg" },
1289 : : { NULL, NULL }
1290 : : };
1291 : :
1292 : : // Test chaining of ValueRangeProcessor classes.
1293 : 1 : static bool test_qp_value_range2()
1294 : : {
1295 : 1 : Xapian::QueryParser qp;
1296 : 1 : qp.add_boolean_prefix("test", "XTEST");
1297 : 1 : Xapian::DateValueRangeProcessor vrp_date(1);
1298 : 1 : Xapian::NumberValueRangeProcessor vrp_num(2);
1299 : 1 : Xapian::StringValueRangeProcessor vrp_str(3);
1300 : 1 : Xapian::NumberValueRangeProcessor vrp_cash(4, "$");
1301 : 1 : Xapian::NumberValueRangeProcessor vrp_weight(5, "kg", false);
1302 : 1 : qp.add_valuerangeprocessor(&vrp_date);
1303 : 1 : qp.add_valuerangeprocessor(&vrp_num);
1304 : 1 : qp.add_valuerangeprocessor(&vrp_cash);
1305 : 1 : qp.add_valuerangeprocessor(&vrp_weight);
1306 : 1 : qp.add_valuerangeprocessor(&vrp_str);
1307 [ + + ]: 25 : for (const test *p = test_value_range2_queries; p->query; ++p) {
1308 : 24 : string expect, parsed;
1309 [ + - ]: 24 : if (p->expect)
1310 : 24 : expect = p->expect;
1311 : : else
1312 : 0 : expect = "parse error";
1313 : : try {
1314 : 24 : Xapian::Query qobj = qp.parse_query(p->query);
1315 : 24 : parsed = qobj.get_description();
1316 : 24 : expect = string("Xapian::Query(") + expect + ')';
1317 : 0 : } catch (const Xapian::QueryParserError &e) {
1318 : 0 : parsed = e.get_msg();
1319 : 0 : } catch (const Xapian::Error &e) {
1320 : 0 : parsed = e.get_description();
1321 : 0 : } catch (...) {
1322 : 0 : parsed = "Unknown exception!";
1323 : : }
1324 : 24 : tout << "Query: " << p->query << '\n';
1325 [ - + # # ]: 24 : TEST_STRINGS_EQUAL(parsed, expect);
1326 : : }
1327 : 1 : return true;
1328 : : }
1329 : :
1330 : : // Test NumberValueRangeProcessors with actual data.
1331 : 1 : static bool test_qp_value_range3()
1332 : : {
1333 : : #ifndef XAPIAN_HAS_INMEMORY_BACKEND
1334 : : SKIP_TEST("Testcase requires the InMemory backend which is disabled");
1335 : : #else
1336 : 1 : Xapian::WritableDatabase db(Xapian::InMemory::open());
1337 : 1 : double low = -10;
1338 : 1 : int steps = 60;
1339 : 1 : double step = 0.5;
1340 : :
1341 [ + + ]: 62 : for (int i = 0; i <= steps; ++i) {
1342 : 61 : double v = low + i * step;
1343 : 61 : Xapian::Document doc;
1344 : 61 : doc.add_value(1, Xapian::sortable_serialise(v));
1345 : 61 : db.add_document(doc);
1346 : : }
1347 : :
1348 : 1 : Xapian::NumberValueRangeProcessor vrp_num(1);
1349 : 1 : Xapian::QueryParser qp;
1350 : 1 : qp.add_valuerangeprocessor(&vrp_num);
1351 : :
1352 [ + + ]: 62 : for (int j = 0; j <= steps; ++j) {
1353 : 61 : double start = low + j * step;
1354 [ + + ]: 3782 : for (int k = 0; k <= steps; ++k) {
1355 : 3721 : double end = low + k * step;
1356 : 3721 : string query = str(start) + ".." + str(end);
1357 : 3721 : tout << "Query: " << query << '\n';
1358 : 3721 : Xapian::Query qobj = qp.parse_query(query);
1359 : 3721 : Xapian::Enquire enq(db);
1360 : 3721 : enq.set_query(qobj);
1361 : 3721 : Xapian::MSet mset = enq.get_mset(0, steps + 1);
1362 [ + + ]: 3721 : if (end < start) {
1363 [ - + ][ # # ]: 1830 : TEST_EQUAL(mset.size(), 0);
1364 : : } else {
1365 [ - + ][ # # ]: 1891 : TEST_EQUAL(mset.size(), 1u + (k - j));
1366 [ + + ]: 41602 : for (unsigned int m = 0; m != mset.size(); ++m) {
1367 : 39711 : double v = start + m * step;
1368 [ - + ][ # # ]: 39711 : TEST_EQUAL(mset[m].get_document().get_value(1),
1369 : : Xapian::sortable_serialise(v));
1370 : : }
1371 : : }
1372 : : }
1373 : : }
1374 : 1 : return true;
1375 : : #endif
1376 : : }
1377 : :
1378 : : static const double test_value_range_numbers[] = {
1379 : : #ifdef INFINITY
1380 : : -INFINITY,
1381 : : #endif
1382 : : -HUGE_VAL,
1383 : : -DBL_MAX,
1384 : : -pow(2.0, 1022),
1385 : : -1024.5,
1386 : : -3.14159265358979323846,
1387 : : -3,
1388 : : -2,
1389 : : -1.8,
1390 : : -1.1,
1391 : : -1,
1392 : : -0.5,
1393 : : -0.2,
1394 : : -0.1,
1395 : : -0.000005,
1396 : : -0.000002,
1397 : : -0.000001,
1398 : : -pow(2.0, -1023),
1399 : : -pow(2.0, -1024),
1400 : : -pow(2.0, -1074),
1401 : : -DBL_MIN,
1402 : : 0,
1403 : : DBL_MIN,
1404 : : pow(2.0, -1074),
1405 : : pow(2.0, -1024),
1406 : : pow(2.0, -1023),
1407 : : 0.000001,
1408 : : 0.000002,
1409 : : 0.000005,
1410 : : 0.1,
1411 : : 0.2,
1412 : : 0.5,
1413 : : 1,
1414 : : 1.1,
1415 : : 1.8,
1416 : : 2,
1417 : : 3,
1418 : : 3.14159265358979323846,
1419 : : 1024.5,
1420 : : pow(2.0, 1022),
1421 : : DBL_MAX,
1422 : : HUGE_VAL,
1423 : : #ifdef INFINITY
1424 : : INFINITY,
1425 : : #endif
1426 : :
1427 : : 64 // Magic number which we stop at.
1428 : 1 : };
1429 : :
1430 : : static const test test_value_range4_queries[] = {
1431 : : { "id:19254@foo..example.com", "0 * Q19254@foo..example.com" },
1432 : : { "hello:world", "0 * XHELLOworld" },
1433 : : { "hello:mum..world", "VALUE_RANGE 1 mum world" },
1434 : : { NULL, NULL }
1435 : : };
1436 : :
1437 : : /** Test a boolean filter which happens to contain "..".
1438 : : *
1439 : : * Regression test for bug fixed in 1.2.3.
1440 : : *
1441 : : * Also test that the same prefix can be set for a valuerange and filter.
1442 : : */
1443 : 1 : static bool test_qp_value_range4()
1444 : : {
1445 : 1 : Xapian::QueryParser qp;
1446 : 1 : qp.add_boolean_prefix("id", "Q");
1447 : 1 : qp.add_boolean_prefix("hello", "XHELLO");
1448 : 1 : Xapian::StringValueRangeProcessor vrp_str(1, "hello:");
1449 : 1 : qp.add_valuerangeprocessor(&vrp_str);
1450 [ + + ]: 4 : for (const test *p = test_value_range4_queries; p->query; ++p) {
1451 : 3 : string expect, parsed;
1452 [ + - ]: 3 : if (p->expect)
1453 : 3 : expect = p->expect;
1454 : : else
1455 : 0 : expect = "parse error";
1456 : : try {
1457 : 3 : Xapian::Query qobj = qp.parse_query(p->query);
1458 : 3 : parsed = qobj.get_description();
1459 : 3 : expect = string("Xapian::Query(") + expect + ')';
1460 : 0 : } catch (const Xapian::QueryParserError &e) {
1461 : 0 : parsed = e.get_msg();
1462 : 0 : } catch (const Xapian::Error &e) {
1463 : 0 : parsed = e.get_description();
1464 : 0 : } catch (...) {
1465 : 0 : parsed = "Unknown exception!";
1466 : : }
1467 : 3 : tout << "Query: " << p->query << '\n';
1468 [ - + # # ]: 3 : TEST_STRINGS_EQUAL(parsed, expect);
1469 : : }
1470 : 1 : return true;
1471 : : }
1472 : :
1473 : :
1474 : : // Test serialisation and unserialisation of various numbers.
1475 : 1 : static bool test_value_range_serialise1()
1476 : : {
1477 : 1 : double prevnum = 0;
1478 : 1 : string prevstr;
1479 : 1 : bool started = false;
1480 [ + + ]: 44 : for (const double *p = test_value_range_numbers; *p != 64; ++p) {
1481 : 43 : double num = *p;
1482 : 43 : tout << "Number: " << num << '\n';
1483 : 43 : string str = Xapian::sortable_serialise(num);
1484 : 43 : tout << "String: " << str << '\n';
1485 [ - + # # ]: 43 : TEST_EQUAL(Xapian::sortable_unserialise(str), num);
1486 : :
1487 [ + + ]: 43 : if (started) {
1488 : 42 : int num_cmp = 0;
1489 [ + + ]: 42 : if (prevnum < num) {
1490 : 36 : num_cmp = -1;
1491 [ + + ]: 6 : } else if (prevnum > num) {
1492 : 2 : num_cmp = 1;
1493 : : }
1494 : 42 : int str_cmp = 0;
1495 [ + + ]: 42 : if (prevstr < str) {
1496 : 36 : str_cmp = -1;
1497 [ + + ]: 6 : } else if (prevstr > str) {
1498 : 2 : str_cmp = 1;
1499 : : }
1500 : :
1501 [ - + ][ # # ]: 42 : TEST_AND_EXPLAIN(num_cmp == str_cmp,
1502 : : "Numbers " << prevnum << " and " << num <<
1503 : : " don't sort the same way as their string "
1504 : : "counterparts");
1505 : : }
1506 : :
1507 : 43 : prevnum = num;
1508 : 43 : prevstr = str;
1509 : 43 : started = true;
1510 : : }
1511 : 1 : return true;
1512 : : }
1513 : :
1514 : : static const test test_value_daterange1_queries[] = {
1515 : : { "12/03/99..12/04/01", "VALUE_RANGE 1 19991203 20011204" },
1516 : : { "03-12-99..04-14-01", "VALUE_RANGE 1 19990312 20010414" },
1517 : : { "01/30/60..02/02/59", "VALUE_RANGE 1 19600130 20590202" },
1518 : : { "1999-03-12..2001-04-14", "VALUE_RANGE 1 19990312 20010414" },
1519 : : { "12/03/99..02", "Unknown range operation" },
1520 : : { "1999-03-12..2001", "Unknown range operation" },
1521 : : { NULL, NULL }
1522 : : };
1523 : :
1524 : : // Test DateValueRangeProcessor
1525 : 1 : static bool test_qp_value_daterange1()
1526 : : {
1527 : 1 : Xapian::QueryParser qp;
1528 : 1 : Xapian::DateValueRangeProcessor vrp_date(1, true, 1960);
1529 : 1 : qp.add_valuerangeprocessor(&vrp_date);
1530 [ + + ]: 7 : for (const test *p = test_value_daterange1_queries; p->query; ++p) {
1531 : 6 : string expect, parsed;
1532 [ + - ]: 6 : if (p->expect)
1533 : 6 : expect = p->expect;
1534 : : else
1535 : 0 : expect = "parse error";
1536 : : try {
1537 : 12 : Xapian::Query qobj = qp.parse_query(p->query);
1538 : 4 : parsed = qobj.get_description();
1539 : 4 : expect = string("Xapian::Query(") + expect + ')';
1540 : 4 : } catch (const Xapian::QueryParserError &e) {
1541 : 2 : parsed = e.get_msg();
1542 : 0 : } catch (const Xapian::Error &e) {
1543 : 0 : parsed = e.get_description();
1544 : 0 : } catch (...) {
1545 : 0 : parsed = "Unknown exception!";
1546 : : }
1547 : 6 : tout << "Query: " << p->query << '\n';
1548 [ - + # # ]: 6 : TEST_STRINGS_EQUAL(parsed, expect);
1549 : : }
1550 : 1 : return true;
1551 : : }
1552 : :
1553 : : static const test test_value_daterange2_queries[] = {
1554 : : { "created:12/03/99..12/04/01", "VALUE_RANGE 1 19991203 20011204" },
1555 : : { "modified:03-12-99..04-14-01", "VALUE_RANGE 2 19990312 20010414" },
1556 : : { "accessed:01/30/70..02/02/69", "VALUE_RANGE 3 19700130 20690202" },
1557 : : { "1999-03-12..2001-04-14", "Unknown range operation" },
1558 : : { "12/03/99..created:12/04/01", "Unknown range operation" },
1559 : : { "12/03/99created:..12/04/01", "Unknown range operation" },
1560 : : { "12/03/99..12/04/01created:", "Unknown range operation" },
1561 : : { "12/03/99..02", "Unknown range operation" },
1562 : : { "1999-03-12..2001", "Unknown range operation" },
1563 : : { NULL, NULL }
1564 : : };
1565 : :
1566 : : // Feature test DateValueRangeProcessor with prefixes (added in 1.1.2).
1567 : 1 : static bool test_qp_value_daterange2()
1568 : : {
1569 : 1 : Xapian::QueryParser qp;
1570 : 1 : Xapian::DateValueRangeProcessor vrp_cdate(1, "created:", true, true, 1970);
1571 : 1 : Xapian::DateValueRangeProcessor vrp_mdate(2, "modified:", true, true, 1970);
1572 : 1 : Xapian::DateValueRangeProcessor vrp_adate(3, "accessed:", true, true, 1970);
1573 : 1 : qp.add_valuerangeprocessor(&vrp_cdate);
1574 : 1 : qp.add_valuerangeprocessor(&vrp_mdate);
1575 : 1 : qp.add_valuerangeprocessor(&vrp_adate);
1576 [ + + ]: 10 : for (const test *p = test_value_daterange2_queries; p->query; ++p) {
1577 : 9 : string expect, parsed;
1578 [ + - ]: 9 : if (p->expect)
1579 : 9 : expect = p->expect;
1580 : : else
1581 : 0 : expect = "parse error";
1582 : : try {
1583 : 27 : Xapian::Query qobj = qp.parse_query(p->query);
1584 : 3 : parsed = qobj.get_description();
1585 : 3 : expect = string("Xapian::Query(") + expect + ')';
1586 : 12 : } catch (const Xapian::QueryParserError &e) {
1587 : 6 : parsed = e.get_msg();
1588 : 0 : } catch (const Xapian::Error &e) {
1589 : 0 : parsed = e.get_description();
1590 : 0 : } catch (...) {
1591 : 0 : parsed = "Unknown exception!";
1592 : : }
1593 : 9 : tout << "Query: " << p->query << '\n';
1594 [ - + # # ]: 9 : TEST_STRINGS_EQUAL(parsed, expect);
1595 : : }
1596 : 1 : return true;
1597 : : }
1598 : :
1599 : : static const test test_value_stringrange1_queries[] = {
1600 : : { "tag:bar..foo", "VALUE_RANGE 1 bar foo" },
1601 : : { "bar..foo", "VALUE_RANGE 0 bar foo" },
1602 : : { NULL, NULL }
1603 : : };
1604 : :
1605 : : // Feature test StringValueRangeProcessor with prefixes (added in 1.1.2).
1606 : 1 : static bool test_qp_value_stringrange1()
1607 : : {
1608 : 1 : Xapian::QueryParser qp;
1609 : 1 : Xapian::StringValueRangeProcessor vrp_default(0);
1610 : 1 : Xapian::StringValueRangeProcessor vrp_tag(1, "tag:", true);
1611 : 1 : qp.add_valuerangeprocessor(&vrp_tag);
1612 : 1 : qp.add_valuerangeprocessor(&vrp_default);
1613 [ + + ]: 3 : for (const test *p = test_value_stringrange1_queries; p->query; ++p) {
1614 : 2 : string expect, parsed;
1615 [ + - ]: 2 : if (p->expect)
1616 : 2 : expect = p->expect;
1617 : : else
1618 : 0 : expect = "parse error";
1619 : : try {
1620 : 2 : Xapian::Query qobj = qp.parse_query(p->query);
1621 : 2 : parsed = qobj.get_description();
1622 : 2 : expect = string("Xapian::Query(") + expect + ')';
1623 : 0 : } catch (const Xapian::QueryParserError &e) {
1624 : 0 : parsed = e.get_msg();
1625 : 0 : } catch (const Xapian::Error &e) {
1626 : 0 : parsed = e.get_description();
1627 : 0 : } catch (...) {
1628 : 0 : parsed = "Unknown exception!";
1629 : : }
1630 : 2 : tout << "Query: " << p->query << '\n';
1631 [ - + # # ]: 2 : TEST_STRINGS_EQUAL(parsed, expect);
1632 : : }
1633 : 1 : return true;
1634 : : }
1635 : :
1636 [ # # ][ - + ]: 1 : struct AuthorValueRangeProcessor : public Xapian::ValueRangeProcessor {
1637 : 1 : AuthorValueRangeProcessor() {}
1638 : :
1639 : 1 : Xapian::valueno operator()(std::string &begin, std::string &end) {
1640 [ - + ]: 1 : if (!startswith(begin, "author:"))
1641 : 0 : return Xapian::BAD_VALUENO;
1642 : 1 : begin.erase(0, 7);
1643 : 1 : begin = Xapian::Unicode::tolower(begin);
1644 : 1 : end = Xapian::Unicode::tolower(end);
1645 : 1 : return 4;
1646 : : }
1647 : : };
1648 : :
1649 : : static const test test_value_customrange1_queries[] = {
1650 : : { "mars author:Asimov..Bradbury", "(mars:(pos=1) FILTER VALUE_RANGE 4 asimov bradbury)" },
1651 : : { NULL, NULL }
1652 : : };
1653 : :
1654 : : // Test custom ValueRangeProcessor subclass.
1655 : 1 : static bool test_qp_value_customrange1()
1656 : : {
1657 : 1 : Xapian::QueryParser qp;
1658 : 1 : AuthorValueRangeProcessor vrp_author;
1659 : 1 : qp.add_valuerangeprocessor(&vrp_author);
1660 [ + + ]: 2 : for (const test *p = test_value_customrange1_queries; p->query; ++p) {
1661 : 1 : string expect, parsed;
1662 [ + - ]: 1 : if (p->expect)
1663 : 1 : expect = p->expect;
1664 : : else
1665 : 0 : expect = "parse error";
1666 : : try {
1667 : 1 : Xapian::Query qobj = qp.parse_query(p->query);
1668 : 1 : parsed = qobj.get_description();
1669 : 1 : expect = string("Xapian::Query(") + expect + ')';
1670 : 0 : } catch (const Xapian::QueryParserError &e) {
1671 : 0 : parsed = e.get_msg();
1672 : 0 : } catch (const Xapian::Error &e) {
1673 : 0 : parsed = e.get_description();
1674 : 0 : } catch (...) {
1675 : 0 : parsed = "Unknown exception!";
1676 : : }
1677 : 1 : tout << "Query: " << p->query << '\n';
1678 [ - + # # ]: 1 : TEST_STRINGS_EQUAL(parsed, expect);
1679 : : }
1680 : 1 : return true;
1681 : : }
1682 : :
1683 : 1 : static bool test_qp_stoplist1()
1684 : : {
1685 : 1 : Xapian::QueryParser qp;
1686 : 1 : const char * stopwords[] = { "a", "an", "the" };
1687 : 1 : Xapian::SimpleStopper stop(stopwords, stopwords + 3);
1688 : 1 : qp.set_stopper(&stop);
1689 : :
1690 : 1 : Xapian::TermIterator i;
1691 : :
1692 : 1 : Xapian::Query query1 = qp.parse_query("some mice");
1693 : 1 : i = qp.stoplist_begin();
1694 [ - + ][ # # ]: 1 : TEST(i == qp.stoplist_end());
1695 : :
1696 : 1 : Xapian::Query query2 = qp.parse_query("the cat");
1697 : 1 : i = qp.stoplist_begin();
1698 [ - + ][ # # ]: 1 : TEST(i != qp.stoplist_end());
1699 [ - + ][ # # ]: 1 : TEST_EQUAL(*i, "the");
1700 : 1 : ++i;
1701 [ - + ][ # # ]: 1 : TEST(i == qp.stoplist_end());
1702 : :
1703 : : // Regression test - prior to Xapian 1.0.0 the stoplist wasn't being cleared
1704 : : // when a new query was parsed.
1705 : 1 : Xapian::Query query3 = qp.parse_query("an aardvark");
1706 : 1 : i = qp.stoplist_begin();
1707 [ - + ][ # # ]: 1 : TEST(i != qp.stoplist_end());
1708 [ - + ][ # # ]: 1 : TEST_EQUAL(*i, "an");
1709 : 1 : ++i;
1710 [ - + ][ # # ]: 1 : TEST(i == qp.stoplist_end());
1711 : :
1712 : 1 : return true;
1713 : : }
1714 : :
1715 : : static const test test_mispelled_queries[] = {
1716 : : { "doucment search", "document search" },
1717 : : { "doucment seeacrh", "document search" },
1718 : : { "docment seeacrh test", "document search test" },
1719 : : { "\"paragahp pineapple\"", "\"paragraph pineapple\"" },
1720 : : { "\"paragahp pineapple\"", "\"paragraph pineapple\"" },
1721 : : { "test S.E.A.R.C.", "" },
1722 : : { "this AND that", "" },
1723 : : { "documento", "document" },
1724 : : { "documento-documento", "document-document" },
1725 : : { "documento-searcho", "document-search" },
1726 : : { "test saerch", "test search" },
1727 : : { "paragraf search", "paragraph search" },
1728 : : { NULL, NULL }
1729 : : };
1730 : :
1731 : : // Test spelling correction in the QueryParser.
1732 : 2 : static bool test_qp_spell1()
1733 : : {
1734 : 2 : mkdir(".flint", 0755);
1735 : 2 : string dbdir = ".flint/qp_spell1";
1736 : 2 : Xapian::WritableDatabase db(dbdir, Xapian::DB_CREATE_OR_OVERWRITE);
1737 : :
1738 : 2 : Xapian::Document doc;
1739 : 2 : doc.add_term("document", 6);
1740 : 2 : doc.add_term("search", 7);
1741 : 2 : doc.add_term("saerch", 1);
1742 : 2 : doc.add_term("paragraph", 8);
1743 : 2 : doc.add_term("paragraf", 2);
1744 : 2 : db.add_document(doc);
1745 : :
1746 : 2 : db.add_spelling("document");
1747 : 2 : db.add_spelling("search");
1748 : 2 : db.add_spelling("paragraph");
1749 : 2 : db.add_spelling("band");
1750 : :
1751 : 2 : Xapian::QueryParser qp;
1752 : 2 : qp.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
1753 : 2 : qp.set_database(db);
1754 : :
1755 [ + + ]: 26 : for (const test *p = test_mispelled_queries; p->query; ++p) {
1756 : 24 : Xapian::Query q;
1757 : : q = qp.parse_query(p->query,
1758 : : Xapian::QueryParser::FLAG_SPELLING_CORRECTION |
1759 : 24 : Xapian::QueryParser::FLAG_BOOLEAN );
1760 : 24 : tout << "Query: " << p->query << endl;
1761 [ - + ][ # # ]: 24 : TEST_STRINGS_EQUAL(qp.get_corrected_query_string(), p->expect);
1762 : : }
1763 : :
1764 : 2 : return true;
1765 : : }
1766 : :
1767 : : // Test spelling correction in the QueryParser with multiple databases.
1768 : 1 : static bool test_qp_spell2()
1769 : : {
1770 : 1 : mkdir(".flint", 0755);
1771 : 1 : string dbdir = ".flint/qp_spell2";
1772 : 1 : Xapian::WritableDatabase db1(dbdir, Xapian::DB_CREATE_OR_OVERWRITE);
1773 : :
1774 : 1 : db1.add_spelling("document");
1775 : 1 : db1.add_spelling("search");
1776 : 1 : db1.commit();
1777 : :
1778 : 1 : dbdir = ".flint/qp_spell2b";
1779 : 1 : Xapian::WritableDatabase db2(dbdir, Xapian::DB_CREATE_OR_OVERWRITE);
1780 : :
1781 : 1 : db2.add_spelling("document");
1782 : 1 : db2.add_spelling("paragraph");
1783 : 1 : db2.add_spelling("band");
1784 : :
1785 : 1 : Xapian::Database db;
1786 : 1 : db.add_database(db1);
1787 : 1 : db.add_database(db2);
1788 : :
1789 : 1 : Xapian::QueryParser qp;
1790 : 1 : qp.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
1791 : 1 : qp.set_database(db);
1792 : :
1793 [ + + ]: 13 : for (const test *p = test_mispelled_queries; p->query; ++p) {
1794 : 12 : Xapian::Query q;
1795 : : q = qp.parse_query(p->query,
1796 : : Xapian::QueryParser::FLAG_SPELLING_CORRECTION |
1797 : 12 : Xapian::QueryParser::FLAG_BOOLEAN );
1798 : 12 : tout << "Query: " << p->query << endl;
1799 [ - + ][ # # ]: 12 : TEST_STRINGS_EQUAL(qp.get_corrected_query_string(), p->expect);
1800 : : }
1801 : :
1802 : 1 : return true;
1803 : : }
1804 : :
1805 : : static const test test_mispelled_wildcard_queries[] = {
1806 : : { "doucment", "document" },
1807 : : { "doucment*", "" },
1808 : : { "doucment* seearch", "doucment* search" },
1809 : : { "doucment* search", "" },
1810 : : { NULL, NULL }
1811 : : };
1812 : :
1813 : : // Test spelling correction in the QueryParser with wildcards.
1814 : : // Regression test for bug fixed in 1.1.3 and 1.0.17.
1815 : 1 : static bool test_qp_spellwild1()
1816 : : {
1817 : 1 : mkdir(".flint", 0755);
1818 : 1 : string dbdir = ".flint/qp_spellwild1";
1819 : 1 : Xapian::WritableDatabase db(dbdir, Xapian::DB_CREATE_OR_OVERWRITE);
1820 : :
1821 : 1 : db.add_spelling("document");
1822 : 1 : db.add_spelling("search");
1823 : 1 : db.add_spelling("paragraph");
1824 : 1 : db.add_spelling("band");
1825 : :
1826 : 1 : Xapian::QueryParser qp;
1827 : 1 : qp.set_database(db);
1828 : :
1829 : : const test *p;
1830 [ + + ]: 13 : for (p = test_mispelled_queries; p->query; ++p) {
1831 : 12 : Xapian::Query q;
1832 : : q = qp.parse_query(p->query,
1833 : : Xapian::QueryParser::FLAG_SPELLING_CORRECTION |
1834 : : Xapian::QueryParser::FLAG_BOOLEAN |
1835 : 12 : Xapian::QueryParser::FLAG_WILDCARD);
1836 : 12 : tout << "Query: " << p->query << endl;
1837 [ - + ][ # # ]: 12 : TEST_STRINGS_EQUAL(qp.get_corrected_query_string(), p->expect);
1838 : : }
1839 [ + + ]: 5 : for (p = test_mispelled_wildcard_queries; p->query; ++p) {
1840 : 4 : Xapian::Query q;
1841 : : q = qp.parse_query(p->query,
1842 : : Xapian::QueryParser::FLAG_SPELLING_CORRECTION |
1843 : : Xapian::QueryParser::FLAG_BOOLEAN |
1844 : 4 : Xapian::QueryParser::FLAG_WILDCARD);
1845 : 4 : tout << "Query: " << p->query << endl;
1846 [ - + ][ # # ]: 4 : TEST_STRINGS_EQUAL(qp.get_corrected_query_string(), p->expect);
1847 : : }
1848 : :
1849 : 1 : return true;
1850 : : }
1851 : :
1852 : : static const test test_mispelled_partial_queries[] = {
1853 : : { "doucment", "" },
1854 : : { "doucment ", "document " },
1855 : : { "documen", "" },
1856 : : { "documen ", "document " },
1857 : : { "seearch documen", "search documen" },
1858 : : { "search documen", "" },
1859 : : { NULL, NULL }
1860 : : };
1861 : :
1862 : : // Test spelling correction in the QueryParser with FLAG_PARTIAL.
1863 : : // Regression test for bug fixed in 1.1.3 and 1.0.17.
1864 : 1 : static bool test_qp_spellpartial1()
1865 : : {
1866 : 1 : mkdir(".flint", 0755);
1867 : 1 : string dbdir = ".flint/qp_spellpartial1";
1868 : 1 : Xapian::WritableDatabase db(dbdir, Xapian::DB_CREATE_OR_OVERWRITE);
1869 : :
1870 : 1 : db.add_spelling("document");
1871 : 1 : db.add_spelling("search");
1872 : 1 : db.add_spelling("paragraph");
1873 : 1 : db.add_spelling("band");
1874 : :
1875 : 1 : Xapian::QueryParser qp;
1876 : 1 : qp.set_database(db);
1877 : :
1878 [ + + ]: 7 : for (const test *p = test_mispelled_partial_queries; p->query; ++p) {
1879 : 6 : Xapian::Query q;
1880 : : q = qp.parse_query(p->query,
1881 : : Xapian::QueryParser::FLAG_SPELLING_CORRECTION |
1882 : 6 : Xapian::QueryParser::FLAG_PARTIAL);
1883 : 6 : tout << "Query: " << p->query << endl;
1884 [ - + ][ # # ]: 6 : TEST_STRINGS_EQUAL(qp.get_corrected_query_string(), p->expect);
1885 : : }
1886 : :
1887 : 1 : return true;
1888 : : }
1889 : :
1890 : : static const test test_synonym_queries[] = {
1891 : : { "searching", "(Zsearch:(pos=1) SYNONYM Zfind:(pos=1) SYNONYM Zlocate:(pos=1))" },
1892 : : { "search", "(Zsearch:(pos=1) SYNONYM find:(pos=1))" },
1893 : : { "Search", "(search:(pos=1) SYNONYM find:(pos=1))" },
1894 : : { "Searching", "searching:(pos=1)" },
1895 : : { "searching OR terms", "((Zsearch:(pos=1) SYNONYM Zfind:(pos=1) SYNONYM Zlocate:(pos=1)) OR Zterm:(pos=2))" },
1896 : : { "search OR terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) OR Zterm:(pos=2))" },
1897 : : { "search +terms", "(Zterm:(pos=2) AND_MAYBE (Zsearch:(pos=1) SYNONYM find:(pos=1)))" },
1898 : : { "search -terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) AND_NOT Zterm:(pos=2))" },
1899 : : { "+search terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) AND_MAYBE Zterm:(pos=2))" },
1900 : : { "-search terms", "(Zterm:(pos=2) AND_NOT (Zsearch:(pos=1) SYNONYM find:(pos=1)))" },
1901 : : { "search terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) OR Zterm:(pos=2))" },
1902 : : // Shouldn't trigger synonyms:
1903 : : { "\"search terms\"", "(search:(pos=1) PHRASE 2 terms:(pos=2))" },
1904 : : { NULL, NULL }
1905 : : };
1906 : :
1907 : : // Test single term synonyms in the QueryParser.
1908 : 1 : static bool test_qp_synonym1()
1909 : : {
1910 : 1 : mkdir(".flint", 0755);
1911 : 1 : string dbdir = ".flint/qp_synonym1";
1912 : 1 : Xapian::WritableDatabase db(dbdir, Xapian::DB_CREATE_OR_OVERWRITE);
1913 : :
1914 : 1 : db.add_synonym("Zsearch", "Zfind");
1915 : 1 : db.add_synonym("Zsearch", "Zlocate");
1916 : 1 : db.add_synonym("search", "find");
1917 : 1 : db.add_synonym("Zseek", "Zsearch");
1918 : :
1919 : 1 : db.commit();
1920 : :
1921 : 1 : Xapian::QueryParser qp;
1922 : 1 : qp.set_stemmer(Xapian::Stem("english"));
1923 : 1 : qp.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
1924 : 1 : qp.set_database(db);
1925 : :
1926 [ + + ]: 13 : for (const test *p = test_synonym_queries; p->query; ++p) {
1927 : 12 : string expect = "Xapian::Query(";
1928 : 12 : expect += p->expect;
1929 : 12 : expect += ')';
1930 : 12 : Xapian::Query q;
1931 : 12 : q = qp.parse_query(p->query, qp.FLAG_AUTO_SYNONYMS|qp.FLAG_DEFAULT);
1932 : 12 : tout << "Query: " << p->query << endl;
1933 [ - + ][ # # ]: 12 : TEST_STRINGS_EQUAL(q.get_description(), expect);
1934 : : }
1935 : :
1936 : 1 : return true;
1937 : : }
1938 : :
1939 : : static const test test_multi_synonym_queries[] = {
1940 : : { "sun OR tan OR cream", "(Zsun:(pos=1) OR Ztan:(pos=2) OR Zcream:(pos=3))" },
1941 : : { "sun tan", "((Zsun:(pos=1) OR Ztan:(pos=2)) SYNONYM bathe:(pos=1))" },
1942 : : { "sun tan cream", "((Zsun:(pos=1) OR Ztan:(pos=2) OR Zcream:(pos=3)) SYNONYM lotion:(pos=1))" },
1943 : : { "beach sun tan holiday", "(Zbeach:(pos=1) OR ((Zsun:(pos=2) OR Ztan:(pos=3)) SYNONYM bathe:(pos=2)) OR Zholiday:(pos=4))" },
1944 : : { "sun tan sun tan cream", "(((Zsun:(pos=1) OR Ztan:(pos=2)) SYNONYM bathe:(pos=1)) OR ((Zsun:(pos=3) OR Ztan:(pos=4) OR Zcream:(pos=5)) SYNONYM lotion:(pos=3)))" },
1945 : : { "single", "(Zsingl:(pos=1) SYNONYM record:(pos=1))" },
1946 : : { NULL, NULL }
1947 : : };
1948 : :
1949 : : // Test multi term synonyms in the QueryParser.
1950 : 1 : static bool test_qp_synonym2()
1951 : : {
1952 : 1 : mkdir(".flint", 0755);
1953 : 1 : string dbdir = ".flint/qp_synonym2";
1954 : 1 : Xapian::WritableDatabase db(dbdir, Xapian::DB_CREATE_OR_OVERWRITE);
1955 : :
1956 : 1 : db.add_synonym("sun tan cream", "lotion");
1957 : 1 : db.add_synonym("sun tan", "bathe");
1958 : 1 : db.add_synonym("single", "record");
1959 : :
1960 : 1 : db.commit();
1961 : :
1962 : 1 : Xapian::QueryParser qp;
1963 : 1 : qp.set_stemmer(Xapian::Stem("english"));
1964 : 1 : qp.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
1965 : 1 : qp.set_database(db);
1966 : :
1967 [ + + ]: 7 : for (const test *p = test_multi_synonym_queries; p->query; ++p) {
1968 : 6 : string expect = "Xapian::Query(";
1969 : 6 : expect += p->expect;
1970 : 6 : expect += ')';
1971 : 6 : Xapian::Query q;
1972 : : q = qp.parse_query(p->query,
1973 : : Xapian::QueryParser::FLAG_AUTO_MULTIWORD_SYNONYMS |
1974 : 6 : Xapian::QueryParser::FLAG_DEFAULT);
1975 : 6 : tout << "Query: " << p->query << endl;
1976 [ - + ][ # # ]: 6 : TEST_STRINGS_EQUAL(q.get_description(), expect);
1977 : : }
1978 : :
1979 : 1 : return true;
1980 : : }
1981 : :
1982 : : static const test test_synonym_op_queries[] = {
1983 : : { "searching", "Zsearch:(pos=1)" },
1984 : : { "~searching", "(Zsearch:(pos=1) SYNONYM Zfind:(pos=1) SYNONYM Zlocate:(pos=1))" },
1985 : : { "~search", "(Zsearch:(pos=1) SYNONYM find:(pos=1))" },
1986 : : { "~Search", "(search:(pos=1) SYNONYM find:(pos=1))" },
1987 : : { "~Searching", "searching:(pos=1)" },
1988 : : { "~searching OR terms", "((Zsearch:(pos=1) SYNONYM Zfind:(pos=1) SYNONYM Zlocate:(pos=1)) OR Zterm:(pos=2))" },
1989 : : { "~search OR terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) OR Zterm:(pos=2))" },
1990 : : { "~search +terms", "(Zterm:(pos=2) AND_MAYBE (Zsearch:(pos=1) SYNONYM find:(pos=1)))" },
1991 : : { "~search -terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) AND_NOT Zterm:(pos=2))" },
1992 : : { "+~search terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) AND_MAYBE Zterm:(pos=2))" },
1993 : : { "-~search terms", "(Zterm:(pos=2) AND_NOT (Zsearch:(pos=1) SYNONYM find:(pos=1)))" },
1994 : : { "~search terms", "((Zsearch:(pos=1) SYNONYM find:(pos=1)) OR Zterm:(pos=2))" },
1995 : : // FIXME: should look for multi-term synonym...
1996 : : { "~\"search terms\"", "(search:(pos=1) PHRASE 2 terms:(pos=2))" },
1997 : : { NULL, NULL }
1998 : : };
1999 : :
2000 : : // Test the synonym operator in the QueryParser.
2001 : 1 : static bool test_qp_synonym3()
2002 : : {
2003 : 1 : mkdir(".flint", 0755);
2004 : 1 : string dbdir = ".flint/qp_synonym3";
2005 : 1 : Xapian::WritableDatabase db(dbdir, Xapian::DB_CREATE_OR_OVERWRITE);
2006 : :
2007 : 1 : db.add_synonym("Zsearch", "Zfind");
2008 : 1 : db.add_synonym("Zsearch", "Zlocate");
2009 : 1 : db.add_synonym("search", "find");
2010 : 1 : db.add_synonym("Zseek", "Zsearch");
2011 : :
2012 : 1 : db.commit();
2013 : :
2014 : 1 : Xapian::QueryParser qp;
2015 : 1 : qp.set_stemmer(Xapian::Stem("english"));
2016 : 1 : qp.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
2017 : 1 : qp.set_database(db);
2018 : :
2019 [ + + ]: 14 : for (const test *p = test_synonym_op_queries; p->query; ++p) {
2020 : 13 : string expect = "Xapian::Query(";
2021 : 13 : expect += p->expect;
2022 : 13 : expect += ')';
2023 : 13 : Xapian::Query q;
2024 : : q = qp.parse_query(p->query,
2025 : : Xapian::QueryParser::FLAG_SYNONYM |
2026 : : Xapian::QueryParser::FLAG_BOOLEAN |
2027 : : Xapian::QueryParser::FLAG_LOVEHATE |
2028 : 13 : Xapian::QueryParser::FLAG_PHRASE );
2029 : 13 : tout << "Query: " << p->query << endl;
2030 [ - + ][ # # ]: 13 : TEST_STRINGS_EQUAL(q.get_description(), expect);
2031 : : }
2032 : :
2033 : 1 : return true;
2034 : : }
2035 : :
2036 : : static const test test_stem_all_queries[] = {
2037 : : { "\"chemical engineers\"", "(chemic:(pos=1) PHRASE 2 engin:(pos=2))" },
2038 : : { "chemical NEAR engineers", "(chemic:(pos=1) NEAR 11 engin:(pos=2))" },
2039 : : { "chemical engineers", "(chemic:(pos=1) OR engin:(pos=2))" },
2040 : : { NULL, NULL }
2041 : : };
2042 : :
2043 : 1 : static bool test_qp_stem_all1()
2044 : : {
2045 : 1 : Xapian::QueryParser qp;
2046 : 1 : qp.set_stemmer(Xapian::Stem("english"));
2047 : 1 : qp.set_stemming_strategy(qp.STEM_ALL);
2048 [ + + ]: 4 : for (const test *p = test_stem_all_queries; p->query; ++p) {
2049 : 3 : string expect, parsed;
2050 [ + - ]: 3 : if (p->expect)
2051 : 3 : expect = p->expect;
2052 : : else
2053 : 0 : expect = "parse error";
2054 : : try {
2055 : 3 : Xapian::Query qobj = qp.parse_query(p->query);
2056 : 3 : parsed = qobj.get_description();
2057 : 3 : expect = string("Xapian::Query(") + expect + ')';
2058 : 0 : } catch (const Xapian::QueryParserError &e) {
2059 : 0 : parsed = e.get_msg();
2060 : 0 : } catch (const Xapian::Error &e) {
2061 : 0 : parsed = e.get_description();
2062 : 0 : } catch (...) {
2063 : 0 : parsed = "Unknown exception!";
2064 : : }
2065 : 3 : tout << "Query: " << p->query << '\n';
2066 [ - + # # ]: 3 : TEST_STRINGS_EQUAL(parsed, expect);
2067 : : }
2068 : 1 : return true;
2069 : : }
2070 : :
2071 : : static double
2072 : 8 : time_query_parse(const Xapian::Database & db, const string & q,
2073 : : int repetitions, unsigned flags)
2074 : : {
2075 : 8 : Xapian::QueryParser qp;
2076 : 8 : qp.set_database(db);
2077 : 8 : CPUTimer timer;
2078 : 8 : std::vector<Xapian::Query> qs;
2079 : 8 : qs.reserve(repetitions);
2080 [ + + ]: 20012 : for (int i = 0; i != repetitions; ++i) {
2081 : 20004 : qs.push_back(qp.parse_query(q, flags));
2082 : : }
2083 [ + + ]: 8 : if (repetitions > 1) {
2084 : 4 : Xapian::Query qc(Xapian::Query::OP_OR, qs.begin(), qs.end());
2085 : : }
2086 : 8 : return timer.get_time();
2087 : : }
2088 : :
2089 : : static void
2090 : 4 : qp_scale1_helper(const Xapian::Database &db, const string & q, unsigned n,
2091 : : unsigned flags)
2092 : : {
2093 : : double time1;
2094 : 0 : while (true) {
2095 : 4 : time1 = time_query_parse(db, q, n, flags);
2096 [ + - ]: 4 : if (time1 != 0.0) break;
2097 : :
2098 : : // The first test completed before the timer ticked at all, so increase
2099 : : // the number of repetitions and retry.
2100 : 0 : unsigned n_new = n * 10;
2101 [ # # ]: 0 : if (n_new < n)
2102 [ # # ]: 0 : SKIP_TEST("Can't count enough repetitions to be able to time test");
2103 : 0 : n = n_new;
2104 : : }
2105 : :
2106 : 4 : string q_n;
2107 : 4 : q_n.reserve(q.size() * n);
2108 [ + + ]: 20004 : for (unsigned i = n; i != 0; --i) {
2109 : 20000 : q_n += q;
2110 : : }
2111 : :
2112 : 4 : double time2 = time_query_parse(db, q_n, 1, flags);
2113 : 4 : tout << "small=" << time1 << "s, large=" << time2 << "s\n";
2114 : :
2115 : : // Allow a factor of 2.15 difference, to cover random variation and a
2116 : : // native time interval which isn't an exact multiple of 1/CLK_TCK.
2117 [ - + # # ]: 4 : TEST_REL(time2,<,time1 * 2.15);
2118 : 4 : }
2119 : :
2120 : : // Regression test: check that query parser doesn't scale very badly with the
2121 : : // size of the query.
2122 : 1 : static bool test_qp_scale1()
2123 : : {
2124 : 1 : mkdir(".flint", 0755);
2125 : 1 : string dbdir = ".flint/qp_scale1";
2126 : 1 : Xapian::WritableDatabase db(dbdir, Xapian::DB_CREATE_OR_OVERWRITE);
2127 : :
2128 : 1 : db.add_synonym("foo", "bar");
2129 : 1 : db.commit();
2130 : :
2131 : 1 : string q1("foo ");
2132 : 1 : string q1b("baz ");
2133 : 1 : const unsigned repetitions = 5000;
2134 : :
2135 : : // A long multiword synonym.
2136 : 1 : string syn;
2137 [ + + ]: 61 : for (int j = 60; j != 0; --j) {
2138 : 60 : syn += q1;
2139 : : }
2140 : 1 : syn.resize(syn.size() - 1);
2141 : :
2142 : : unsigned synflags = Xapian::QueryParser::FLAG_DEFAULT |
2143 : : Xapian::QueryParser::FLAG_SYNONYM |
2144 : 1 : Xapian::QueryParser::FLAG_AUTO_MULTIWORD_SYNONYMS;
2145 : :
2146 : : // First, we test a simple query.
2147 : 1 : qp_scale1_helper(db, q1, repetitions, Xapian::QueryParser::FLAG_DEFAULT);
2148 : :
2149 : : // If synonyms are enabled, a different code-path is followed.
2150 : : // Test a query which has no synonyms.
2151 : 1 : qp_scale1_helper(db, q1b, repetitions, synflags);
2152 : :
2153 : : // Test a query which has short synonyms.
2154 : 1 : qp_scale1_helper(db, q1, repetitions, synflags);
2155 : :
2156 : : // Add a synonym for the whole query, to test that code path.
2157 : 1 : db.add_synonym(syn, "bar");
2158 : 1 : db.commit();
2159 : :
2160 : 1 : qp_scale1_helper(db, q1, repetitions, synflags);
2161 : :
2162 : 1 : return true;
2163 : : }
2164 : :
2165 : : static const test test_near_queries[] = {
2166 : : { "simple-example", "(simple:(pos=1) PHRASE 2 example:(pos=2))" },
2167 : : { "stock -cooking", "(Zstock:(pos=1) AND_NOT Zcook:(pos=2))" },
2168 : : // FIXME: these give NEAR 2
2169 : : // { "foo -baz bar", "((Zfoo:(pos=1) NEAR 11 Zbar:(pos=3)) AND_NOT Zbaz:(pos=2))" },
2170 : : // { "one +two three", "(Ztwo:(pos=2) AND_MAYBE (Zone:(pos=1) NEAR 11 Zthree:(pos=3)))" },
2171 : : { "foo bar", "(Zfoo:(pos=1) NEAR 11 Zbar:(pos=2))" },
2172 : : { "foo bar baz", "(Zfoo:(pos=1) NEAR 12 Zbar:(pos=2) NEAR 12 Zbaz:(pos=3))" },
2173 : : { "gtk+ -gnome", "(Zgtk+:(pos=1) AND_NOT Zgnome:(pos=2))" },
2174 : : { "c++ -d--", "(Zc++:(pos=1) AND_NOT Zd:(pos=2))" },
2175 : : { "\"c++ library\"", "(c++:(pos=1) PHRASE 2 library:(pos=2))" },
2176 : : { "author:orwell animal farm", "(ZAorwel:(pos=1) NEAR 12 Zanim:(pos=2) NEAR 12 Zfarm:(pos=3))" },
2177 : : { "author:Orwell Animal Farm", "(Aorwell:(pos=1) NEAR 12 animal:(pos=2) NEAR 12 farm:(pos=3))" },
2178 : : { "beer NOT \"orange juice\"", "(Zbeer:(pos=1) AND_NOT (orange:(pos=2) PHRASE 2 juice:(pos=3)))" },
2179 : : { "beer AND NOT lager", "(Zbeer:(pos=1) AND_NOT Zlager:(pos=2))" },
2180 : : { "A OR B NOT C", "(a:(pos=1) OR (b:(pos=2) AND_NOT c:(pos=3)))" },
2181 : : { "A OR B AND NOT C", "(a:(pos=1) OR (b:(pos=2) AND_NOT c:(pos=3)))" },
2182 : : { "A OR B XOR C", "(a:(pos=1) OR (b:(pos=2) XOR c:(pos=3)))" },
2183 : : { "A XOR B NOT C", "(a:(pos=1) XOR (b:(pos=2) AND_NOT c:(pos=3)))" },
2184 : : { "one AND two", "(Zone:(pos=1) AND Ztwo:(pos=2))" },
2185 : : { "NOT windows", "Syntax: <expression> NOT <expression>" },
2186 : : { "a AND (NOT b)", "Syntax: <expression> NOT <expression>" },
2187 : : { "AND NOT windows", "Syntax: <expression> AND NOT <expression>" },
2188 : : { "gordian NOT", "Syntax: <expression> NOT <expression>" },
2189 : : { "gordian AND NOT", "Syntax: <expression> AND NOT <expression>" },
2190 : : { "foo OR (something AND)", "Syntax: <expression> AND <expression>" },
2191 : : { "OR foo", "Syntax: <expression> OR <expression>" },
2192 : : { "XOR", "Syntax: <expression> XOR <expression>" },
2193 : : { "hard\xa0space", "(Zhard:(pos=1) NEAR 11 Zspace:(pos=2))" },
2194 : : { NULL, NULL }
2195 : : };
2196 : :
2197 : 1 : static bool test_qp_near1()
2198 : : {
2199 : 1 : Xapian::QueryParser queryparser;
2200 : 1 : queryparser.set_stemmer(Xapian::Stem("english"));
2201 : 1 : queryparser.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
2202 : 1 : queryparser.add_prefix("author", "A");
2203 : 1 : queryparser.add_prefix("writer", "A");
2204 : 1 : queryparser.add_prefix("title", "XT");
2205 : 1 : queryparser.add_prefix("subject", "XT");
2206 : 1 : queryparser.add_prefix("authortitle", "A");
2207 : 1 : queryparser.add_prefix("authortitle", "XT");
2208 : 1 : queryparser.add_boolean_prefix("site", "H");
2209 : 1 : queryparser.add_boolean_prefix("site2", "J");
2210 : 1 : queryparser.add_boolean_prefix("multisite", "H");
2211 : 1 : queryparser.add_boolean_prefix("multisite", "J");
2212 : 1 : queryparser.add_boolean_prefix("category", "XCAT", false);
2213 : 1 : queryparser.set_default_op(Xapian::Query::OP_NEAR);
2214 [ + + ]: 26 : for (const test *p = test_near_queries; p->query; ++p) {
2215 : 25 : string expect, parsed;
2216 [ + - ]: 25 : if (p->expect)
2217 : 25 : expect = p->expect;
2218 : : else
2219 : 0 : expect = "parse error";
2220 : : try {
2221 : 49 : Xapian::Query qobj = queryparser.parse_query(p->query);
2222 : 17 : parsed = qobj.get_description();
2223 : 17 : expect = string("Xapian::Query(") + expect + ')';
2224 : 16 : } catch (const Xapian::QueryParserError &e) {
2225 : 8 : parsed = e.get_msg();
2226 : 0 : } catch (const Xapian::Error &e) {
2227 : 0 : parsed = e.get_description();
2228 : 0 : } catch (...) {
2229 : 0 : parsed = "Unknown exception!";
2230 : : }
2231 : 25 : tout << "Query: " << p->query << '\n';
2232 [ - + # # ]: 25 : TEST_STRINGS_EQUAL(parsed, expect);
2233 : : }
2234 : 1 : return true;
2235 : : }
2236 : :
2237 : : static const test test_phrase_queries[] = {
2238 : : { "simple-example", "(simple:(pos=1) PHRASE 2 example:(pos=2))" },
2239 : : { "stock -cooking", "(Zstock:(pos=1) AND_NOT Zcook:(pos=2))" },
2240 : : // FIXME: these give PHRASE 2
2241 : : // { "foo -baz bar", "((Zfoo:(pos=1) PHRASE 11 Zbar:(pos=3)) AND_NOT Zbaz:(pos=2))" },
2242 : : // { "one +two three", "(Ztwo:(pos=2) AND_MAYBE (Zone:(pos=1) PHRASE 11 Zthree:(pos=3)))" },
2243 : : { "foo bar", "(Zfoo:(pos=1) PHRASE 11 Zbar:(pos=2))" },
2244 : : { "foo bar baz", "(Zfoo:(pos=1) PHRASE 12 Zbar:(pos=2) PHRASE 12 Zbaz:(pos=3))" },
2245 : : { "gtk+ -gnome", "(Zgtk+:(pos=1) AND_NOT Zgnome:(pos=2))" },
2246 : : { "c++ -d--", "(Zc++:(pos=1) AND_NOT Zd:(pos=2))" },
2247 : : { "\"c++ library\"", "(c++:(pos=1) PHRASE 2 library:(pos=2))" },
2248 : : { "author:orwell animal farm", "(ZAorwel:(pos=1) PHRASE 12 Zanim:(pos=2) PHRASE 12 Zfarm:(pos=3))" },
2249 : : { "author:Orwell Animal Farm", "(Aorwell:(pos=1) PHRASE 12 animal:(pos=2) PHRASE 12 farm:(pos=3))" },
2250 : : { "beer NOT \"orange juice\"", "(Zbeer:(pos=1) AND_NOT (orange:(pos=2) PHRASE 2 juice:(pos=3)))" },
2251 : : { "beer AND NOT lager", "(Zbeer:(pos=1) AND_NOT Zlager:(pos=2))" },
2252 : : { "A OR B NOT C", "(a:(pos=1) OR (b:(pos=2) AND_NOT c:(pos=3)))" },
2253 : : { "A OR B AND NOT C", "(a:(pos=1) OR (b:(pos=2) AND_NOT c:(pos=3)))" },
2254 : : { "A OR B XOR C", "(a:(pos=1) OR (b:(pos=2) XOR c:(pos=3)))" },
2255 : : { "A XOR B NOT C", "(a:(pos=1) XOR (b:(pos=2) AND_NOT c:(pos=3)))" },
2256 : : { "one AND two", "(Zone:(pos=1) AND Ztwo:(pos=2))" },
2257 : : { "NOT windows", "Syntax: <expression> NOT <expression>" },
2258 : : { "a AND (NOT b)", "Syntax: <expression> NOT <expression>" },
2259 : : { "AND NOT windows", "Syntax: <expression> AND NOT <expression>" },
2260 : : { "gordian NOT", "Syntax: <expression> NOT <expression>" },
2261 : : { "gordian AND NOT", "Syntax: <expression> AND NOT <expression>" },
2262 : : { "foo OR (something AND)", "Syntax: <expression> AND <expression>" },
2263 : : { "OR foo", "Syntax: <expression> OR <expression>" },
2264 : : { "XOR", "Syntax: <expression> XOR <expression>" },
2265 : : { "hard\xa0space", "(Zhard:(pos=1) PHRASE 11 Zspace:(pos=2))" },
2266 : : { "(one AND two) three", "((Zone:(pos=1) PHRASE 11 Zthree:(pos=3)) AND (Ztwo:(pos=2) PHRASE 11 Zthree:(pos=3)))" },
2267 : : { NULL, NULL }
2268 : : };
2269 : :
2270 : 1 : static bool test_qp_phrase1()
2271 : : {
2272 : 1 : Xapian::QueryParser queryparser;
2273 : 1 : queryparser.set_stemmer(Xapian::Stem("english"));
2274 : 1 : queryparser.set_stemming_strategy(Xapian::QueryParser::STEM_SOME);
2275 : 1 : queryparser.add_prefix("author", "A");
2276 : 1 : queryparser.add_prefix("writer", "A");
2277 : 1 : queryparser.add_prefix("title", "XT");
2278 : 1 : queryparser.add_prefix("subject", "XT");
2279 : 1 : queryparser.add_prefix("authortitle", "A");
2280 : 1 : queryparser.add_prefix("authortitle", "XT");
2281 : 1 : queryparser.add_boolean_prefix("site", "H");
2282 : 1 : queryparser.add_boolean_prefix("site2", "J");
2283 : 1 : queryparser.add_boolean_prefix("multisite", "H");
2284 : 1 : queryparser.add_boolean_prefix("multisite", "J");
2285 : 1 : queryparser.add_boolean_prefix("category", "XCAT", false);
2286 : 1 : queryparser.set_default_op(Xapian::Query::OP_PHRASE);
2287 [ + + ]: 27 : for (const test *p = test_phrase_queries; p->query; ++p) {
2288 : 26 : string expect, parsed;
2289 [ + - ]: 26 : if (p->expect)
2290 : 26 : expect = p->expect;
2291 : : else
2292 : 0 : expect = "parse error";
2293 : : try {
2294 : 50 : Xapian::Query qobj = queryparser.parse_query(p->query);
2295 : 18 : parsed = qobj.get_description();
2296 : 18 : expect = string("Xapian::Query(") + expect + ')';
2297 : 16 : } catch (const Xapian::QueryParserError &e) {
2298 : 8 : parsed = e.get_msg();
2299 : 0 : } catch (const Xapian::Error &e) {
2300 : 0 : parsed = e.get_description();
2301 : 0 : } catch (...) {
2302 : 0 : parsed = "Unknown exception!";
2303 : : }
2304 : 26 : tout << "Query: " << p->query << '\n';
2305 [ - + # # ]: 26 : TEST_STRINGS_EQUAL(parsed, expect);
2306 : : }
2307 : 1 : return true;
2308 : : }
2309 : :
2310 : : static const test test_stopword_group_or_queries[] = {
2311 : : { "this is a test", "test:(pos=4)" },
2312 : : { "test*", "(test:(pos=1) SYNONYM testable:(pos=1) SYNONYM tester:(pos=1))" },
2313 : : { "a test*", "(test:(pos=2) SYNONYM testable:(pos=2) SYNONYM tester:(pos=2))" },
2314 : : { "is a test*", "(test:(pos=3) SYNONYM testable:(pos=3) SYNONYM tester:(pos=3))" },
2315 : : { "this is a test*", "(test:(pos=4) SYNONYM testable:(pos=4) SYNONYM tester:(pos=4))" },
2316 : : { "this is a us* test*", "(user:(pos=4) OR (test:(pos=5) SYNONYM testable:(pos=5) SYNONYM tester:(pos=5)))" },
2317 : : { "this is a user test*", "(user:(pos=4) OR (test:(pos=5) SYNONYM testable:(pos=5) SYNONYM tester:(pos=5)))" },
2318 : : { NULL, NULL }
2319 : : };
2320 : :
2321 : : static const test test_stopword_group_and_queries[] = {
2322 : : { "this is a test", "test:(pos=4)" },
2323 : : { "test*", "(test:(pos=1) SYNONYM testable:(pos=1) SYNONYM tester:(pos=1))" },
2324 : : { "a test*", "(test:(pos=2) SYNONYM testable:(pos=2) SYNONYM tester:(pos=2))" },
2325 : : // Two stopwords + one wildcard failed in 1.0.16
2326 : : { "is a test*", "(test:(pos=3) SYNONYM testable:(pos=3) SYNONYM tester:(pos=3))" },
2327 : : // Three stopwords + one wildcard failed in 1.0.16
2328 : : { "this is a test*", "(test:(pos=4) SYNONYM testable:(pos=4) SYNONYM tester:(pos=4))" },
2329 : : // Three stopwords + two wildcards failed in 1.0.16
2330 : : { "this is a us* test*", "(user:(pos=4) AND (test:(pos=5) SYNONYM testable:(pos=5) SYNONYM tester:(pos=5)))" },
2331 : : { "this is a user test*", "(user:(pos=4) AND (test:(pos=5) SYNONYM testable:(pos=5) SYNONYM tester:(pos=5)))" },
2332 : : { NULL, NULL }
2333 : : };
2334 : :
2335 : : // Regression test for bug fixed in 1.0.17 and 1.1.3.
2336 : 1 : static bool test_qp_stopword_group1()
2337 : : {
2338 : : #ifndef XAPIAN_HAS_INMEMORY_BACKEND
2339 : : SKIP_TEST("Testcase requires the InMemory backend which is disabled");
2340 : : #else
2341 : 1 : Xapian::WritableDatabase db(Xapian::InMemory::open());
2342 : 1 : Xapian::Document doc;
2343 : 1 : doc.add_term("test");
2344 : 1 : doc.add_term("tester");
2345 : 1 : doc.add_term("testable");
2346 : 1 : doc.add_term("user");
2347 : 1 : db.add_document(doc);
2348 : :
2349 : 1 : Xapian::SimpleStopper stopper;
2350 : 1 : stopper.add("this");
2351 : 1 : stopper.add("is");
2352 : 1 : stopper.add("a");
2353 : :
2354 : 1 : Xapian::QueryParser qp;
2355 : 1 : qp.set_stopper(&stopper);
2356 : 1 : qp.set_database(db);
2357 : :
2358 : : // Process test cases with OP_OR first, then with OP_AND.
2359 : 1 : qp.set_default_op(Xapian::Query::OP_OR);
2360 : 1 : const test *p = test_stopword_group_or_queries;
2361 [ + + ]: 3 : for (int i = 1; i <= 2; ++i) {
2362 [ + + ]: 16 : for ( ; p->query; ++p) {
2363 : 14 : string expect, parsed;
2364 [ + - ]: 14 : if (p->expect)
2365 : 14 : expect = p->expect;
2366 : : else
2367 : 0 : expect = "parse error";
2368 : : try {
2369 : 14 : Xapian::Query qobj = qp.parse_query(p->query, qp.FLAG_WILDCARD);
2370 : 14 : parsed = qobj.get_description();
2371 : 14 : expect = string("Xapian::Query(") + expect + ')';
2372 : 0 : } catch (const Xapian::QueryParserError &e) {
2373 : 0 : parsed = e.get_msg();
2374 : 0 : } catch (const Xapian::Error &e) {
2375 : 0 : parsed = e.get_description();
2376 : 0 : } catch (...) {
2377 : 0 : parsed = "Unknown exception!";
2378 : : }
2379 : 14 : tout << "Query: " << p->query << '\n';
2380 [ - + # # ]: 14 : TEST_STRINGS_EQUAL(parsed, expect);
2381 : : }
2382 : :
2383 : 2 : qp.set_default_op(Xapian::Query::OP_AND);
2384 : 2 : p = test_stopword_group_and_queries;
2385 : : }
2386 : :
2387 : 1 : return true;
2388 : : #endif
2389 : : }
2390 : :
2391 : : /// Regression test for bug with default_op set such that we get an exception.
2392 : : // Fixed in 1.0.23 and 1.2.4.
2393 : 1 : static bool test_qp_default_op2()
2394 : : {
2395 : 1 : Xapian::QueryParser qp;
2396 : : static const Xapian::Query::op ops[] = {
2397 : : Xapian::Query::OP_AND_NOT,
2398 : : Xapian::Query::OP_AND_MAYBE,
2399 : : Xapian::Query::OP_FILTER,
2400 : : Xapian::Query::OP_VALUE_RANGE,
2401 : : Xapian::Query::OP_SCALE_WEIGHT,
2402 : : Xapian::Query::OP_VALUE_GE,
2403 : : Xapian::Query::OP_VALUE_LE
2404 : : };
2405 : : const Xapian::Query::op * p;
2406 [ + + ]: 8 : for (p = ops; p - ops != sizeof(ops) / sizeof(*ops); ++p) {
2407 : 7 : tout << *p << endl;
2408 : 7 : qp.set_default_op(*p);
2409 : : // Before the fix, we tried to free an object twice when parsing the
2410 : : // following query with default_op set such that we get an exception.
2411 [ + - ][ - + ]: 35 : TEST_EXCEPTION(Xapian::InvalidArgumentError,
[ # # ][ - + ]
2412 : : qp.parse_query("a-b NEAR c NEAR d"));
2413 : : }
2414 : 1 : return true;
2415 : : }
2416 : :
2417 : : /// Test cases for the QueryParser.
2418 : : static const test_desc tests[] = {
2419 : : TESTCASE(queryparser1),
2420 : : TESTCASE(qp_default_op1),
2421 : : TESTCASE(qp_odd_chars1),
2422 : : TESTCASE(qp_flag_wildcard1),
2423 : : TESTCASE(qp_flag_wildcard2),
2424 : : TESTCASE(qp_flag_partial1),
2425 : : TESTCASE(qp_flag_bool_any_case1),
2426 : : TESTCASE(qp_stopper1),
2427 : : TESTCASE(qp_flag_pure_not1),
2428 : : TESTCASE(qp_unstem_boolean_prefix),
2429 : : TESTCASE(qp_default_prefix1),
2430 : : TESTCASE(qp_default_prefix2),
2431 : : TESTCASE(value_range_serialise1),
2432 : : TESTCASE(qp_value_range1),
2433 : : TESTCASE(qp_value_range2),
2434 : : TESTCASE(qp_value_range3),
2435 : : TESTCASE(qp_value_range4),
2436 : : TESTCASE(qp_value_daterange1),
2437 : : TESTCASE(qp_value_daterange2),
2438 : : TESTCASE(qp_value_stringrange1),
2439 : : TESTCASE(qp_value_customrange1),
2440 : : TESTCASE(qp_stoplist1),
2441 : : TESTCASE(qp_spell1),
2442 : : TESTCASE(qp_spell2),
2443 : : TESTCASE(qp_spellwild1),
2444 : : TESTCASE(qp_spellpartial1),
2445 : : TESTCASE(qp_synonym1),
2446 : : TESTCASE(qp_synonym2),
2447 : : TESTCASE(qp_synonym3),
2448 : : TESTCASE(qp_stem_all1),
2449 : : TESTCASE(qp_scale1),
2450 : : TESTCASE(qp_near1),
2451 : : TESTCASE(qp_phrase1),
2452 : : TESTCASE(qp_stopword_group1),
2453 : : TESTCASE(qp_default_op2),
2454 : : END_OF_TESTCASES
2455 : : };
2456 : :
2457 : 1 : int main(int argc, char **argv)
2458 : : try {
2459 : 1 : test_driver::parse_command_line(argc, argv);
2460 : 1 : return test_driver::run(tests);
2461 : 1 : } catch (const char * e) {
2462 : 0 : cout << e << endl;
2463 : 0 : return 1;
2464 [ + - ][ + - ]: 3 : }
|