inst/tinytest/test_match_word.R

library(healthyAddress)

PST6 <- c("ROAD", "STREET", "COURT", "AVENUE", "PLACE", "LANE", "WEST")
expect_equal(match_word("ABC STREET XYZ ABC", c("XY", "STREET", "ROAD")), 2L)
expect_equal(match_word("UNIT 7812 108 FLINDERS STREET MELBOURNE VIC 3004", PST6), 2L)

# Don't detect WEST here (possibly too difficult)
expect_equal(match_word("UNIT 7812 WEST 108 FLINDERS STREET MELBOURNE VIC 3004", PST6), 2L)

Try the healthyAddress package in your browser

Any scripts or data that you put into this service are public.

healthyAddress documentation built on April 12, 2025, 1:28 a.m.