-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcountry_us.rb
126 lines (121 loc) · 3.75 KB
/
country_us.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# encoding: utf-8
US_STATES_MAPPING = {
'California' => 'ca',
'Wisconsin' => 'wi',
'Colorado' => 'co',
'Pennsylvania' => 'pa',
'Illinois' => 'il',
'Washington' => 'wa',
'Oregon' => 'or',
'Michigan' => 'mi',
'Minnesota' => 'mn',
'New York' => 'ny',
'Ohio' => 'oh',
'Texas' => 'tx',
'New Jersey' => 'nj',
'North Carolina' => 'nd',
'Maryland' => 'md',
'Nebraska' => 'ne',
'Massachusetts' => 'ma',
'Vermont' => 'vt',
'Indiana' => 'in',
'Missouri' => 'mo',
'Arizona' => 'az',
'Iowa' => 'ia',
'Montana' => 'mt',
'Florida' => 'fl',
'Maine' => 'me',
'New Mexico' => 'nm',
'Alaska' => 'ak',
'Hawaii' => 'hi',
'Nevada' => 'nv',
'Utah' => 'ut',
'Virginia' => 'va',
'Kentucky' => 'ky',
'South Carolina' => 'sc',
'Delaware' => 'de',
'Idaho' => 'id',
'New Hampshire' => 'nh',
'Wyoming' => 'wy',
'Georgia' => 'ga',
'Louisiana' => 'la',
'Tennessee' => 'tn',
'Kansas' => 'ks',
'Oklahoma' => 'ok',
'Connecticut' => 'ct',
'Mississippi' => 'ms',
'Rhode Island' => 'ri',
'South Dakota' => 'sd',
'Arkansas' => 'ar',
'District of Columbia' => 'dc',
'NC' => 'nc',
'Or' => 'or',
'CA' => 'ca',
'DC' => 'dc',
'IL' => 'il',
'KS' => 'ks',
'MA' => 'ma',
'ME' => 'me',
'MI' => 'mi',
'MO' => 'mo',
'NJ' => 'nj',
'NY' => 'ny',
'OH' => 'oh',
'WI' => 'wi',
### 'Virgin Islands' => '', skip depdendencies/dependent territories
}
### map us states name to file name
US_STATES = {
'ct' => '1--ct-connecticut--new-england',
'ma' => '1--ma-massachusetts--new-england',
'me' => '1--me-maine--new-england',
'nh' => '1--nh-new-hampshire--new-england',
'ri' => '1--ri-rhode-island--new-england',
'vt' => '1--vt-vermont--new-england',
'nj' => '2--nj-new-jersey--mid-atlantic',
'ny' => '2--ny-new-york--mid-atlantic',
'pa' => '2--pa-pennsylvania--mid-atlantic',
'dc' => '3--dc-district-of-columbia--capital',
'de' => '3--de-delaware--capital',
'md' => '3--md-maryland--capital',
'va' => '3--va-virginia--capital',
'wv' => '3--wv-west-virginia--capital',
'il' => '4--il-illinois--great-lakes',
'in' => '4--in-indiana--great-lakes',
'mi' => '4--mi-michigan--great-lakes',
'mn' => '4--mn-minnesota--great-lakes',
'oh' => '4--oh-ohio--great-lakes',
'wi' => '4--wi-wisconsin--great-lakes',
'ia' => '5--ia-iowa--great-plains',
'ks' => '5--ks-kansas--great-plains',
'mo' => '5--mo-missouri--great-plains',
'nd' => '5--nd-north-dakota--great-plains',
'ne' => '5--ne-nebraska--great-plains',
'ok' => '5--ok-oklahoma--great-plains',
'sd' => '5--sd-south-dakota--great-plains',
'al' => '6--al-alabama--south',
'ar' => '6--ar-arkansas--south',
'fl' => '6--fl-florida--south',
'ga' => '6--ga-georgia--south',
'ky' => '6--ky-kentucky--south',
'la' => '6--la-louisiana--south',
'ms' => '6--ms-mississippi--south',
'nc' => '6--nc-north-carolina--south',
'sc' => '6--sc-south-carolina--south',
'tn' => '6--tn-tennessee--south',
'az' => '7--az-arizona--southwest',
'nm' => '7--nm-new-mexico--southwest',
'nv' => '7--nv-nevada--southwest',
'tx' => '7--tx-texas--southwest',
'ut' => '7--ut-utah--southwest',
'co' => '8--co-colorado--rocky-mountains',
'id' => '8--id-idaho--rocky-mountains',
'mt' => '8--mt-montana--rocky-mountains',
'wy' => '8--wy-wyoming--rocky-mountains',
'ak' => '9--ak-alaska--pacific',
'ca' => '9--ca-california--pacific',
'hi' => '9--hi-hawaii--pacific',
'or' => '9--or-oregon--pacific',
'wa' => '9--wa-washington--pacific',
'?' => '99--??--uncategorized',
}