ITP: liblocale-us-perl -- Module for United States state identification
On 11/17/07, Ron Johnson <ron.l.johnson@cox.net> wrote:
> > This Perl module provides methods allowing United States' two-letter
> > state identification parsing from state code to state name and vice
> > versa.
>
> Is a package really needed for something this simple?
It might be obvious to a US native, but it's hardly simple or obvious
to those of us outside America.
MI is a prime example, does it refer to Michigan, Missouri,
Mississippi or Minesota? The first two letters match all four.
If you come across this every day you probably know the answer, but I
just had to look it up again (Michigan) despite being caught out by
this just the other week!
--
Matt Brown
matt@mattb.net.nz
Mob +353 86 608 7117 www.mattb.net.nz
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
11-17-2007, 06:43 PM
Ron Johnson
ITP: liblocale-us-perl -- Module for United States state identification
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/17/07 18:51, Matt Brown wrote:
> On 11/17/07, Ron Johnson <ron.l.johnson@cox.net> wrote:
>>> This Perl module provides methods allowing United States' two-letter
>>> state identification parsing from state code to state name and vice
>>> versa.
>> Is a package really needed for something this simple?
>
> It might be obvious to a US native, but it's hardly simple or obvious
> to those of us outside America.
It's not the *need* for a lookup table, it's the need for such a
small package. See below.
> MI is a prime example, does it refer to Michigan, Missouri,
> Mississippi or Minesota? The first two letters match all four.
Don't forget the Marshall Islands!
AL - Alaska or Alabama?
AR - Arizona or Arkansas?
CO - Colorado or Connecticut?
MA - Maine, Marshall Islands, Maryland, Massachusetts?
NE - Nebraska or Nevada?
> If you come across this every day you probably know the answer, but I
> just had to look it up again (Michigan) despite being caught out by
> this just the other week!
But it's just (or should be) a couple of 65-element (50 states, DC,
Puerto Rico, Virgin Islands, and various Pacific islands) hash
tables wrapped around a couple of simple functions.
http://www.usps.com/ncsc/lookups/abbr_state.txt
What would be much more useful (still simple, but with much more
data) is a world-wide hash table of countries and states/provinces.
And wouldn't you know it... there's already a CPAN module to do just
that: Locale::SubCountry.
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
11-17-2007, 07:33 PM
Roberto C. Sánchez
ITP: liblocale-us-perl -- Module for United States state identification
On Sat, Nov 17, 2007 at 06:51:03PM +0000, Matt Brown wrote:
> On 11/17/07, Ron Johnson <ron.l.johnson@cox.net> wrote:
> > > This Perl module provides methods allowing United States' two-letter
> > > state identification parsing from state code to state name and vice
> > > versa.
> >
> > Is a package really needed for something this simple?
>
> It might be obvious to a US native, but it's hardly simple or obvious
> to those of us outside America.
>
> MI is a prime example, does it refer to Michigan, Missouri,
> Mississippi or Minesota? The first two letters match all four.
>
> If you come across this every day you probably know the answer, but I
> just had to look it up again (Michigan) despite being caught out by
> this just the other week!
>
That got me thinking. I figure that since MI -> Michigan, it meant that
MI was the first state to start with those letters. Logically, I would
think, always use the first two letters, unless another state already
had them. Arbitrate in order granting of statehood. But both
Mississippi (MS) and Missouri (MO) were states before Michigan (MI).
Curious.
Regards,
-Roberto
--
Roberto C. Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com
11-17-2007, 10:31 PM
Darren Salt
ITP: liblocale-us-perl -- Module for United States state identification
I demand that Ron Johnson may or may not have written...
[snip]
> What would be much more useful (still simple, but with much more
> data) is a world-wide hash table of countries and states/provinces.
Are you equating states with provinces there? If so, think again... :-)
[snip]
--
| Darren Salt | linux or ds at | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Travel less. Share transport more. PRODUCE LESS CARBON DIOXIDE.
You will pass away very quickly.
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
11-18-2007, 03:26 AM
Ron Johnson
ITP: liblocale-us-perl -- Module for United States state identification
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 11/17/07 20:33, Roberto C. Sánchez wrote:
> On Sat, Nov 17, 2007 at 06:51:03PM +0000, Matt Brown wrote:
>> On 11/17/07, Ron Johnson <ron.l.johnson@cox.net> wrote:
>>>> This Perl module provides methods allowing United States' two-letter
>>>> state identification parsing from state code to state name and vice
>>>> versa.
>>> Is a package really needed for something this simple?
>> It might be obvious to a US native, but it's hardly simple or obvious
>> to those of us outside America.
>>
>> MI is a prime example, does it refer to Michigan, Missouri,
>> Mississippi or Minesota? The first two letters match all four.
>>
>> If you come across this every day you probably know the answer, but I
>> just had to look it up again (Michigan) despite being caught out by
>> this just the other week!
>>
> That got me thinking. I figure that since MI -> Michigan, it meant that
> MI was the first state to start with those letters. Logically, I would
> think, always use the first two letters, unless another state already
> had them. Arbitrate in order granting of statehood. But both
> Mississippi (MS) and Missouri (MO) were states before Michigan (MI).
The USPS doesn't care about entry into the union. It cares about
collating and routing.
In alphabetical order:
Michigan MI first 2 letters of name
Minnesota MN first two non-MI letters of name
Mississippi MS first two non-MI letters of name
Missouri MO first two non-MS letters of name
- --
Ron Johnson, Jr.
Jefferson LA USA
%SYSTEM-F-FISH, my hovercraft is full of eels
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
11-18-2007, 03:34 AM
Roberto C. Sánchez
ITP: liblocale-us-perl -- Module for United States state identification
On Sun, Nov 18, 2007 at 04:26:55AM +0000, Ron Johnson wrote:
> On 11/17/07 20:33, Roberto C. S�hez wrote:
> >>
> > That got me thinking. I figure that since MI -> Michigan, it meant that
> > MI was the first state to start with those letters. Logically, I would
> > think, always use the first two letters, unless another state already
> > had them. Arbitrate in order granting of statehood. But both
> > Mississippi (MS) and Missouri (MO) were states before Michigan (MI).
>
> The USPS doesn't care about entry into the union. It cares about
> collating and routing.
>
> In alphabetical order:
> Michigan MI first 2 letters of name
> Minnesota MN first two non-MI letters of name
> Mississippi MS first two non-MI letters of name
> Missouri MO first two non-MS letters of name
>
Interesting. I had not considered that.
-Roberto
--
Roberto C. Sánchez
http://people.connexer.com/~roberto
http://www.connexer.com
11-18-2007, 10:59 AM
Alastair McKinstry
ITP: liblocale-us-perl -- Module for United States state identification
Two data points for the discussion:
(1) The data, and more useful data, is available in iso-codes.
The iso-codes-3166-2 list contains the subdivision lists for not just
the US but all countries.
(In the US, its states, in the Ireland counties, German Lander, etc.),
and their translations.
(2) Not packaged, but available on the web, is a dataset of the postal
formats for all countries.
e.g Ireland does not have ZIP codes; different countries have standard
formats for addresses.
It might be worth packaging this for use with the subdivisions to give
more useful web pages for
entering addresses.
Regards
Alastair
On 17 Nov 2007, at 18:51, Matt Brown wrote:
On 11/17/07, Ron Johnson <ron.l.johnson@cox.net> wrote:
This Perl module provides methods allowing United States' two-letter
state identification parsing from state code to state name and vice
versa.
Is a package really needed for something this simple?
It might be obvious to a US native, but it's hardly simple or obvious
to those of us outside America.
MI is a prime example, does it refer to Michigan, Missouri,
Mississippi or Minesota? The first two letters match all four.
If you come across this every day you probably know the answer, but I
just had to look it up again (Michigan) despite being caught out by
this just the other week!
--
Matt Brown
matt@mattb.net.nz
Mob +353 86 608 7117 www.mattb.net.nz
--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org