]> git.openstreetmap.org Git - nominatim.git/blob - test/bdd/features/db/query/normalization.feature
release 5.2.0.post7
[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 Outline: Housenumbers with special characters are found
158         Given the grid
159             | 1 |  |   |  | 2 |
160             |   |  | 9 |  |   |
161         And the places
162             | osm | class   | type    | name    | geometry |
163             | W1  | highway | primary | Main St | 1,2      |
164         And the places
165             | osm | class    | type | housenr | geometry |
166             | N1  | building | yes  | <nr>    | 9        |
167         When importing
168         And geocoding "Main St <nr>"
169         Then result 0 contains
170          | object | display_name |
171          | N1     | <nr>, Main St |
172
173     Examples:
174         | nr |
175         | 1  |
176         | 3456 |
177         | 1 a |
178         | 56b |
179         | 1 A |
180         | 2號 |
181         | 1Б  |
182         | 1 к1 |
183         | 23-123 |
184
185     Scenario Outline: Housenumbers in lists are found
186         Given the grid
187             | 1 |  |   |  | 2 |
188             |   |  | 9 |  |   |
189         And the places
190             | osm | class   | type    | name    | geometry |
191             | W1  | highway | primary | Main St | 1,2      |
192         And the places
193             | osm | class    | type | housenr   | geometry |
194             | N1  | building | yes  | <nr-list> | 9        |
195         When importing
196         And geocoding "Main St <nr>"
197         Then result 0 contains
198          | object | display_name |
199          | N1     | <nr-list>, Main St |
200
201     Examples:
202         | nr-list    | nr |
203         | 1,2,3      | 1  |
204         | 1,2,3      | 2  |
205         | 1, 2, 3    | 3  |
206         | 45 ;67;3   | 45 |
207         | 45 ;67;3   | 67 |
208         | 1a;1k      | 1a |
209         | 1a;1k      | 1k |
210         | 34/678     | 34 |
211         | 34/678     | 678 |
212         | 34/678     | 34/678 |