unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 9316c544692593a9579f2dc0c6d5d7dc8c2e7a43 2753 bytes (raw)
name: test/qparser.expected-output/terms 	 # note: path name is non-authoritative(*)

  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
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
 
# Term lexing

x y z
[lex]    "x" "y" "z"
[parse]  (AND (AND "x" "y") "z")
[gen]    (x:(pos=1) AND y:(pos=2) AND z:(pos=3))

x"y z"w
[lex]    "x" "y z" "w"
[parse]  (AND (AND "x" "y z") "w")
[gen]    (x:(pos=1) AND (y:(pos=2) PHRASE 2 z:(pos=3)) AND w:(pos=4))

x(y z)w
[lex]    "x" BRA "y" "z" KET "w"
[parse]  (AND (AND "x" (AND "y" "z")) "w")
[gen]    (x:(pos=1) AND y:(pos=2) AND z:(pos=3) AND w:(pos=4))

# The first query below is Xapian-compatible, while the second one
# isn't.  We use much simpler term lexing rules than Xapian.
x/y
[lex]    "x/y"
[parse]  "x/y"
[gen]    (x:(pos=1) PHRASE 2 y:(pos=2))

x!y
[lex]    "x!y"
[parse]  "x!y"
[gen]    (x:(pos=1) PHRASE 2 y:(pos=2))
[xapian] (x:(pos=1) AND y:(pos=2))

# Incompatible; our simpler term parsing sees ! as a term
x -! y
[lex]    "x" HATE "!" "y"
[parse]  (AND (AND "x" "y") (NOT "!"))
[gen]    (x:(pos=1) AND y:(pos=2))
[xapian] (x:(pos=1) AND_NOT y:(pos=2))

# Term parsing

x -
[lex]    "x" HATE
[parse]  "x"
[gen]    x:(pos=1)

x +
[lex]    "x" LOVE
[parse]  "x"
[gen]    x:(pos=1)

(x)
[lex]    BRA "x" KET
[parse]  "x"
[gen]    x:(pos=1)

# Prefixed operators get demoted to terms
prob:AND
[lex]    PREFIX/prob AND
[parse]  (PREFIX/prob "AND")
[gen]    Pand:(pos=1)

# The first query below is Xapian-compatible, but the second isn't
# because Xapian handles hate very differently from love.
+AND
[lex]    LOVE AND
[parse]  "AND"
[gen]    and:(pos=1)

-AND
[lex]    HATE AND
[parse]  (NOT "AND")
[gen]    (<alldocuments> AND_NOT and:(pos=1))
[xapian] and:(pos=1)

# Incompatible; Xapian sees this as prob:"prob:x"
prob:prob:x
[lex]    PREFIX/prob PREFIX/prob "x"
[parse]  (PREFIX/prob "x")
[gen]    Px:(pos=1)
[xapian] (Pprob:(pos=1) PHRASE 2 Px:(pos=2))

# The rest are Xapian-incompatible because they're all considered
# syntax errors
(
[lex]    BRA
[parse]  <nil>
[gen]    <alldocuments>
[xapian] 

()
[lex]    BRA KET
[parse]  <nil>
[gen]    <alldocuments>
[xapian] 

)
[lex]    KET
[parse]  <nil>
[gen]    <alldocuments>
[xapian] 

(x)) OR y
[lex]    BRA "x" KET KET OR "y"
[parse]  (OR "x" "y")
[gen]    (x:(pos=1) OR y:(pos=2))
[xapian] (x:(pos=1) AND or:(pos=2) AND y:(pos=3))

# This one's only Xapian-compatible by chance.
(x))
[lex]    BRA "x" KET KET
[parse]  "x"
[gen]    x:(pos=1)

# Term generating

c++ x
[lex]    "c++" "x"
[parse]  (AND "c++" "x")
[gen]    (c++:(pos=1) AND x:(pos=2))

# Incompatible; + is not a "phrase generator" in Xapian.
c+x
[lex]    "c+x"
[parse]  "c+x"
[gen]    (c:(pos=1) PHRASE 2 x:(pos=2))
[xapian] (c:(pos=1) AND x:(pos=2))

c-x
[lex]    "c-x"
[parse]  "c-x"
[gen]    (c:(pos=1) PHRASE 2 x:(pos=2))

w "x y z"
[lex]    "w" "x y z"
[parse]  (AND "w" "x y z")
[gen]    (w:(pos=1) AND (x:(pos=2) PHRASE 3 y:(pos=3) PHRASE 3 z:(pos=4)))


debug log:

solving 9316c54 ...
found 9316c54 in https://yhetil.org/notmuch/20110121063714.GI13226@mit.edu/

applying [1/1] https://yhetil.org/notmuch/20110121063714.GI13226@mit.edu/
diff --git a/test/qparser.expected-output/terms b/test/qparser.expected-output/terms
new file mode 100644
index 0000000..9316c54

1:93: trailing whitespace.
[xapian] 
1:99: trailing whitespace.
[xapian] 
1:105: trailing whitespace.
[xapian] 
Checking patch test/qparser.expected-output/terms...
1:142: new blank line at EOF.
+
Applied patch test/qparser.expected-output/terms cleanly.
warning: 4 lines add whitespace errors.

index at:
100644 9316c544692593a9579f2dc0c6d5d7dc8c2e7a43	test/qparser.expected-output/terms

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).