marc-vocab 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 969743358fcc7e0593d1d97424ec1081cd0edf3afa05620631ca95fdca5a745f
4
+ data.tar.gz: f110970c84a9a0636df07b133ac3bdfe18dd2f3114b1237a67ed48c22c1f2f5a
5
+ SHA512:
6
+ metadata.gz: 07e6555411953ec84e154cf3ace2a3e53471f438d849e5a9572a36386aaf5eaee71eaac488a5fa54c82aab23ad47416c70a26f4b231283cd93882144c7c4a088
7
+ data.tar.gz: 328b25f97a1b0a2260c412e61ff7cf762f217b5a217cd454cd45e5f64d2ebd9c63e559b5a0806d997d4cfc4bc548527cfead9fe446cdbe037461c21e523ca127
@@ -0,0 +1,16 @@
1
+ name: Ruby
2
+
3
+ on: [push,pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ runs-on: ubuntu-latest
8
+ steps:
9
+ - uses: actions/checkout@v2
10
+ - name: Set up Ruby
11
+ uses: ruby/setup-ruby@v1
12
+ with:
13
+ ruby-version: 2.7.2
14
+ bundler-cache: true
15
+ - name: Run the default task
16
+ run: bundle exec rake
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,17 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.7
3
+ SuggestExtensions: false
4
+
5
+ Metrics/ModuleLength:
6
+ Enabled: false
7
+
8
+ Style/StringLiterals:
9
+ Enabled: true
10
+ EnforcedStyle: double_quotes
11
+
12
+ Style/StringLiteralsInInterpolation:
13
+ Enabled: true
14
+ EnforcedStyle: double_quotes
15
+
16
+ Layout/LineLength:
17
+ Max: 120
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in marc-vocab.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.7"
data/Gemfile.lock ADDED
@@ -0,0 +1,55 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ marc-vocab (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ ast (2.4.2)
10
+ diff-lcs (1.4.4)
11
+ parallel (1.20.1)
12
+ parser (3.0.1.0)
13
+ ast (~> 2.4.1)
14
+ rainbow (3.0.0)
15
+ rake (13.0.3)
16
+ regexp_parser (2.1.1)
17
+ rexml (3.2.5)
18
+ rspec (3.10.0)
19
+ rspec-core (~> 3.10.0)
20
+ rspec-expectations (~> 3.10.0)
21
+ rspec-mocks (~> 3.10.0)
22
+ rspec-core (3.10.1)
23
+ rspec-support (~> 3.10.0)
24
+ rspec-expectations (3.10.1)
25
+ diff-lcs (>= 1.2.0, < 2.0)
26
+ rspec-support (~> 3.10.0)
27
+ rspec-mocks (3.10.2)
28
+ diff-lcs (>= 1.2.0, < 2.0)
29
+ rspec-support (~> 3.10.0)
30
+ rspec-support (3.10.2)
31
+ rubocop (1.13.0)
32
+ parallel (~> 1.10)
33
+ parser (>= 3.0.0.0)
34
+ rainbow (>= 2.2.2, < 4.0)
35
+ regexp_parser (>= 1.8, < 3.0)
36
+ rexml
37
+ rubocop-ast (>= 1.2.0, < 2.0)
38
+ ruby-progressbar (~> 1.7)
39
+ unicode-display_width (>= 1.4.0, < 3.0)
40
+ rubocop-ast (1.4.1)
41
+ parser (>= 2.7.1.5)
42
+ ruby-progressbar (1.11.0)
43
+ unicode-display_width (2.0.0)
44
+
45
+ PLATFORMS
46
+ x86_64-darwin-19
47
+
48
+ DEPENDENCIES
49
+ marc-vocab!
50
+ rake (~> 13.0)
51
+ rspec (~> 3.0)
52
+ rubocop (~> 1.7)
53
+
54
+ BUNDLED WITH
55
+ 2.2.16
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # Marc::Vocab
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/marc/vocab`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'marc-vocab'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle install
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install marc-vocab
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/marc-vocab.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
data/bin/console ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "bundler/setup"
5
+ require "marc/vocab"
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require "irb"
15
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/lib/marc/vocab.rb ADDED
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "vocab/version"
4
+ require_relative "vocab/geographic_area"
5
+
6
+ module Marc
7
+ module Vocab
8
+ class Error < StandardError; end
9
+ # Your code goes here...
10
+ end
11
+ end
@@ -0,0 +1,599 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Marc
4
+ # Provides labels for MARC geographic codes
5
+ # https://www.loc.gov/marc/geoareas/
6
+ module GeographicArea
7
+ TERMS = {
8
+ "a" => "Asia",
9
+ "a-af" => "Afghanistan",
10
+ "a-ai" => "Armenia (Republic)",
11
+ "a-aj" => "Azerbaijan",
12
+ "a-ba" => "Bahrain",
13
+ "a-bg" => "Bangladesh",
14
+ "a-bn" => "Borneo",
15
+ "a-br" => "Burma",
16
+ "a-bt" => "Bhutan",
17
+ "a-bx" => "Brunei",
18
+ "a-cb" => "Cambodia",
19
+ "a-cc" => "China",
20
+ "a-cc-an" => "Anhui Sheng (China)",
21
+ "a-cc-ch" => "Zhejiang Sheng (China)",
22
+ "a-cc-cq" => "Chongqing (China)",
23
+ "a-cc-fu" => "Fujian Sheng (China)",
24
+ "a-cc-ha" => "Hainan Sheng (China)",
25
+ "a-cc-he" => "Heilongjiang Sheng (China)",
26
+ "a-cc-hh" => "Hubei Sheng (China)",
27
+ "a-cc-hk" => "Hong Kong (China)",
28
+ "a-cc-ho" => "Henan Sheng (China)",
29
+ "a-cc-hp" => "Hebei Sheng (China)",
30
+ "a-cc-hu" => "Hunan Sheng (China)",
31
+ "a-cc-im" => "Inner Mongolia (China)",
32
+ "a-cc-ka" => "Gansu Sheng (China)",
33
+ "a-cc-kc" => "Guangxi Zhuangzu Zizhiqu (China)",
34
+ "a-cc-ki" => "Jiangxi Sheng (China)",
35
+ "a-cc-kn" => "Guangdong Sheng (China)",
36
+ "a-cc-kr" => "Jilin Sheng (China)",
37
+ "a-cc-ku" => "Jiangsu Sheng (China)",
38
+ "a-cc-kw" => "Guizhou Sheng (China)",
39
+ "a-cc-lp" => "Liaoning Sheng (China)",
40
+ "a-cc-mh" => "Macau (China : Special Administrative Region)",
41
+ "a-cc-nn" => "Ningxia Huizu Zizhiqu (China)",
42
+ "a-cc-pe" => "Beijing (China)",
43
+ "a-cc-sh" => "Shanxi Sheng (China)",
44
+ "a-cc-sm" => "Shanghai (China)",
45
+ "a-cc-sp" => "Shandong Sheng (China)",
46
+ "a-cc-ss" => "Shaanxi Sheng (China)",
47
+ "a-cc-su" => "Xinjiang Uygur Zizhiqu (China)",
48
+ "a-cc-sz" => "Sichuan Sheng (China)",
49
+ "a-cc-ti" => "Tibet (China)",
50
+ "a-cc-tn" => "Tianjin (China)",
51
+ "a-cc-ts" => "Qinghai Sheng (China)",
52
+ "a-cc-yu" => "Yunnan Sheng (China)",
53
+ "a-ccg" => "Yangtze River (China)",
54
+ "a-cck" => "Kunlun Mountains (China and India)",
55
+ "a-ccp" => "Bo Hai (China)",
56
+ "a-ccs" => "Xi River (China)",
57
+ "a-ccy" => "Yellow River (China)",
58
+ "a-ce" => "Sri Lanka",
59
+ "a-ch" => "Taiwan",
60
+ "a-cy" => "Cyprus",
61
+ "a-em" => "Timor-Leste",
62
+ "a-gs" => "Georgia (Republic)",
63
+ "a-hk" => "Hong Kong", # discontinued
64
+ "a-ii" => "India",
65
+ "a-io" => "Indonesia",
66
+ "a-iq" => "Iraq",
67
+ "a-ir" => "Iran",
68
+ "a-is" => "Israel",
69
+ "a-ja" => "Japan",
70
+ "a-jo" => "Jordan",
71
+ "a-kg" => "Kyrgyzstan",
72
+ "a-kn" => "Korea (North)",
73
+ "a-ko" => "Korea (South)",
74
+ "a-kr" => "Korea",
75
+ "a-ku" => "Kuwait",
76
+ "a-kz" => "Kazakhstan",
77
+ "a-le" => "Lebanon",
78
+ "a-ls" => "Laos",
79
+ "a-mh" => "Macao", # discontinued
80
+ "a-mk" => "Oman",
81
+ "a-mp" => "Mongolia",
82
+ "a-my" => "Malaysia",
83
+ "a-np" => "Nepal",
84
+ "a-nw" => "New Guinea",
85
+ "a-ok" => "Okinawa", # discontinued
86
+ "a-ph" => "Philippines",
87
+ "a-pk" => "Pakistan",
88
+ "a-pp" => "Papua New Guinea",
89
+ "a-pt" => "Portuguese Timor", # discontinued
90
+ "a-qa" => "Qatar",
91
+ "a-si" => "Singapore",
92
+ "a-sk" => "Sikkim", # discontinued
93
+ "a-su" => "Saudi Arabia",
94
+ "a-sy" => "Syria",
95
+ "a-ta" => "Tajikistan",
96
+ "a-th" => "Thailand",
97
+ "a-tk" => "Turkmenistan",
98
+ "a-ts" => "United Arab Emirates",
99
+ "a-tu" => "Turkey",
100
+ "a-uz" => "Uzbekistan",
101
+ "a-vn" => "Viet Nam, North", # discontinued
102
+ "a-vs" => "Viet Nam, South", # discontinued
103
+ "a-vt" => "Vietnam",
104
+ "a-ye" => "Yemen (Republic)",
105
+ "a-ys" => "Yemen (People's Democratic Republic)", # discontinued
106
+ "aa" => "Amur River (China and Russia)",
107
+ "ab" => "Bengal, Bay of",
108
+ "ac" => "Asia, Central",
109
+ "ae" => "East Asia",
110
+ "af" => "Thailand, Gulf of",
111
+ "ag" => "Mekong River",
112
+ "ah" => "Himalaya Mountains",
113
+ "ai" => "Indochina",
114
+ "ak" => "Caspian Sea",
115
+ "am" => "Malaya",
116
+ "an" => "East China Sea",
117
+ "ao" => "South China Sea",
118
+ "aopf" => "Paracel Islands",
119
+ "aoxp" => "Spratly Islands",
120
+ "ap" => "Persian Gulf",
121
+ "ar" => "Arabian Peninsula",
122
+ "as" => "Southeast Asia",
123
+ "at" => "Tien Shan",
124
+ "au" => "Arabian Sea",
125
+ "aw" => "Middle East",
126
+ "awba" => "West Bank",
127
+ "awgz" => "Gaza Strip",
128
+ "awiu" => "Israel-Syria Demilitarized Zones", # discontinued
129
+ "awiw" => "Israel-Jordan Demilitarized Zones", # discontinued
130
+ "awiy" => "Iraq-Saudi Arabia Neutral Zone", # discontinued
131
+ "ay" => "Yellow Sea",
132
+ "az" => "South Asia",
133
+ "b" => "Commonwealth countries",
134
+ "c" => "Intercontinental areas (Western Hemisphere)",
135
+ "cc" => "Caribbean Area; Caribbean Sea",
136
+ "cl" => "Latin America",
137
+ "cm" => "Middle America", # discontinued
138
+ "cr" => "Circumcaribbean", # discontinued
139
+ "d" => "Developing countries",
140
+ "dd" => "Developed countries",
141
+ "e" => "Europe",
142
+ "e-aa" => "Albania",
143
+ "e-an" => "Andorra",
144
+ "e-au" => "Austria",
145
+ "e-be" => "Belgium",
146
+ "e-bn" => "Bosnia and Hercegovina",
147
+ "e-bu" => "Bulgaria",
148
+ "e-bw" => "Belarus",
149
+ "e-ci" => "Croatia",
150
+ "e-cs" => "Czechoslovakia",
151
+ "e-dk" => "Denmark",
152
+ "e-er" => "Estonia",
153
+ "e-fi" => "Finland",
154
+ "e-fr" => "France",
155
+ "e-ge" => "Germany (East)",
156
+ "e-gi" => "Gibraltar",
157
+ "e-gr" => "Greece",
158
+ "e-gw" => "Germany (West)",
159
+ "e-gx" => "Germany",
160
+ "e-hu" => "Hungary",
161
+ "e-ic" => "Iceland",
162
+ "e-ie" => "Ireland",
163
+ "e-it" => "Italy",
164
+ "e-kv" => "Kosovo",
165
+ "e-lh" => "Liechtenstein",
166
+ "e-li" => "Lithuania",
167
+ "e-lu" => "Luxembourg",
168
+ "e-lv" => "Latvia",
169
+ "e-mc" => "Monaco",
170
+ "e-mm" => "Malta",
171
+ "e-mo" => "Montenegro",
172
+ "e-mv" => "Moldova",
173
+ "e-ne" => "Netherlands",
174
+ "e-no" => "Norway",
175
+ "e-pl" => "Poland",
176
+ "e-po" => "Portugal",
177
+ "e-rb" => "Serbia",
178
+ "e-rm" => "Romania",
179
+ "e-ru" => "Russia (Federation)",
180
+ "e-sm" => "San Marino",
181
+ "e-sp" => "Spain",
182
+ "e-sw" => "Sweden",
183
+ "e-sz" => "Switzerland",
184
+ "e-uk" => "Great Britain",
185
+ "e-uk-en" => "England",
186
+ "e-uk-ni" => "Northern Ireland",
187
+ "e-uk-st" => "Scotland",
188
+ "e-uk-ui" => "Great Britain Miscellaneous Island Dependencies",
189
+ "e-uk-wl" => "Wales",
190
+ "e-un" => "Ukraine",
191
+ "e-ur" => "Russia. Russian Empire. Soviet Union. Former Soviet Republics",
192
+ # 'e-ur' => 'Central Region, RSFSR', # discontinued
193
+ # 'e-ur' => 'Soviet Central Asia', # discontinued
194
+ # 'e-ur' => 'Volgo-Viatskii Region, RSFSR', # discontinued
195
+ "e-ur-ai" => "Armenia (Republic)", # discontinued
196
+ "e-ur-aj" => "Azerbaijan", # discontinued
197
+ "e-ur-bw" => "Belarus", # discontinued
198
+ "e-ur-er" => "Estonia", # discontinued
199
+ "e-ur-gs" => "Georgia (Republic)", # discontinued
200
+ "e-ur-kg" => "Kyrgyzstan", # discontinued
201
+ "e-ur-kz" => "Kazakhstan", # discontinued
202
+ "e-ur-li" => "Lithuania", # discontinued
203
+ "e-ur-lv" => "Latvia", # discontinued
204
+ "e-ur-mv" => "Moldova", # discontinued
205
+ "e-ur-ru" => "Russia (Federation)", # discontinued
206
+ "e-ur-ta" => "Tajikistan", # discontinued
207
+ "e-ur-tk" => "Turkmenistan", # discontinued
208
+ "e-ur-un" => "Ukraine", # discontinued
209
+ "e-ur-uz" => "Uzbekistan", # discontinued
210
+ "e-urc" => "Central Chernozem Region (Russia)",
211
+ "e-ure" => "Siberia, Eastern (Russia)",
212
+ "e-urf" => "Russian Far East (Russia)",
213
+ "e-urk" => "Caucasus",
214
+ "e-urn" => "Soviet Union, Northwestern",
215
+ "e-urp" => "Volga River (Russia)",
216
+ "e-urr" => "Caucasus, Northern (Russia)",
217
+ "e-urs" => "Siberia (Russia)",
218
+ "e-uru" => "Ural Mountains (Russia)",
219
+ "e-urw" => "Siberia, Western (Russia)",
220
+ "e-vc" => " Vatican City",
221
+ "e-xn" => " Macedonia (Republic)",
222
+ "e-xo" => " Slovakia",
223
+ "e-xr" => " Czech Republic",
224
+ "e-xv" => " Slovenia",
225
+ "e-yu" => " Serbia and Montenegro; Yugoslavia",
226
+ "ea" => "Alps",
227
+ "eb" => "Baltic States",
228
+ "ec" => "Europe, Central",
229
+ "ed" => "Balkan Peninsula",
230
+ "ee" => "Europe, Eastern",
231
+ "ei" => "Iberian Peninsula", # discontinued
232
+ "el" => "Benelux countries",
233
+ "en" => "Europe, Northern",
234
+ "eo" => "Danube River",
235
+ "ep" => "Pyrenees",
236
+ "er" => "Rhine River",
237
+ "es" => "Europe, Southern",
238
+ "et" => "Europe, East Central", # discontinued
239
+ "ev" => "Scandinavia",
240
+ "ew" => "Europe, Western",
241
+ "f" => "Africa",
242
+ "f-ae" => "Algeria",
243
+ "f-ao" => "Angola",
244
+ "f-bd" => "Burundi",
245
+ "f-bs" => "Botswana",
246
+ "f-by" => "Biafra", # discontinued
247
+ "f-cd" => "Chad",
248
+ "f-cf" => "Congo (Brazzaville)",
249
+ "f-cg" => "Congo (Democratic Republic)",
250
+ "f-cm" => "Cameroon",
251
+ "f-cx" => "Central African Republic",
252
+ "f-dm" => "Benin",
253
+ "f-ea" => "Eritrea",
254
+ "f-eg" => "Equatorial Guinea",
255
+ "f-et" => "Ethiopia",
256
+ "f-ft" => "Djibouti",
257
+ "f-gh" => "Ghana",
258
+ "f-gm" => "Gambia",
259
+ "f-go" => "Gabon",
260
+ "f-gv" => "Guinea",
261
+ "f-if" => "Ifni", # discontinued
262
+ "f-iv" => "Côte d'Ivoire",
263
+ "f-ke" => "Kenya",
264
+ "f-lb" => "Liberia",
265
+ "f-lo" => "Lesotho",
266
+ "f-ly" => "Libya",
267
+ "f-mg" => "Madagascar",
268
+ "f-ml" => "Mali",
269
+ "f-mr" => "Morocco",
270
+ "f-mu" => "Mauritania",
271
+ "f-mw" => "Malawi",
272
+ "f-mz" => "Mozambique",
273
+ "f-ng" => "Niger",
274
+ "f-nr" => "Nigeria",
275
+ "f-pg" => "Guinea-Bissau",
276
+ "f-rh" => "Zimbabwe",
277
+ "f-rw" => "Rwanda",
278
+ "f-sa" => "South Africa",
279
+ "f-sd" => "South Sudan",
280
+ "f-sf" => "Sao Tome and Principe",
281
+ "f-sg" => "Senegal",
282
+ "f-sh" => "Spanish North Africa",
283
+ "f-sj" => "Sudan",
284
+ "f-sl" => "Sierra Leone",
285
+ "f-so" => "Somalia",
286
+ "f-sq" => "Swaziland",
287
+ "f-ss" => "Western Sahara",
288
+ "f-sx" => "Namibia",
289
+ "f-tg" => "Togo",
290
+ "f-ti" => "Tunisia",
291
+ "f-tz" => "Tanzania",
292
+ "f-ua" => "Egypt",
293
+ "f-ug" => "Uganda",
294
+ "f-uv" => "Burkina Faso",
295
+ "f-za" => "Zambia",
296
+ "fa" => "Atlas Mountains",
297
+ "fb" => "Africa, Sub-Saharan",
298
+ "fc" => "Africa, Central",
299
+ "fd" => "Sahara",
300
+ "fe" => "Africa, Eastern",
301
+ "ff" => "Africa, North",
302
+ "fg" => "Congo River",
303
+ "fh" => "Africa, Northeast",
304
+ "fi" => "Niger River",
305
+ "fl" => "Nile River",
306
+ "fn" => "Sudan (Region)",
307
+ "fq" => "Africa, French-speaking Equatorial",
308
+ "fr" => "Great Rift Valley",
309
+ "fs" => "Africa, Southern",
310
+ "fu" => "Suez Canal (Egypt)",
311
+ "fv" => "Volta River (Ghana)",
312
+ "fw" => "Africa, West",
313
+ "fz" => "Zambezi River",
314
+ "h" => "French Community",
315
+ "i" => "Indian Ocean",
316
+ "i-bi" => "British Indian Ocean Territory",
317
+ "i-cq" => "Comoros",
318
+ "i-fs" => "Terres australes et antarctiques françaises",
319
+ "i-hm" => "Heard and McDonald Islands",
320
+ "i-mf" => "Mauritius",
321
+ "i-my" => "Mayotte",
322
+ "i-re" => "Réunion",
323
+ "i-se" => "Seychelles",
324
+ "i-xa" => "Christmas Island (Indian Ocean)",
325
+ "i-xb" => "Cocos (Keeling) Islands",
326
+ "i-xc" => "Maldives",
327
+ "i-xo" => "Socotra Island", # discontinued
328
+ "l" => "Atlantic Ocean",
329
+ "ln" => "North Atlantic Ocean",
330
+ "lnaz" => "Azores",
331
+ "lnbm" => "Bermuda Islands",
332
+ "lnca" => "Canary Islands",
333
+ "lncv" => "Cape Verde",
334
+ "lnfa" => "Faroe Islands",
335
+ "lnjn" => "Jan Mayen Island",
336
+ "lnma" => "Madeira Islands",
337
+ "lnsb" => "Svalbard (Norway)",
338
+ "ls" => " South Atlantic Ocean",
339
+ "lsai" => "Ascension Island (Atlantic Ocean)",
340
+ "lsbv" => "Bouvet Island",
341
+ "lsfk" => "Falkland Islands",
342
+ "lstd" => "Tristan da Cunha",
343
+ "lsxj" => "Saint Helena",
344
+ "lsxs" => "South Georgia and South Sandwich Islands",
345
+ "m" => "Intercontinental areas (Eastern Hemisphere)",
346
+ "ma" => "Arab countries",
347
+ "mb" => "Black Sea",
348
+ "me" => "Eurasia",
349
+ "mm" => "Mediterranean Region; Mediterranean Sea",
350
+ "mr" => "Red Sea",
351
+ "n" => "North America",
352
+ "n-cn" => "Canada",
353
+ "n-cn-ab" => "Alberta",
354
+ "n-cn-bc" => "British Columbia",
355
+ "n-cn-mb" => "Manitoba",
356
+ "n-cn-nf" => "Newfoundland and Labrador",
357
+ "n-cn-nk" => "New Brunswick",
358
+ "n-cn-ns" => "Nova Scotia",
359
+ "n-cn-nt" => "Northwest Territories",
360
+ "n-cn-nu" => "Nunavut",
361
+ "n-cn-on" => "Ontario",
362
+ "n-cn-pi" => "Prince Edward Island",
363
+ "n-cn-qu" => "Québec (Province)",
364
+ "n-cn-sn" => "Saskatchewan",
365
+ "n-cn-yk" => "Yukon Territory",
366
+ "n-cnh" => "Hudson Bay",
367
+ "n-cnm" => "Maritime Provinces",
368
+ "n-cnp" => "Prairie Provinces",
369
+ "n-gl" => "Greenland",
370
+ "n-mx" => "Mexico",
371
+ "n-us" => "United States",
372
+ "n-us-ak" => "Alaska",
373
+ "n-us-al" => "Alabama",
374
+ "n-us-ar" => "Arkansas",
375
+ "n-us-az" => "Arizona",
376
+ "n-us-ca" => "California",
377
+ "n-us-co" => "Colorado",
378
+ "n-us-ct" => "Connecticut",
379
+ "n-us-dc" => "Washington (D.C.)",
380
+ "n-us-de" => "Delaware",
381
+ "n-us-fl" => "Florida",
382
+ "n-us-ga" => "Georgia",
383
+ "n-us-hi" => "Hawaii",
384
+ "n-us-ia" => "Iowa",
385
+ "n-us-id" => "Idaho",
386
+ "n-us-il" => "Illinois",
387
+ "n-us-in" => "Indiana",
388
+ "n-us-ks" => "Kansas",
389
+ "n-us-ky" => "Kentucky",
390
+ "n-us-la" => "Louisiana",
391
+ "n-us-ma" => "Massachusetts",
392
+ "n-us-md" => "Maryland",
393
+ "n-us-me" => "Maine",
394
+ "n-us-mi" => "Michigan",
395
+ "n-us-mn" => "Minnesota",
396
+ "n-us-mo" => "Missouri",
397
+ "n-us-ms" => "Mississippi",
398
+ "n-us-mt" => "Montana",
399
+ "n-us-nb" => "Nebraska",
400
+ "n-us-nc" => "North Carolina",
401
+ "n-us-nd" => "North Dakota",
402
+ "n-us-nh" => "New Hampshire",
403
+ "n-us-nj" => "New Jersey",
404
+ "n-us-nm" => "New Mexico",
405
+ "n-us-nv" => "Nevada",
406
+ "n-us-ny" => "New York",
407
+ "n-us-oh" => "Ohio",
408
+ "n-us-ok" => "Oklahoma",
409
+ "n-us-or" => "Oregon",
410
+ "n-us-pa" => "Pennsylvania",
411
+ "n-us-ri" => "Rhode Island",
412
+ "n-us-sc" => "South Carolina",
413
+ "n-us-sd" => "South Dakota",
414
+ "n-us-tn" => "Tennessee",
415
+ "n-us-tx" => "Texas",
416
+ "n-us-ut" => "Utah",
417
+ "n-us-va" => "Virginia",
418
+ "n-us-vt" => "Vermont",
419
+ "n-us-wa" => "Washington (State)",
420
+ "n-us-wi" => "Wisconsin",
421
+ "n-us-wv" => "West Virginia",
422
+ "n-us-wy" => "Wyoming",
423
+ "n-usa" => "Appalachian Mountains",
424
+ "n-usc" => "Middle West",
425
+ "n-use" => "Northeastern States",
426
+ "n-usl" => "Middle Atlantic States",
427
+ "n-usm" => "Mississippi River",
428
+ "n-usn" => "New England",
429
+ "n-uso" => "Ohio River",
430
+ "n-usp" => "West (U.S.)",
431
+ "n-usr" => "East (U.S.)",
432
+ "n-uss" => "Missouri River",
433
+ "n-ust" => "Southwest, New",
434
+ "n-usu" => "Southern States",
435
+ "n-usw" => "Northwest (U.S.)", # discontinued
436
+ "n-xl" => "Saint Pierre and Miquelon",
437
+ "nc" => " Central America",
438
+ "ncbh" => "Belize",
439
+ "nccr" => "Costa Rica",
440
+ "nccz" => "Canal Zone",
441
+ "nces" => "El Salvador",
442
+ "ncgt" => "Guatemala",
443
+ "ncho" => "Honduras",
444
+ "ncnq" => "Nicaragua",
445
+ "ncpn" => "Panama",
446
+ "nl" => "Great Lakes (North America); Lake States",
447
+ "nm" => "Mexico, Gulf of",
448
+ "np" => "Great Plains",
449
+ "nr" => "Rocky Mountains",
450
+ "nw" => "West Indies",
451
+ "nwaq" => "Antigua and Barbuda",
452
+ "nwaw" => "Aruba",
453
+ "nwbb" => "Barbados",
454
+ "nwbc" => "Barbuda", # discontinued
455
+ "nwbf" => "Bahamas",
456
+ "nwbn" => "Bonaire",
457
+ "nwcj" => "Cayman Islands",
458
+ "nwco" => "Curaçao",
459
+ "nwcu" => "Cuba",
460
+ "nwdq" => "Dominica",
461
+ "nwdr" => "Dominican Republic",
462
+ "nweu" => "Sint Eustatius",
463
+ "nwga" => "Greater Antilles", # discontinued
464
+ "nwgd" => "Grenada",
465
+ "nwgp" => "Guadeloupe",
466
+ "nwgs" => "Grenadines", # discontinued
467
+ "nwhi" => "Hispaniola",
468
+ "nwht" => "Haiti",
469
+ "nwjm" => "Jamaica",
470
+ "nwla" => "Antilles, Lesser",
471
+ "nwli" => "Leeward Islands (West Indies)",
472
+ "nwmj" => "Montserrat",
473
+ "nwmq" => "Martinique",
474
+ "nwna" => "Netherlands Antilles", # discontinued
475
+ "nwpr" => "Puerto Rico",
476
+ "nwsb" => "Saint-Barthélemy", # discontinued
477
+ "nwsc" => "Saint-Barthélemy",
478
+ "nwsd" => "Saba",
479
+ "nwsn" => "Sint Maarten",
480
+ "nwst" => "Saint-Martin",
481
+ "nwsv" => "Swan Islands (Honduras)",
482
+ "nwtc" => "Turks and Caicos Islands",
483
+ "nwtr" => "Trinidad and Tobago",
484
+ "nwuc" => "United States Miscellaneous Caribbean Islands",
485
+ "nwvb" => "British Virgin Islands",
486
+ "nwvi" => "Virgin Islands of the United States",
487
+ "nwvr" => "Virgin Islands", # discontinued
488
+ "nwwi" => "Windward Islands (West Indies)",
489
+ "nwxa" => "Anguilla",
490
+ "nwxi" => "Saint Kitts and Nevis",
491
+ "nwxk" => "Saint Lucia",
492
+ "nwxm" => "Saint Vincent and the Grenadines",
493
+ "p" => "Pacific Ocean",
494
+ "pn" => "North Pacific Ocean",
495
+ "po" => "Oceania",
496
+ "poas" => "American Samoa",
497
+ "pobp" => "Solomon Islands",
498
+ "poci" => "Caroline Islands",
499
+ "pocp" => "Canton and Enderbury Islands", # discontinued
500
+ "pocw" => "Cook Islands",
501
+ "poea" => "Easter Island",
502
+ "pofj" => "Fiji",
503
+ "pofp" => "French Polynesia",
504
+ "pogg" => "Galapagos Islands",
505
+ "pogn" => "Gilbert and Ellice Islands", # discontinued
506
+ "pogu" => "Guam",
507
+ "poji" => "Johnston Island",
508
+ "pokb" => "Kiribati",
509
+ "poki" => "Kermadec Islands",
510
+ "poln" => "Line Islands",
511
+ "pome" => "Melanesia",
512
+ "pomi" => "Micronesia (Federated States)",
513
+ "ponl" => "New Caledonia",
514
+ "ponn" => "Vanuatu",
515
+ "ponu" => "Nauru",
516
+ "popc" => "Pitcairn Island",
517
+ "popl" => "Palau",
518
+ "pops" => "Polynesia",
519
+ "pory" => "Ryukyu Islands, Southern", # discontinued
520
+ "posc" => "Santa Cruz Islands", # discontinued
521
+ "posh" => "Samoan Islands",
522
+ "posn" => "Solomon Islands", # discontinued
523
+ "potl" => "Tokelau",
524
+ "poto" => "Tonga",
525
+ "pott" => "Micronesia",
526
+ "potv" => "Tuvalu",
527
+ "poup" => "United States Miscellaneous Pacific Islands",
528
+ "powf" => "Wallis and Futuna Islands",
529
+ "powk" => "Wake Island",
530
+ "pows" => "Samoa",
531
+ "poxd" => "Mariana Islands",
532
+ "poxe" => "Marshall Islands",
533
+ "poxf" => "Midway Islands",
534
+ "poxh" => "Niue",
535
+ "ps" => "South Pacific Ocean",
536
+ "q" => "Cold regions",
537
+ "r" => "Arctic Ocean; Arctic regions",
538
+ "s" => "South America",
539
+ "s-ag" => "Argentina",
540
+ "s-bl" => "Brazil",
541
+ "s-bo" => "Bolivia",
542
+ "s-ck" => "Colombia",
543
+ "s-cl" => "Chile",
544
+ "s-ec" => "Ecuador",
545
+ "s-fg" => "French Guiana",
546
+ "s-gy" => "Guyana",
547
+ "s-pe" => "Peru",
548
+ "s-py" => "Paraguay",
549
+ "s-sr" => "Suriname",
550
+ "s-uy" => "Uruguay",
551
+ "s-ve" => "Venezuela",
552
+ "sa" => "Amazon River",
553
+ "sn" => "Andes",
554
+ "sp" => "Rio de la Plata (Argentina and Uruguay)",
555
+ "t" => "Antarctic Ocean; Antarctica",
556
+ "t-ay" => "Antarctica", # discontinued
557
+ "u" => "Australasia",
558
+ "u-ac" => "Ashmore and Cartier Islands",
559
+ "u-at" => "Australia",
560
+ "u-at-ac" => "Australian Capital Territory",
561
+ "u-atc" => "Central Australia",
562
+ "u-ate" => "Eastern Australia",
563
+ "u-atn" => "Northern Australia",
564
+ "u-at-ne" => "New South Wales",
565
+ "u-at-no" => "Northern Territory",
566
+ "u-at-qn" => "Queensland",
567
+ "u-at-sa" => "South Australia",
568
+ "u-at-tm" => "Tasmania",
569
+ "u-at-vi" => "Victoria",
570
+ "u-at-we" => "Western Australia",
571
+ "u-cs" => "Coral Sea Islands",
572
+ "u-nz" => "New Zealand",
573
+ "v" => "Communist countries", # discontinued
574
+ "w" => "Tropics",
575
+ "x" => "Earth",
576
+ "xa" => "Eastern Hemisphere",
577
+ "xb" => "Northern Hemisphere",
578
+ "xc" => "Southern Hemisphere",
579
+ "xd" => "Western Hemisphere",
580
+ "zd" => "Deep space",
581
+ "zju" => "Jupiter",
582
+ "zma" => "Mars",
583
+ "zme" => "Mercury",
584
+ "zmo" => "Moon",
585
+ "zne" => "Neptune",
586
+ "zo" => "Outer space",
587
+ "zpl" => "Pluto",
588
+ "zs" => "Solar system",
589
+ "zsa" => "Saturn",
590
+ "zsu" => "Sun",
591
+ "zur" => "Uranus",
592
+ "zve" => "Venus"
593
+ }.freeze
594
+
595
+ def self.fetch(key)
596
+ TERMS.fetch(key)
597
+ end
598
+ end
599
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Marc
4
+ module Vocab
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/marc/vocab/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "marc-vocab"
7
+ spec.version = Marc::Vocab::VERSION
8
+ spec.authors = ["Justin Coyne"]
9
+ spec.email = ["jcoyne@justincoyne.com"]
10
+
11
+ spec.summary = "Has vocabularies used by MARC"
12
+ spec.description = "Currently includes Geographic Areas"
13
+ spec.homepage = "https://github.com/sul-dlss/marc-vocab"
14
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
15
+
16
+ # spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
17
+
18
+ spec.metadata["homepage_uri"] = spec.homepage
19
+ spec.metadata["source_code_uri"] = "https://github.com/sul-dlss/marc-vocab"
20
+ # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
21
+
22
+ # Specify which files should be added to the gem when it is released.
23
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
24
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
25
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
26
+ end
27
+ spec.bindir = "exe"
28
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
29
+ spec.require_paths = ["lib"]
30
+
31
+ # Uncomment to register a new dependency of your gem
32
+ # spec.add_dependency "example-gem", "~> 1.0"
33
+
34
+ # For more information and examples about making a new gem, checkout our
35
+ # guide at: https://bundler.io/guides/creating_gem.html
36
+ end
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: marc-vocab
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Justin Coyne
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2021-04-27 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Currently includes Geographic Areas
14
+ email:
15
+ - jcoyne@justincoyne.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".github/workflows/main.yml"
21
+ - ".gitignore"
22
+ - ".rspec"
23
+ - ".rubocop.yml"
24
+ - Gemfile
25
+ - Gemfile.lock
26
+ - README.md
27
+ - Rakefile
28
+ - bin/console
29
+ - bin/setup
30
+ - lib/marc/vocab.rb
31
+ - lib/marc/vocab/geographic_area.rb
32
+ - lib/marc/vocab/version.rb
33
+ - marc-vocab.gemspec
34
+ homepage: https://github.com/sul-dlss/marc-vocab
35
+ licenses: []
36
+ metadata:
37
+ homepage_uri: https://github.com/sul-dlss/marc-vocab
38
+ source_code_uri: https://github.com/sul-dlss/marc-vocab
39
+ post_install_message:
40
+ rdoc_options: []
41
+ require_paths:
42
+ - lib
43
+ required_ruby_version: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 2.7.0
48
+ required_rubygems_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - ">="
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ requirements: []
54
+ rubygems_version: 3.1.4
55
+ signing_key:
56
+ specification_version: 4
57
+ summary: Has vocabularies used by MARC
58
+ test_files: []