我的任务是将非原子(澳大利亚)街道地址转换为原子街道地址,这意味着当前街道数据将作为街道编号和街道名称一起存储。样品是:
24 George street -----------> 24 | George street
55 park rd -----------> 55 | pard rd
102a gordon road -----------> 102a | gordon road
unit 5/46 addison ave -----------> unit 5/46 | addison ave
flat 2-9/87 north avenue-----------> flat 2-9/87| north avenue
suit 5 lvl2/55 prince hwy-------> suit 5 lvl2/55| prince hwy
shop 5 Big Shopping Centre ------> Rejected
Suit 2 Level 100 -------> Rejected
添加数据(程序应该工作的方式):
Darling street ------------------> Rejected
City road -----------------------> rejected
建议的代码处理结果:
Darling street ------------> Darling | Street
City road ---------------> City | road
实际上在这种情况下,代码不应该处理地址并抛出异常。
拆分地址的最佳方法是什么?