slu-openGIS / postmastr

R package for Processing and Parsing Untidy Street Addresses
https://slu-opengis.github.io/postmastr/
GNU General Public License v3.0
37 stars 8 forks source link

in pm_prep(), limit forward-slash replacement to intersection-type addresses #29

Open christopeak opened 1 year ago

christopeak commented 1 year ago

Current problem: Currently, pm_prep() replaces forward-slashes with the string "at" in all addresses, even though this logic seems intended for intersection-types only.

Desired solution: Suppress the forward-slash replacement logic for "street"-type addresses.

reprex: As shown below, the address "10/20 Main Street" gets changed to "10 at 20 Main Street":

library(postmastr)

df <- data.frame(my.address = "10/20 Main Street, Seattle, Washington")

df_ident <- pm_identify(df, 
                        var="my.address", 
                        locale="us")

df_min <- pm_prep(df_ident, 
                  var="my.address", 
                  type = "street")

str(df_min)
#> tibble [1 × 2] (S3: tbl_df/tbl/data.frame)
#>  $ pm.uid    : int 1
#>  $ pm.address: chr "10 at 20 Main Street Seattle Washington"

Describe alternatives you've considered None, I have to admit.