protek
"Takai desu ne." -"Jinsei da."
I'm working on an algorithm that can parse the street name and building/house number from an address and omit anything else like block and apartment number. The reason for this is that the geolocation in WP8 can't handle blocks and apartment number.
I've made a rudimentary parser that uses pre-determined delimiters to split a street address to an array of words. I can also determine, when a word is a number so that I can quit parsing.
The problem of course is that it works with addresses, where street name is before the number. Vice versa it is more complex. I can determine, if the first word is a number and keep on parsing in that case but it only works with simple adresses that don't have blocks or apartment numbers.
Block is usually a single letter, so in principle it's easy to pick out. And if there is a number after a single letter, that can also be picked out. Question is, am I covering all possible variations with these? For example, can the UK addresses be more complex than what I've described?
Thanks in advance!
I've made a rudimentary parser that uses pre-determined delimiters to split a street address to an array of words. I can also determine, when a word is a number so that I can quit parsing.
The problem of course is that it works with addresses, where street name is before the number. Vice versa it is more complex. I can determine, if the first word is a number and keep on parsing in that case but it only works with simple adresses that don't have blocks or apartment numbers.
Block is usually a single letter, so in principle it's easy to pick out. And if there is a number after a single letter, that can also be picked out. Question is, am I covering all possible variations with these? For example, can the UK addresses be more complex than what I've described?
Thanks in advance!