fix(cbcity_nsw_gov_au): match the address on a normalised form - #7304
Open
CRZTFR wants to merge 1 commit into
Open
fix(cbcity_nsw_gov_au): match the address on a normalised form#7304CRZTFR wants to merge 1 commit into
CRZTFR wants to merge 1 commit into
Conversation
fullAddress is held as "102 Crinan Street, Hurlstone Park 2193": comma
before the suburb, street type spelled out, postcode but no state. Matching
against that string verbatim (or as a substring of it) meant three of the
most ordinary things a person types found nothing at all:
"102 Crinan Street Hurlstone Park 2193" no comma
"102 Crinan Street, Hurlstone Park NSW 2193" added state
"102 Crinan St Hurlstone Park" abbreviated street type
The whole street list is already downloaded, so both sides can simply be
compared on a normalised form: upper case, commas and unit slashes dropped,
street-type abbreviations expanded, state removed. The verbatim check is
kept ahead of it, and the partial-match and suggestion behaviour is
unchanged apart from running on the normalised text too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fullAddressis held as102 Crinan Street, Hurlstone Park 2193: comma before the suburb, street type spelled out, postcode but no state. Matching against that string verbatim (or as a substring of it) meant three of the most ordinary things a person types found nothing at all:The whole street list is already downloaded, so both sides can simply be compared on a normalised form: upper case, commas and unit slashes dropped, street-type abbreviations expanded, state removed.
The verbatim check is kept ahead of it, and the partial-match and suggestion behaviour is unchanged apart from running on the normalised text too.
Testing
All nine existing test cases still pass, plus three new ones for the shapes above, against the live data file.