# company dictionary of replacement words
# need to add french ones, enterprise -> ent.
library(magrittr)
br <- readr::read_csv('data-raw/corporations.csv')
f <- function(text) {
t <- stringr::str_match(text,
pattern = "(.*([a-z]|\\b[NEWS]|\\bNW|\\bNE|\\bSE|\\bSW))(\\b[A-Z\\s]+,)(.*)([A-Z][0-9][A-Z]\\s[0-9][A-Z][0-9])") %>%
trimws()
list(address = t[,2], city = t[,4], prov = t[,5], postal_code = t[,6])
}
br <- dplyr::bind_cols(br, br$locationAddress %>% f() %>% tibble::as.tibble()) %>%
mutate(city = gsub(pattern = ',', replacement = '', x = city))
devtools::use_data(br, overwrite = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.