Ironholds / poster

Address parsing and normalisation through libpostal
MIT License
59 stars 9 forks source link

Parse multiple addresses #15

Open krlmlr opened 4 years ago

krlmlr commented 4 years ago

libpostal has support for detecting multiple streets, I'd like to use this feature:

$ echo "feldstr. 1, blumenplatz 2, 8001 zürich" | src/address_parser
Loading models...

Welcome to libpostal's address parser.

Type in any address to parse and print the result.

Special commands:
.exit to quit the program

Result:

{
  "road": "feldstr.",
  "house_number": "1",
  "road": "blumenplatz",
  "house_number": "2",
  "postcode": "8001",
  "city": "zürich"
}

poster seems to overwrite repeated entries of the same type:

poster::parse_addr("feldstr. 1, blumenplatz 2, 8001 zürich")
#>   house category near house_number        road unit level staircase
#> 1  <NA>     <NA> <NA>            2 blumenplatz <NA>  <NA>      <NA>
#>   entrance po_box suburb city_district   city island state_district state
#> 1     <NA>   <NA>   <NA>          <NA> zürich   <NA>           <NA>  <NA>
#>   postal_code country_region country world_region
#> 1        8001           <NA>    <NA>         <NA>

Created on 2019-11-20 by the reprex package (v0.3.0)

Would you support a mode that returns a list, possibly with duplicate names?