Skip to content

Commit

Permalink
Handle special apostrophe #5
Browse files Browse the repository at this point in the history
  • Loading branch information
michielgerritsen committed Feb 11, 2022
1 parent 7ad3289 commit 5fcddd5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/AddressExtraction.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

class AddressExtraction implements AddressExtractionInterface
{
const STREET_SPLIT_NAME_FROM_NUMBER = '/^(?P<street>\d*[\p{L}\d \'\/\\\\\-\.]+[,.\s])+(?P<housenumber>\d+)\s*(?P<addition>[\p{L} \d\-\/\'"\(\)]*)$/iu';
const STREET_SPLIT_NAME_FROM_NUMBER = '/^(?P<street>\d*[\p{L}\d \'\‘\/\\\\\-\.]+[,.\s])+(?P<housenumber>\d+)\s*(?P<addition>[\p{L} \d\-\/\'"\(\)]*)$/iu';
const STREET_SPLIT_NUMBER_FROM_NAME = '/^(?P<housenumber>\d+)\s*(?P<street>[\p{L}\d \'\-\.]*)$/i';

/**
Expand Down
8 changes: 8 additions & 0 deletions tests/AddressExtractionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ public function addressProvider()
['Prof. De Grootstr.12'],
new AddressExtractionResult('Prof. De Grootstraat', '12', '')
],
'Address with special character (1)' => [
["rue du plat d‘étain", '1'],
new AddressExtractionResult("rue du plat d‘étain", '1', '')
],
'Address with special character (2)' => [
["rue du plat d'etain", '1'],
new AddressExtractionResult("rue du plat d'etain", '1', '')
],
];
}

Expand Down

0 comments on commit 5fcddd5

Please sign in to comment.