[Evolution] Extracting address info for contacts

I noticed that when you enter an address into the free-form text field
in the card edit dialog, Ev doesn't do a very good job of extrancting
the various fields (city, state, zip, etc) unless it's a US address.
I posted a bug about it with a proposal for an algorithm, in bug 2133
<http://bugzilla.ximian.com/show_bug.cgi?id=2133>, which I include
below. Maybe y'all have comments--I don't know what addresses might look
like, really, outside USA/Canada/Europe.


- set <address> to the text in the first line
- from bottom, find first line that contains any numbers (this contains
a zip code)
- the zip code is either the maximum trailing or the maximum leading
string which contains any numbers (it's either "city state zip" or "city
zip" or "state zip" or "zip city", possibly with commas somewhere). I
believe even in UK/Canadian post codes each part contains at least one
number, e.g, "WC1 1TN").  Note that you could have something like "D
57654 Berlin" (in which case "D 57654" is the ZIP, and something like
"75004 Paris cedex 05" or "CZ-5432 Prague 8" (so numbers on both ends
mean the initial part is the ZIP). So I suppose do this:

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]