pickware / address-splitter

Tries to split street, number, building, apartment information etc. in a meaningful way
MIT License
98 stars 21 forks source link

Unexpected house number range splitting #23

Open larsbo opened 6 years ago

larsbo commented 6 years ago

House number ranges should not be splitted because since both parts are meaningless on their own in my opinion and you usually want to use the number (range) in one piece.

[
    'Happy Street 2-4',
    [
        'additionToAddress1' => '',
        'streetName'         => 'Happy Street',
        'houseNumber'        => '2-4',
        'additionToAddress2' => ''
    ]
]
dreeh commented 1 year ago

As of version 0.3.4, it's already fixed?

running

AddressSplitter::splitAddress('Happy Street 2-4')

gives the output:

Array
(
    [additionToAddress1] =>
    [streetName] => Happy Street
    [houseNumber] => 2-4
    [houseNumberParts] => Array
        (
            [base] => 2
            [extension] => 4
        )

    [additionToAddress2] =>
)