vladimarius / pyap

Python address detector and parser
MIT License
200 stars 60 forks source link

Support traditional (non-postal) province/state abbreviations #28

Open riley-ashton opened 2 years ago

riley-ashton commented 2 years ago

For example 123 Main St Kingston ON will parse, but 123 Main St Kingston Ont. will not. This longer abbreviation is extremely common formatting, especially for PEI and NWT. Also YK is probably a more common abbreviation than YT, despite that YK does not parse.

Likewise French Canadian speakers would probably use TNL, IPE, etc. Quebec should also have the two letter acronyms PQ and QB.

Postal English French
AB Alta. Alb.
BC B.C. C.-B.
MB Man. Man.
NB N.B. N.-B.
NL N.L. T.-N.-L
NS N.S. N.-É.
ON Ont. Ont.
PE P.E.I Î.-P.-É
QC Que. Qc / P.Q.
SK Sask. Sask.
NT N.W.T. T.N.-O
NU Nvt. Nt.
YT Yuk. YK
State Name USPS Abbreviation Traditional Abbreviation
Alabama AL Ala.
Alaska AK Alaska
Arizona AZ Ariz.
Arkansas AR Ark.
California CA Calif.
Colorado CO Colo.
Connecticut CT Conn.
Delaware DE Del.
Florida FL Fla.
Georgia GA Ga.
Hawaii HI Hawaii
Idaho ID Idaho
Illinois IL Ill.
Indiana IN Ind.
Iowa IA Iowa
Kansas KS Kans.
Kentucky KY Ky.
Louisiana LA La.
Maine ME Maine
Maryland MD Md.
Massachusetts MA Mass.
Michigan MI Mich.
Minnesota MN Minn.
Mississippi MS Miss.
Missouri MO Mo.
Montana MT Mont.
Nebraska NE Neb. or Nebr.
Nevada NV Nev.
New Hampshire NH N.H.
New Jersey NJ N.J.
New Mexico NM N.Mex.
New York NY N.Y.
North Carolina NC N.C.
North Dakota ND N.Dak.
Ohio OH Ohio
Oklahoma OK Okla.
Oregon OR Ore. or Oreg.
Pennsylvania PA Pa.
Rhode Island RI R.I.
South Carolina SC S.C.
South Dakota SD S.Dak.
Tennessee TN Tenn.
Texas TX Tex. or Texas
Utah UT Utah
Vermont VT Vt.
Virginia VA Va.
Washington WA Wash.
West Virginia WV W.Va.
Wisconsin WI Wis. or Wisc.
Wyoming WY Wyo.

Sources