diff options
author | Dave Arter <davea@mysociety.org> | 2018-02-22 16:33:59 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-04-10 10:42:33 +0100 |
commit | f849988a45a545e6d4b9e9a80606ea7f7e6bac36 (patch) | |
tree | e93eb0e5a9c23bb3b2cebc249572d4218b69638f | |
parent | fe997d9e10d29eada283f70ca7728bc9f21a2399 (diff) |
[BANES] Handle common road name typos in geocoder disambiguation
-rw-r--r-- | perllib/FixMyStreet/Cobrand/BathNES.pm | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/BathNES.pm b/perllib/FixMyStreet/Cobrand/BathNES.pm index 37c104ef7..38a5eec93 100644 --- a/perllib/FixMyStreet/Cobrand/BathNES.pm +++ b/perllib/FixMyStreet/Cobrand/BathNES.pm @@ -34,6 +34,27 @@ sub disambiguate_location { my $town = 'Bath and North East Somerset'; + # The council have provided a list of common typos which we should correct: + my %replacements = ( + "broom" => "brougham", + "carnarvon" => "caernarvon", + "cornation" => "coronation", + "beafort" => "beaufort", + "beechan" => "beechen", + "malreword" => "malreward", + "canyerberry"=> "canterbury", + "clairemont"=> "claremont", + "salsbury"=> "salisbury", + "solsberry"=> "solsbury", + "lawn road" => "lorne", + "new road high littleton" => "danis house", + ); + + foreach my $original (keys %replacements) { + my $replacement = $replacements{$original}; + $string =~ s/$original/$replacement/ig; + } + return { %{ $self->SUPER::disambiguate_location() }, town => $town, |