]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/db/query/normalization.feature
release 5.1.0.post5
[nominatim.git] / test / bdd / features / db / query / normalization.feature
1 Feature: Import and search of names
2     Tests all naming related issues: normalisation,
3     abbreviations, internationalisation, etc.
4
5     Scenario: non-latin scripts can be found
6         Given the places
7           | osm | class | type      | name |
8           | N1  | place | locality  | Речицкий район |
9           | N2  | place | locality  | Refugio de montaña |
10           | N3  | place | locality  | 高槻市|
11           | N4  | place | locality  | الدوحة |
12         When importing
13         When geocoding "Речицкий район"
14         Then result 0 contains
15          | object |
16          | N1 |
17         When geocoding "Refugio de montaña"
18         Then result 0 contains
19          | object |
20          | N2 |
21         When geocoding "高槻市"
22         Then result 0 contains
23          | object |
24          | N3 |
25         When geocoding "الدوحة"
26         Then result 0 contains
27          | object |
28          | N4 |
29
30     Scenario: Case-insensitivity of search
31         Given the places
32           | osm | class | type      | name |
33           | N1  | place | locality  | FooBar |
34         When importing
35         Then placex contains
36           | object | class  | type     | name+name |
37           | N1     | place  | locality | FooBar |
38         When geocoding "FooBar"
39         Then result 0 contains
40          | object |
41          | N1 |
42         When geocoding "foobar"
43         Then result 0 contains
44          | object |
45          | N1 |
46         When geocoding "fOObar"
47         Then result 0 contains
48          | object |
49          | N1 |
50         When geocoding "FOOBAR"
51         Then result 0 contains
52          | object |
53          | N1 |
54
55     Scenario: Multiple spaces in name
56         Given the places
57           | osm | class | type      | name |
58           | N1  | place | locality  | one two  three |
59         When importing
60         When geocoding "one two three"
61         Then result 0 contains
62          | object |
63          | N1 |
64         When geocoding "one   two three"
65         Then result 0 contains
66          | object |
67          | N1 |
68         When geocoding "one two  three"
69         Then result 0 contains
70          | object |
71          | N1 |
72         When geocoding "    one two three"
73         Then result 0 contains
74          | object |
75          | N1 |
76
77     Scenario: Special characters in name
78         Given the places
79           | osm | class | type      | name+name:de |
80           | N1  | place | locality  | Jim-Knopf-Straße |
81           | N2  | place | locality  | Smith/Weston |
82           | N3  | place | locality  | space mountain |
83           | N4  | place | locality  | space |
84           | N5  | place | locality  | mountain |
85         When importing
86         When geocoding "Jim-Knopf-Str"
87         Then result 0 contains
88          | object |
89          | N1 |
90         When geocoding "Jim Knopf-Str"
91         Then result 0 contains
92          | object |
93          | N1 |
94         When geocoding "Jim Knopf Str"
95         Then result 0 contains
96          | object |
97          | N1 |
98         When geocoding "Jim/Knopf-Str"
99         Then result 0 contains
100          | object |
101          | N1 |
102         When geocoding "Jim-Knopfstr"
103         Then result 0 contains
104          | object |
105          | N1 |
106         When geocoding "Smith/Weston"
107         Then result 0 contains
108          | object |
109          | N2 |
110         When geocoding "Smith Weston"
111         Then result 0 contains
112          | object |
113          | N2 |
114         When geocoding "Smith-Weston"
115         Then result 0 contains
116          | object |
117          | N2 |
118         When geocoding "space mountain"
119         Then result 0 contains
120          | object |
121          | N3 |
122         When geocoding "space-mountain"
123         Then result 0 contains
124          | object |
125          | N3 |
126         When geocoding "space/mountain"
127         Then result 0 contains
128          | object |
129          | N3 |
130         When geocoding "space\mountain"
131         Then result 0 contains
132          | object |
133          | N3 |
134         When geocoding "space(mountain)"
135         Then result 0 contains
136          | object |
137          | N3 |
138
139     Scenario: Landuse with name are found
140         Given the grid
141           | 1 | 2 |
142           | 3 |   |
143         Given the places
144           | osm | class    | type        | name     | geometry |
145           | R1  | natural  | meadow      | landuse1 | (1,2,3,1) |
146           | R2  | landuse  | industrial  | landuse2 | (2,3,1,2) |
147         When importing
148         When geocoding "landuse1"
149         Then result 0 contains
150          | object |
151          | R1 |
152         When geocoding "landuse2"
153         Then result 0 contains
154          | object |
155          | R2 |
156
157     Scenario: Postcode boundaries without ref
158         Given the grid with origin FR
159           |   | 2 |   |
160           | 1 |   | 3 |
161         Given the places
162           | osm | class    | type        | postcode  | geometry |
163           | R1  | boundary | postal_code | 123-45    | (1,2,3,1) |
164         When importing
165         When geocoding "123-45"
166         Then result 0 contains
167          | object |
168          | R1 |
169
170     Scenario Outline: Housenumbers with special characters are found
171         Given the grid
172             | 1 |  |   |  | 2 |
173             |   |  | 9 |  |   |
174         And the places
175             | osm | class   | type    | name    | geometry |
176             | W1  | highway | primary | Main St | 1,2      |
177         And the places
178             | osm | class    | type | housenr | geometry |
179             | N1  | building | yes  | <nr>    | 9        |
180         When importing
181         And geocoding "Main St <nr>"
182         Then result 0 contains
183          | object | display_name |
184          | N1     | <nr>, Main St |
185
186     Examples:
187         | nr |
188         | 1  |
189         | 3456 |
190         | 1 a |
191         | 56b |
192         | 1 A |
193         | 2號 |
194         | 1Б  |
195         | 1 к1 |
196         | 23-123 |
197
198     Scenario Outline: Housenumbers in lists are found
199         Given the grid
200             | 1 |  |   |  | 2 |
201             |   |  | 9 |  |   |
202         And the places
203             | osm | class   | type    | name    | geometry |
204             | W1  | highway | primary | Main St | 1,2      |
205         And the places
206             | osm | class    | type | housenr   | geometry |
207             | N1  | building | yes  | <nr-list> | 9        |
208         When importing
209         And geocoding "Main St <nr>"
210         Then result 0 contains
211          | object | display_name |
212          | N1     | <nr-list>, Main St |
213
214     Examples:
215         | nr-list    | nr |
216         | 1,2,3      | 1  |
217         | 1,2,3      | 2  |
218         | 1, 2, 3    | 3  |
219         | 45 ;67;3   | 45 |
220         | 45 ;67;3   | 67 |
221         | 1a;1k      | 1a |
222         | 1a;1k      | 1k |
223         | 34/678     | 34 |
224         | 34/678     | 678 |
225         | 34/678     | 34/678 |