Download this file

langparser1.sh    54 lines (47 with data), 1.2 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/sh
# langparser actually test queries. We only test the language parser, the tested reference is the Xapian query.
topdir=`dirname $0`/..
. $topdir/shared.sh
initvariables $0
xrun()
{
echo $*
$*
}
(
for Q in \
'A' \
'A B' \
'A AND B' \
'A OR B' \
'A OR B AND C' \
'A AND B OR C' \
'(A AND B) OR (C AND D)' \
'(A OR B) AND (C OR D)' \
'-the B' \
'A -B' \
'mime:text/plain' \
'size>10k' \
'date:3000-01-01' \
'mime:text/plain A OR B mime:text/html' \
'mime:text/plain A AND B mime:text/html' \
'mime:text/plain mime:text/html (A B) ' \
'mime:text/plain OR mime:text/html OR (A B) ' \
'rclcat:media A' \
'rclcat:media rclcat:message A' \
'A size>10k' \
'size>10k A' \
'date:3000-01-01 A' \
'A OR B date:3000-01-01' \
'A OR B AND date:3000-01-01' \
'title:A B' \
'title:A -B' \
'A -title:B' \
; do
# The " $Q" is there to avoid issue with a query beginning with -
# (recollq does not grok --)
printf "%60s" "Query: $Q -> ";recollq -Q -q " $Q"
done
) 2> $mystderr | egrep -v 'results|^Query setup took' > $mystdout
diff -w ${myname}.txt $mystdout > $mydiffs 2>&1
checkresult