It would really come in handy if there were a single module,
or a single module collection, that could be used to validate
this kind of thing. There have been occasions in the past
where, when validating data for integrity, I have been at
a loss as to what might be valid and what might be invalid.
A few ideas:
- Telephone numbers, such that they are both "validated"
and optionally cleaned up into the "official" format.
- State, province, district, parish, or other political
sub-unit listing, with appropriate abbreviations, and
common misspellings linked to proper spellings (i.e. 'KT'
for Kentucky to 'KY', 'QC' for Quebec to 'PQ')
- Postal codes, plus any secondary validation that
can be performed, such as linking geographic region with
the code (i.e. 10001 is in NY, 90210 is in CA)
| [reply] |
It would be nice with an Interface (Java speak) that could be implemented for different countries. Dates, telephone numbers, addresses, holidays, sorting are general things. Postal codes that maps to regions and cities may also be a general thing. But our Swedish "personnummer" (personal number) is not a thing that exists everywhere. So the base class could list the general things and lett every country module add it's own special methods.
And, as Hanamaki wrote, namespace needs to be worked out.
Anyone know if a project like this exists for other languages? How about Python?
| [reply] |
Talking about countries, charsets and languages CPAN is still
a real mess!
Some Country stuff I know of:
Data::Address::Standardize (U.S. postal addresses)
Geography::USStates (US States)
Geography::States (USA, Brazil, Canada, The Netherlands, and Australia.)
Locale::US (US States)
Wooow! "Locale::US" is just for looking up US-States and there
2 letter codes ...thats close to namespace robbery.
Hanamaki
| [reply] |
| [reply] [d/l] |
| [reply] [d/l] [select] |