openvenues / gopostal

Go (cgo) interface to libpostal for fast international address parsing/normalization
MIT License
160 stars 32 forks source link

`%d string=` in string returned by expand.ExpandAddress #16

Closed coreyvan closed 2 years ago

coreyvan commented 2 years ago

If I try to expand an address:

terms := expand.ExpandAddress("1234 Sesame St. New York, NY 12345")

I get the following strings returned:

[
  "%d string=12345 sesame saint new york ny 12345 to id 1234",
  "%d string=12345 sesame saint new york new york 12345 to id 1234",
  "%d string=12345 sesame street new york ny 12345 to id 1234",
  "%d string=12345 sesame street new york new york 12345 to id 1234",
  "%drive string=12345 sesame saint new york ny 12345 to id 1234",
  "%drive string=12345 sesame saint new york new york 12345 to id 1234",
  "%drive string=12345 sesame street new york ny 12345 to id 1234",
  "%drive string=12345 sesame street new york new york 12345 to id 1234"
]

I would expect to just return the first 4 strings without the %d string= in front. What is the purpose of that prefix?

I'm using go18.1 and version v0.0.0-20171226154602-e0184512a45d of gopostal

coreyvan commented 2 years ago

Apologies, this was a bug in my own code