Re: ITP: liblocale-us-perl -- Module for United States state identification

2009-08-22 Thread Alastair McKinstry

Hi,

A larger version of this idea exists in the iso-codes package, with  
the iso-code subdivision

codes for all countries, see /usr/share/xml/iso-codes/iso_3166-2.xml

For each US state it has the 2nd-level code , so US-MI is Michigan,  
for example.


Similar 2nd-level codes exist for each country, so FR-75 is the French  
Department of Paris,

IE-D is Dublin, Ireland, and GB-ESX is the English county of Essex.

The iso-codes package  provides translations for these lists.

Perhaps generalizing this module might be a good idea ?

Regards
Alastair

On 17 Nov 2007, at 18:51, Matt Brown wrote:


On 11/17/07, Ron Johnson ron.l.john...@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
m...@mattb.net.nz
Mob +353 86 608 7117 www.mattb.net.nz


--
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org




--
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Re: ITP: liblocale-us-perl -- Module for United States state identification

2007-11-18 Thread Alastair McKinstry

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 [EMAIL PROTECTED] 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
[EMAIL PROTECTED]
Mob +353 86 608 7117 www.mattb.net.nz


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Regards,
Alastair

--
Alastair McKinstry  , [EMAIL PROTECTED] http://blog.scealnetworks.com

Anyone who believes exponential growth can go on forever in a finite  
world

is either a madman or an economist - Kenneth Boulter, Economist.



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



[OT] Re: ITP: liblocale-us-perl -- Module for United States state identification

2007-11-18 Thread brian m. carlson

On Sun, Nov 18, 2007 at 04:26:55AM +, Ron Johnson wrote:

The USPS doesn't care about entry into the union.  It cares about
collating and routing.


This is true.  Until sometime in the twentieth century, states were 
addressed with more verbose abbreviations (Tex. or Penn., for example), 
so most, if not all, of the fifty states were present when two-letter 
abbreviations were assigned.



In alphabetical order:
Michigan MI  first 2 letters of name
MinnesotaMN  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


Counterexamples: your state (Louisiana, which is not LO) and mine 
(Texas, which is not TE, despite Tennessee being TN).  Maryland is 
another, since MR, MY, and ML are not valid region codes for (AFAIK) any 
region within United States or Canada, and so under that scheme, 
logically those would have been assigned to Maryland first.


A better, but still untested, hypothesis is that precedence was given to 
pairs of letters that were present in the short abbreviations (so La. 
became LA, Tenn. became TN, Tex. became TX, and Md. became MD).  Hence, 
Mich., Minn., Miss., and Mo.


--
brian m. carlson / brian with sandals: Houston, Texas, US
+1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only
a typesetting engine: http://crustytoothpaste.ath.cx/~bmc/code/thwack
OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187


signature.asc
Description: Digital signature


Re: ITP: liblocale-us-perl -- Module for United States state identification

2007-11-17 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/17/07 09:56, Ernesto Hernandez-Novich wrote:
 Package: wnpp
 
 * Package name: liblocale-us-perl
   Version: 1.02
   Upstream Author: T. M. Brannon [EMAIL PROTECTED]
 * URL: http://search.cpan.org/dist/Locale-US/
 * License: GPL or Perl Artistic
 
 Description:
 
 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?

- --
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)

iD8DBQFHPzRAS9HxQb37XmcRAr2aAJ4qlXj4Vb2yzdTbtKTjiNyu33e2OgCfTchc
hU/HjV3QuQZO2OmQ44nvxiY=
=Otmb
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: ITP: liblocale-us-perl -- Module for United States state identification

2007-11-17 Thread Matt Brown
On 11/17/07, Ron Johnson [EMAIL PROTECTED] 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
[EMAIL PROTECTED]
Mob +353 86 608 7117 www.mattb.net.nz


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: ITP: liblocale-us-perl -- Module for United States state identification

2007-11-17 Thread Ron Johnson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 11/17/07 18:51, Matt Brown wrote:
 On 11/17/07, Ron Johnson [EMAIL PROTECTED] 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.

http://search.cpan.org/~kimryan/Locale-SubCountry-1.38/lib/Locale/SubCountry.pm

- --
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)

iD8DBQFHP0R8S9HxQb37XmcRAiA2AJ9yhYepslZJCedRRxeLtverXuP2RQCggl/G
jffLA1E9WM2wK00R4LZehYw=
=UNmC
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: ITP: liblocale-us-perl -- Module for United States state identification

2007-11-17 Thread Roberto C . Sánchez
On Sat, Nov 17, 2007 at 06:51:03PM +, Matt Brown wrote:
 On 11/17/07, Ron Johnson [EMAIL PROTECTED] 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


signature.asc
Description: Digital signature


Re: ITP: liblocale-us-perl -- Module for United States state identification

2007-11-17 Thread Darren Salt
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 [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: ITP: liblocale-us-perl -- Module for United States state identification

2007-11-17 Thread Ron Johnson
-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 +, Matt Brown wrote:
 On 11/17/07, Ron Johnson [EMAIL PROTECTED] 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
MinnesotaMN  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)

iD8DBQFHP78PS9HxQb37XmcRAhoAAJ9EdjvARhzDuFf6SIPrZlsK8zvh8wCg65/o
6nU3UhDAJz/QO1KQaTzwOlY=
=kZoB
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: ITP: liblocale-us-perl -- Module for United States state identification

2007-11-17 Thread Roberto C . Sánchez
On Sun, Nov 18, 2007 at 04:26:55AM +, Ron Johnson wrote:
 On 11/17/07 20:33, Roberto C. S�nchez 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
 MinnesotaMN  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


signature.asc
Description: Digital signature