]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/db/query/housenumbers.feature
add new analyser for houenumbers
[nominatim.git] / test / bdd / db / query / housenumbers.feature
1 @DB
2 Feature: Searching of house numbers
3     Test for specialised treeatment of housenumbers
4
5     Background:
6         Given the grid
7          | 1 |   | 2 |   | 3 |
8          |   | 9 |   |   |   |
9          |   |   |   |   | 4 |
10
11
12     Scenario: A simple ascii digit housenumber is found
13         Given the places
14          | osm | class    | type | housenr  | geometry |
15          | N1  | building | yes  | 45       | 9        |
16         And the places
17          | osm | class   | type | name       | geometry |
18          | W10 | highway | path | North Road | 1,2,3    |
19         When importing
20         And sending search query "45, North Road"
21         Then results contain
22          | osm |
23          | N1  |
24         When sending search query "North Road 45"
25         Then results contain
26          | osm |
27          | N1  |
28
29
30     Scenario Outline: Numeral housenumbers in any script are found
31         Given the places
32          | osm | class    | type | housenr  | geometry |
33          | N1  | building | yes  | <number> | 9        |
34         And the places
35          | osm | class   | type | name       | geometry |
36          | W10 | highway | path | North Road | 1,2,3    |
37         When importing
38         And sending search query "45, North Road"
39         Then results contain
40          | osm |
41          | N1  |
42         When sending search query "North Road ④⑤"
43         Then results contain
44          | osm |
45          | N1  |
46         When sending search query "North Road 𑁪𑁫"
47         Then results contain
48          | osm |
49          | N1  |
50
51     Examples:
52         | number |
53         | 45     |
54         | ④⑤     |
55         | 𑁪𑁫     |
56
57
58     Scenario Outline: Each housenumber in a list is found
59         Given the places
60          | osm | class    | type | housenr | geometry |
61          | N1  | building | yes  | <hnrs>  | 9        |
62         And the places
63          | osm | class   | type | name     | geometry |
64          | W10 | highway | path | Multistr | 1,2,3    |
65         When importing
66         When sending search query "2 Multistr"
67         Then results contain
68          | osm |
69          | N1  |
70         When sending search query "4 Multistr"
71         Then results contain
72          | osm |
73          | N1  |
74         When sending search query "12 Multistr"
75         Then results contain
76          | osm |
77          | N1  |
78
79      Examples:
80         | hnrs |
81         | 2;4;12 |
82         | 2,4,12 |
83         | 2, 4, 12 |
84
85
86     Scenario Outline: Housenumber - letter combinations are found
87         Given the places
88          | osm | class    | type | housenr | geometry |
89          | N1  | building | yes  | <hnr>   | 9        |
90         And the places
91          | osm | class   | type | name     | geometry |
92          | W10 | highway | path | Multistr | 1,2,3    |
93         When importing
94         When sending search query "2A Multistr"
95         Then results contain
96          | osm |
97          | N1  |
98         When sending search query "2 a Multistr"
99         Then results contain
100          | osm |
101          | N1  |
102         When sending search query "2-A Multistr"
103         Then results contain
104          | osm |
105          | N1  |
106         When sending search query "Multistr 2 A"
107         Then results contain
108          | osm |
109          | N1  |
110
111     Examples:
112         | hnr |
113         | 2a  |
114         | 2 A |
115         | 2-a |
116         | 2/A |
117
118
119     Scenario Outline: Number - Number combinations as a housenumber are found
120         Given the places
121          | osm | class    | type | housenr | geometry |
122          | N1  | building | yes  | <hnr>   | 9        |
123         And the places
124          | osm | class   | type | name       | geometry |
125          | W10 | highway | path | Chester St | 1,2,3    |
126         When importing
127         When sending search query "34-10 Chester St"
128         Then results contain
129          | osm |
130          | N1  |
131         When sending search query "34/10 Chester St"
132         Then results contain
133          | osm |
134          | N1  |
135         When sending search query "34 10 Chester St"
136         Then results contain
137          | osm |
138          | N1  |
139         When sending search query "3410 Chester St"
140         Then results contain
141          | osm |
142          | W10 |
143
144     Examples:
145         | hnr   |
146         | 34-10 |
147         | 34 10 |
148         | 34/10 |
149
150
151     Scenario Outline: a bis housenumber is found
152         Given the places
153          | osm | class    | type | housenr | geometry |
154          | N1  | building | yes  | <hnr>   | 9        |
155         And the places
156          | osm | class   | type | name       | geometry |
157          | W10 | highway | path | Rue Paris | 1,2,3    |
158         When importing
159         When sending search query "Rue Paris 45bis"
160         Then results contain
161          | osm |
162          | N1  |
163         When sending search query "Rue Paris 45 BIS"
164         Then results contain
165          | osm |
166          | N1  |
167         When sending search query "Rue Paris 45BIS"
168         Then results contain
169          | osm |
170          | N1  |
171         When sending search query "Rue Paris 45 bis"
172         Then results contain
173          | osm |
174          | N1  |
175
176     Examples:
177         | hnr   |
178         | 45bis |
179         | 45BIS |
180         | 45 BIS |
181         | 45 bis |
182
183     Scenario Outline: a ter housenumber is found
184         Given the places
185          | osm | class    | type | housenr | geometry |
186          | N1  | building | yes  | <hnr>   | 9        |
187         And the places
188          | osm | class   | type | name       | geometry |
189          | W10 | highway | path | Rue du Berger | 1,2,3    |
190         When importing
191         When sending search query "Rue du Berger 45ter"
192         Then results contain
193          | osm |
194          | N1  |
195         When sending search query "Rue du Berger 45 TER"
196         Then results contain
197          | osm |
198          | N1  |
199         When sending search query "Rue du Berger 45TER"
200         Then results contain
201          | osm |
202          | N1  |
203         When sending search query "Rue du Berger 45 ter"
204         Then results contain
205          | osm |
206          | N1  |
207
208     Examples:
209         | hnr   |
210         | 45ter |
211         | 45TER |
212         | 45 ter |
213         | 45 TER |
214
215
216     Scenario Outline: a number - letter - number combination housenumber is found
217         Given the places
218          | osm | class    | type | housenr | geometry |
219          | N1  | building | yes  | <hnr>   | 9        |
220         And the places
221          | osm | class   | type | name       | geometry |
222          | W10 | highway | path | Herengracht | 1,2,3    |
223         When importing
224         When sending search query "501-H 1 Herengracht"
225         Then results contain
226          | osm |
227          | N1  |
228         When sending search query "501H-1 Herengracht"
229         Then results contain
230          | osm |
231          | N1  |
232         When sending search query "501H1 Herengracht"
233         Then results contain
234          | osm |
235          | N1  |
236         When sending search query "501-H1 Herengracht"
237         Then results contain
238          | osm |
239          | N1  |
240
241     Examples:
242         | hnr |
243         | 501 H1 |
244         | 501H 1 |
245         | 501/H/1 |
246         | 501h1 |
247
248
249     Scenario Outline: Russian housenumbers are found
250         Given the places
251          | osm | class    | type | housenr | geometry |
252          | N1  | building | yes  | <hnr>   | 9        |
253         And the places
254          | osm | class   | type | name       | geometry |
255          | W10 | highway | path | Голубинская улица | 1,2,3    |
256         When importing
257         When sending search query "Голубинская улица 55к3"
258         Then results contain
259          | osm |
260          | N1  |
261         When sending search query "Голубинская улица 55 k3"
262         Then results contain
263          | osm |
264          | N1  |
265         When sending search query "Голубинская улица 55 к-3"
266         Then results contain
267          | osm |
268          | N1  |
269
270     Examples:
271         | hnr |
272         | 55к3 |
273         | 55 к3 |
274
275
276     Scenario: A name mapped as a housenumber is found
277         Given the places
278          | osm | class    | type | housenr | geometry |
279          | N1  | building | yes  | Warring | 9        |
280         And the places
281          | osm | class   | type | name       | geometry |
282          | W10 | highway | path | Chester St | 1,2,3    |
283         When importing
284         When sending search query "Chester St Warring"
285         Then results contain
286          | osm |
287          | N1  |
288
289
290     Scenario: Interpolations are found according to their type
291         Given the grid
292          | 10  |  | 11  |
293          | 100 |  | 101 |
294          | 20  |  | 21  |
295         And the places
296          | osm  | class   | type        | name    | geometry |
297          | W100 | highway | residential | Ringstr | 100, 101 |
298         And the places
299          | osm | class | type   | addr+interpolation | geometry |
300          | W10 | place | houses | even               | 10, 11   |
301          | W20 | place | houses | odd                | 20, 21   |
302         And the places
303          | osm | class | type  | housenr | geometry |
304          | N10 | place | house | 10      | 10 |
305          | N11 | place | house | 20      | 11 |
306          | N20 | place | house | 11      | 20 |
307          | N21 | place | house | 21      | 21 |
308         And the ways
309          | id | nodes |
310          | 10 | 10, 11 |
311          | 20 | 20, 21 |
312         When importing
313         When sending search query "Ringstr 12"
314         Then results contain
315          | osm |
316          | W10 |
317         When sending search query "Ringstr 13"
318         Then results contain
319          | osm |
320          | W20 |