]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/bdd/db/query/housenumbers.feature
Merge pull request #3517 from lonvia/improve-custom-formatter
[nominatim.git] / test / bdd / db / query / housenumbers.feature
index bbb43f179e1477bcc8dde45e6cd91136c4941a27..106bc8bb2cd0c1db653c22a03d2b2064aa9916c2 100644 (file)
@@ -9,10 +9,10 @@ Feature: Searching of house numbers
          |   |   |   |   | 4 |
 
 
-    Scenario: A simple numeral housenumber is found
+    Scenario: A simple ascii digit housenumber is found
         Given the places
-         | osm | class    | type | housenr | geometry |
-         | N1  | building | yes  | 45      | 9        |
+         | osm | class    | type | housenr  | geometry |
+         | N1  | building | yes  | 45       | 9        |
         And the places
          | osm | class   | type | name       | geometry |
          | W10 | highway | path | North Road | 1,2,3    |
@@ -27,6 +27,35 @@ Feature: Searching of house numbers
          | N1  |
 
 
+    @fail-legacy
+    Scenario Outline: Numeral housenumbers in any script are found
+        Given the places
+         | osm | class    | type | housenr  | geometry |
+         | N1  | building | yes  | <number> | 9        |
+        And the places
+         | osm | class   | type | name       | geometry |
+         | W10 | highway | path | North Road | 1,2,3    |
+        When importing
+        And sending search query "45, North Road"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "North Road ④⑤"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "North Road 𑁪𑁫"
+        Then results contain
+         | osm |
+         | N1  |
+
+    Examples:
+        | number |
+        | 45     |
+        | ④⑤     |
+        | 𑁪𑁫     |
+
+
     Scenario Outline: Each housenumber in a list is found
         Given the places
          | osm | class    | type | housenr | geometry |
@@ -55,6 +84,202 @@ Feature: Searching of house numbers
         | 2, 4, 12 |
 
 
+    @fail-legacy
+    Scenario Outline: Housenumber - letter combinations are found
+        Given the places
+         | osm | class    | type | housenr | geometry |
+         | N1  | building | yes  | <hnr>   | 9        |
+        And the places
+         | osm | class   | type | name     | geometry |
+         | W10 | highway | path | Multistr | 1,2,3    |
+        When importing
+        When sending search query "2A Multistr"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "2 a Multistr"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "2-A Multistr"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "Multistr 2 A"
+        Then results contain
+         | osm |
+         | N1  |
+
+    Examples:
+        | hnr |
+        | 2a  |
+        | 2 A |
+        | 2-a |
+        | 2/A |
+
+
+    Scenario Outline: Number - Number combinations as a housenumber are found
+        Given the places
+         | osm | class    | type | housenr | geometry |
+         | N1  | building | yes  | <hnr>   | 9        |
+        And the places
+         | osm | class   | type | name       | geometry |
+         | W10 | highway | path | Chester St | 1,2,3    |
+        When importing
+        When sending search query "34-10 Chester St"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "34/10 Chester St"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "34 10 Chester St"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "3410 Chester St"
+        Then results contain
+         | osm |
+         | W10 |
+
+    Examples:
+        | hnr   |
+        | 34-10 |
+        | 34 10 |
+        | 34/10 |
+
+
+    @fail-legacy
+    Scenario Outline: a bis housenumber is found
+        Given the places
+         | osm | class    | type | housenr | geometry |
+         | N1  | building | yes  | <hnr>   | 9        |
+        And the places
+         | osm | class   | type | name       | geometry |
+         | W10 | highway | path | Rue Paris | 1,2,3    |
+        When importing
+        When sending search query "Rue Paris 45bis"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "Rue Paris 45 BIS"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "Rue Paris 45BIS"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "Rue Paris 45 bis"
+        Then results contain
+         | osm |
+         | N1  |
+
+    Examples:
+        | hnr   |
+        | 45bis |
+        | 45BIS |
+        | 45 BIS |
+        | 45 bis |
+
+
+    @fail-legacy
+    Scenario Outline: a ter housenumber is found
+        Given the places
+         | osm | class    | type | housenr | geometry |
+         | N1  | building | yes  | <hnr>   | 9        |
+        And the places
+         | osm | class   | type | name       | geometry |
+         | W10 | highway | path | Rue du Berger | 1,2,3    |
+        When importing
+        When sending search query "Rue du Berger 45ter"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "Rue du Berger 45 TER"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "Rue du Berger 45TER"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "Rue du Berger 45 ter"
+        Then results contain
+         | osm |
+         | N1  |
+
+    Examples:
+        | hnr   |
+        | 45ter |
+        | 45TER |
+        | 45 ter |
+        | 45 TER |
+
+
+    @fail-legacy
+    Scenario Outline: a number - letter - number combination housenumber is found
+        Given the places
+         | osm | class    | type | housenr | geometry |
+         | N1  | building | yes  | <hnr>   | 9        |
+        And the places
+         | osm | class   | type | name       | geometry |
+         | W10 | highway | path | Herengracht | 1,2,3    |
+        When importing
+        When sending search query "501-H 1 Herengracht"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "501H-1 Herengracht"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "501H1 Herengracht"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "501-H1 Herengracht"
+        Then results contain
+         | osm |
+         | N1  |
+
+    Examples:
+        | hnr |
+        | 501 H1 |
+        | 501H 1 |
+        | 501/H/1 |
+        | 501h1 |
+
+
+    @fail-legacy
+    Scenario Outline: Russian housenumbers are found
+        Given the places
+         | osm | class    | type | housenr | geometry |
+         | N1  | building | yes  | <hnr>   | 9        |
+        And the places
+         | osm | class   | type | name       | geometry |
+         | W10 | highway | path | Голубинская улица | 1,2,3    |
+        When importing
+        When sending search query "Голубинская улица 55к3"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "Голубинская улица 55 k3"
+        Then results contain
+         | osm |
+         | N1  |
+        When sending search query "Голубинская улица 55 к-3"
+        Then results contain
+         | osm |
+         | N1  |
+
+    Examples:
+        | hnr |
+        | 55к3 |
+        | 55 к3 |
+
+
     Scenario: A name mapped as a housenumber is found
         Given the places
          | osm | class    | type | housenr | geometry |
@@ -67,3 +292,36 @@ Feature: Searching of house numbers
         Then results contain
          | osm |
          | N1  |
+
+
+    Scenario: Interpolations are found according to their type
+        Given the grid
+         | 10  |  | 11  |
+         | 100 |  | 101 |
+         | 20  |  | 21  |
+        And the places
+         | osm  | class   | type        | name    | geometry |
+         | W100 | highway | residential | Ringstr | 100, 101 |
+        And the places
+         | osm | class | type   | addr+interpolation | geometry |
+         | W10 | place | houses | even               | 10, 11   |
+         | W20 | place | houses | odd                | 20, 21   |
+        And the places
+         | osm | class | type  | housenr | geometry |
+         | N10 | place | house | 10      | 10 |
+         | N11 | place | house | 20      | 11 |
+         | N20 | place | house | 11      | 20 |
+         | N21 | place | house | 21      | 21 |
+        And the ways
+         | id | nodes |
+         | 10 | 10, 11 |
+         | 20 | 20, 21 |
+        When importing
+        When sending search query "Ringstr 12"
+        Then results contain
+         | osm |
+         | W10 |
+        When sending search query "Ringstr 13"
+        Then results contain
+         | osm |
+         | W20 |