NSDataDetector address detection broken for addresses with more than one slash

Originator:steipete
Number:rdar://20553126 Date Originated:15-Apr-2015 05:53 PM
Status:Open Resolved:
Product:iOS Product Version:8.3 (12F70)
Classification:Other Bug Reproducible:Always
 
Summary:
I live in Vienna, Austria. Many people live in large apartment complexes which are subdivided into multiple blocks. Typically addresses for such apartments include the street number + the block number + the apartment number. In taller blocks people often also include the floor level number. All of these numbers are separated by slashes.

NSDataDetector is unable to deal with those addresses and aborts parsing once it encounters the second slash in the street number. This results in incomplete address component dictionaries being returned. Only the street address is filled in and only with the first two numbers with the slash in between them.

The provided sample app shows the issue in two ways: 
1) It has 3 styles of address in UITextView and there you can see - marked in blue - the detected addresses
2) For each address the ViewController.m outputs the address component dictionary.

Steps to Reproduce:
1) Launch the provided sample app in Simulator
2) Look at the marked addresses in the text views
3) Look at the NSLog output

Expected Results:
- In all 3 cases the entire address should be detected and marked
- In all 3 cases the expected results are 4 items in the dictionary

Actual Results:
- only the first address is completely marked and has 4 components in the detected address dictionary
- the second and third address are only marked until before the second slash
- the second and third addresses only have a street entry in the address dictionary

Version:
iOS 8.3 (12F70)

Notes:
As a workaround I need to have extra - incomplete - addresses for people with more than two numbers in their postal address, so that I can navigate there.

The referenced sample app is "DataDetectorAddressBug" at https://github.com/cocoanetics/RadarSamples
This is a duplicate of rdar://20549548

Duplicates

Number Status Originator Product Title
rdar://20549548 Duplicate/20553126 oliver.drobnik iOS Address Detection broken for addresses with more than one slash

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!