enhanced_marc 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Changes +1 -0
- data/LICENSE +21 -0
- data/README +51 -0
- data/Rakefile +41 -0
- data/VERSION +1 -0
- data/enhanced_marc-0.1.gem +0 -0
- data/enhanced_marc.gemspec +85 -0
- data/lib/enhanced_marc.rb +23 -0
- data/lib/enhanced_marc/book_record.rb +37 -0
- data/lib/enhanced_marc/book_type.rb +87 -0
- data/lib/enhanced_marc/computer_record.rb +37 -0
- data/lib/enhanced_marc/computer_type.rb +14 -0
- data/lib/enhanced_marc/leader.rb +132 -0
- data/lib/enhanced_marc/leftovers.rb +122 -0
- data/lib/enhanced_marc/map_record.rb +38 -0
- data/lib/enhanced_marc/map_type.rb +99 -0
- data/lib/enhanced_marc/mixed_record.rb +37 -0
- data/lib/enhanced_marc/mixed_type.rb +4 -0
- data/lib/enhanced_marc/reader.rb +105 -0
- data/lib/enhanced_marc/record.rb +96 -0
- data/lib/enhanced_marc/record_type.rb +310 -0
- data/lib/enhanced_marc/score_record.rb +38 -0
- data/lib/enhanced_marc/score_type.rb +4 -0
- data/lib/enhanced_marc/serial_record.rb +37 -0
- data/lib/enhanced_marc/serial_type.rb +87 -0
- data/lib/enhanced_marc/sound_record.rb +37 -0
- data/lib/enhanced_marc/sound_type.rb +4 -0
- data/lib/enhanced_marc/visual_record.rb +37 -0
- data/lib/enhanced_marc/visual_type.rb +38 -0
- data/lib/enhanced_marc/xmlreader.rb +58 -0
- data/pkg/enhanced_marc-0.1.gem +0 -0
- data/pkg/enhanced_marc-0.1.tgz +0 -0
- data/pkg/enhanced_marc-0.1.zip +0 -0
- data/pkg/enhanced_marc-0.1/Changes +1 -0
- data/pkg/enhanced_marc-0.1/LICENSE +21 -0
- data/pkg/enhanced_marc-0.1/README +51 -0
- data/pkg/enhanced_marc-0.1/Rakefile +41 -0
- data/pkg/enhanced_marc-0.1/test/ts_enhanced_marc.rb +5 -0
- data/test/ts_enhanced_marc.rb +5 -0
- metadata +113 -0
@@ -0,0 +1,310 @@
|
|
1
|
+
module RecordType
|
2
|
+
|
3
|
+
private
|
4
|
+
|
5
|
+
def is_govdoc?(human_readable=false)
|
6
|
+
govdoc_map={'a'=>'Autonomous or semiautonomous components', 'c'=>'Multilocal', 'f'=>'Federal',
|
7
|
+
'i'=>'International', 'l'=>'Local', 'm'=>'Multistate', 'o'=>'Undetermined', 's'=>'State', 'u'=>'Unknown', 'z'=>'Other'}
|
8
|
+
human_readable = govdoc_map if human_readable
|
9
|
+
return self.field_parser({:match=>/^BKS$|^COM$|^MAP$|^SER$|^VIS$/, :start=>28,:end=>1}, {:match=>/[atmefsgkor]{1}/, :start=>11,:end=>1}, human_readable)
|
10
|
+
end
|
11
|
+
|
12
|
+
def nature_of_contents(human_readable=false)
|
13
|
+
cont_map = {'a'=>'Abstracts','b'=>'Bibliography','c'=>'Catalog','d'=>'Dictionary',
|
14
|
+
'e'=>'Encyclopedia', 'f'=>'Handbook', 'g'=>'Legal article', 'h'=>'Biography', 'i'=>'Index',
|
15
|
+
'j'=>'Patent document', 'k'=>'Discography', 'l'=>'Legislation', 'm'=>'Thesis', 'n'=>'Literature survey',
|
16
|
+
'o'=>'Review', 'p'=>'Programmed text', 'q'=>'Filmography', 'r'=>'Directory', 's'=>'Statistics',
|
17
|
+
't'=>'Technical report', 'u'=>'Standard/specification', 'v'=>'Legal case', 'w'=>'Law report', 'x'=>'Other report',
|
18
|
+
'y'=>'Yearbook', 'z'=>'Treaty', '2'=>'Offprint', '5'=>'Calendar', '6'=>'Comic/Graphic Novel'}
|
19
|
+
|
20
|
+
contents = []
|
21
|
+
idx = nil
|
22
|
+
if self.record_type == 'BKS'
|
23
|
+
idx = 24
|
24
|
+
len = 4
|
25
|
+
elsif self.record_type == 'SER'
|
26
|
+
idx = 25
|
27
|
+
len = 3
|
28
|
+
end
|
29
|
+
if idx
|
30
|
+
self['008'].value[idx,len].split(//).each { | char |
|
31
|
+
next if char == " "
|
32
|
+
if human_readable
|
33
|
+
contents << cont_map[char] if cont_map[char]
|
34
|
+
else
|
35
|
+
contents << char
|
36
|
+
end
|
37
|
+
}
|
38
|
+
end
|
39
|
+
@fields.find_all {|f| ('006') === f.tag}.each { | fxd_fld |
|
40
|
+
idx = nil
|
41
|
+
if fxd_fld.value[0,1].match(/[at]{1}/)
|
42
|
+
idx = 7
|
43
|
+
len = 4
|
44
|
+
elsif fxd_fld.value[0,1].match('s')
|
45
|
+
idx = 8
|
46
|
+
len = 3
|
47
|
+
end
|
48
|
+
if idx
|
49
|
+
fxd_fld.value[idx,len].split(//).each { | char |
|
50
|
+
next if char == " "
|
51
|
+
if human_readable
|
52
|
+
contents << cont_map[char] if cont_map[char]
|
53
|
+
else
|
54
|
+
contents << char
|
55
|
+
end
|
56
|
+
}
|
57
|
+
end
|
58
|
+
}
|
59
|
+
return false if contents.empty?
|
60
|
+
return contents
|
61
|
+
end
|
62
|
+
|
63
|
+
|
64
|
+
def is_conference?
|
65
|
+
return true if self['008'].value[29,1] == '1' && @record_type.match(/^BKS$|^SER$/)
|
66
|
+
return true if self['008'].value[30,2].match(/c/) && @record_type.match(/^SCO$|^REC$/)
|
67
|
+
@fields.find_all {|f| ('006') === f.tag}.each { | fxd_fld |
|
68
|
+
return true if fxd_fld.value[12,1] == '1' && fxd_fld.value[0,1].match(/[ats]{1}/)
|
69
|
+
|
70
|
+
return true if fxd_fld.value[13,2].match(/c/) && fxd_fld.value[0,1].match(/[cdij]{1}/)
|
71
|
+
}
|
72
|
+
return false
|
73
|
+
end
|
74
|
+
|
75
|
+
def set_conference(value=false, field=nil)
|
76
|
+
if field
|
77
|
+
return Exception.new("Field is not an 006") unless field.tag == '006'
|
78
|
+
return Exception.new("Field is not a BKS or SER") unless field.value[0,1].match(/[ats]{1}/)
|
79
|
+
if value
|
80
|
+
field.value[12] = '1'
|
81
|
+
else
|
82
|
+
field.value[12] = '0'
|
83
|
+
end
|
84
|
+
else
|
85
|
+
field = @fields['008']
|
86
|
+
field = MARC::Controlfield.new('008') unless field
|
87
|
+
if value
|
88
|
+
field[29] = '1'
|
89
|
+
else
|
90
|
+
field[29] = '0'
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
95
|
+
|
96
|
+
def accompanying_matter(human_readable=false)
|
97
|
+
accm_map = {'a'=>'Discography','b'=>'Bibliography','c'=>'Thematic index','d'=>'Libretto',
|
98
|
+
'e'=>'Composer biography', 'f'=>'Performer biography', 'g'=>'Technical/historical information on instruments',
|
99
|
+
'h'=>'Technical information on music', 'i'=>'Historical information', 'j'=>'Historical information other than music',
|
100
|
+
'k'=>'Ethnological information', 'n'=>'Not applicable', 'r'=>'Instructional materials', 's'=>'Music',
|
101
|
+
'z'=>'Other accompanying matter'}
|
102
|
+
matter = []
|
103
|
+
|
104
|
+
if ['SCO', 'REC'].index(@record_type)
|
105
|
+
self['008'].value[24,6].split(//).each { | char |
|
106
|
+
next if char == " "
|
107
|
+
if human_readable
|
108
|
+
matter << accm_map[char] if accm_map[char]
|
109
|
+
else
|
110
|
+
matter << char
|
111
|
+
end
|
112
|
+
}
|
113
|
+
end
|
114
|
+
@fields.find_all {|f| ('006') === f.tag}.each { | fxd_fld |
|
115
|
+
|
116
|
+
if fxd_fld.value[0,1].match(/[cdij]{1}/)
|
117
|
+
fxd_fld.value[7,6].split(//).each { | char |
|
118
|
+
next if char == " "
|
119
|
+
if human_readable
|
120
|
+
matter << accm_map[char]
|
121
|
+
else
|
122
|
+
matter << char
|
123
|
+
end
|
124
|
+
}
|
125
|
+
end
|
126
|
+
}
|
127
|
+
return false if matter.empty?
|
128
|
+
return matter
|
129
|
+
end
|
130
|
+
|
131
|
+
def audience_level(human_readable=false)
|
132
|
+
audn_map = {'a'=>'Preschool', 'b'=>'Children age 6-8', 'c'=>'Children age 9-13',
|
133
|
+
'd'=>'Adolescent', 'e'=>'Adult', 'f'=>'Specialized', 'g'=>'General', 'j'=>'Juvenile'
|
134
|
+
}
|
135
|
+
human_readable = audn_map if human_readable
|
136
|
+
return self.field_parser({:match=>/^BKS$|^VIS$|^MIX$|^MAP$|^SCO$|^REC$|^COM$/, :start=>22,:end=>1}, {:match=>/[atmefpcdijgkor]{1}/, :start=>5,:end=>1}, human_readable)
|
137
|
+
end
|
138
|
+
|
139
|
+
def form(human_readable=false)
|
140
|
+
form_map = {'a'=>'Microfilm', 'b'=>'Microfiche', 'c'=>'Microopaque',
|
141
|
+
'd'=>'Large print', 'f'=>'Braille', 'r'=>'Reproduction', 's'=>'Electronic'
|
142
|
+
}
|
143
|
+
idx = nil
|
144
|
+
if self.record_type.match(/^MAP$|^VIS$/)
|
145
|
+
idx = 29
|
146
|
+
else
|
147
|
+
idx = 23
|
148
|
+
end
|
149
|
+
unless self['008'].value[idx,1] == ' '
|
150
|
+
if human_readable
|
151
|
+
return form_map[self['008'].value[idx,1]]
|
152
|
+
else
|
153
|
+
return self['008'].value[idx,1]
|
154
|
+
end
|
155
|
+
end
|
156
|
+
@fields.find_all {|f| ('006') === f.tag}.each { | fxd_fld |
|
157
|
+
idx = nil
|
158
|
+
if fxd_fld.value[0,1].match(/[efgkor]{1}/)
|
159
|
+
idx = 6
|
160
|
+
else
|
161
|
+
idx = 12
|
162
|
+
end
|
163
|
+
next if fxd_fld.value[idx,1] == ' '
|
164
|
+
if human_readable
|
165
|
+
return form_map[fxd_fld.value[idx,1]]
|
166
|
+
else
|
167
|
+
return fxd_fld.value[idx,1]
|
168
|
+
end
|
169
|
+
}
|
170
|
+
return false
|
171
|
+
end
|
172
|
+
|
173
|
+
def has_index?
|
174
|
+
return true if self['008'].value[31,1] == '1'
|
175
|
+
@fields.find_all {|f| ('006') === f.tag}.each { | fxd_fld |
|
176
|
+
return true if fxd_fld.value[14,1] == '1'
|
177
|
+
}
|
178
|
+
return false
|
179
|
+
end
|
180
|
+
|
181
|
+
def composition_form(human_readable=false)
|
182
|
+
comp_map = {'an'=>'Anthem','bd'=>'Ballad','bt'=>'Ballet','bg'=>'Bluegrass music',
|
183
|
+
'bl'=>'Blues','cn'=>'Canon or round','ct'=>'Catata','cz'=>'Canzona','cr'=>'Carol',
|
184
|
+
'ca'=>'Chaconne','cs'=>'Chance composition','cp'=>'Polyphonic chanson','cc'=>'Christian chant',
|
185
|
+
'cb'=>'Chant','cl'=>'Chorale prelude','ch'=>'Chorale','cg'=>'Concerti grossi','co'=>'Concerto',
|
186
|
+
'cy'=>'Country music','df'=>'Dance form','dv'=>'Divertimento/serenade/cassation/divertissement/notturni',
|
187
|
+
'ft'=>'Fantasia','fm'=>'Folk music','fg'=>'Fugue','gm'=>'Gospel music','hy'=>"Hymn",'jz'=>'Jazz',
|
188
|
+
'md'=>'Madrigal','mr'=>'March','ms'=>'Mass','mz'=>'Mazurka','mi'=>'Minuet','mo'=>'Motet',
|
189
|
+
'mp'=>'Motion picture music','mu'=>'Multiple forms','mc'=>'Musical revue/comedy',
|
190
|
+
'nc'=>'Nocturne','nn'=>'Not a musical recording','op'=>'Opera','or'=>'Oratorio',
|
191
|
+
'ov'=>'Overture','pt'=>'Part-song','ps'=>'Passacaglia','pm'=>'Passion music',
|
192
|
+
'pv'=>'Pavanes','po'=>'Polonaises','pp'=>'Popular music','pr'=>'Prelude','pg'=>'Program music',
|
193
|
+
'rg'=>'Ragtime music','rq'=>'Requiem','rp'=>'Rhapsody','ri'=>'Ricercars','rc'=>'Rock music',
|
194
|
+
'rd'=>'Rondo','sn'=>'Sonata','sg'=>'Song','sd'=>'Square dance music','st'=>'Study/exercise',
|
195
|
+
'su'=>'Suite','sp'=>'Symphonic poem','sy'=>'Symphony','tc'=>'Toccata','ts'=>'Trio-sonata',
|
196
|
+
'uu'=>'Unknown','vr'=>'Variation','wz'=>'Waltz','zz'=>'Other'
|
197
|
+
}
|
198
|
+
if @record_type.match(/^SCO$|^REC$/)
|
199
|
+
unless self['008'].value[18,2] == ' '
|
200
|
+
if human_readable
|
201
|
+
return comp_map[self['008'].value[18,2]]
|
202
|
+
else
|
203
|
+
return self['008'].value[18,2]
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
@fields.find_all {|f| ('006') === f.tag}.each { | fxd_fld |
|
208
|
+
next unless fxd_fld.value[0,1].match(/[cdij]{1}/)
|
209
|
+
unless fxd_fld.value[1,2] == ' '
|
210
|
+
if human_readable
|
211
|
+
return comp_map[fxd_fld.value[1,2]]
|
212
|
+
else
|
213
|
+
return fxd_fld.value[1,2]
|
214
|
+
end
|
215
|
+
end
|
216
|
+
}
|
217
|
+
return false
|
218
|
+
end
|
219
|
+
|
220
|
+
def music_format(human_readable=false)
|
221
|
+
fmus_map = {'a'=>'Full score','b'=>'Full score, miniature/study size','c'=>'Accompaniment reduced for keyboard',
|
222
|
+
'd'=>'Voice score','e'=>'Condensed score','g'=>'Close score','m'=>'Multiple formats','n'=>'N/A',
|
223
|
+
'u'=>'Unknown','z'=>'Other'}
|
224
|
+
human_readable = fmus_map if human_readable
|
225
|
+
return self.field_parser({:match=>/^SCO$|^REC$/, :start=>20,:end=>1}, {:match=>/[cdij]{1}/, :start=>3,:end=>1}, human_readable)
|
226
|
+
# if self.record_type.match(/^SCO$|^REC$/)
|
227
|
+
# unless self['008'].value[20,1] == ' '
|
228
|
+
# if human_readable
|
229
|
+
# return fmus_map[self['008'].value[20,1]]
|
230
|
+
# else
|
231
|
+
# return self['008'].value[20,1]
|
232
|
+
# end
|
233
|
+
# end
|
234
|
+
# end
|
235
|
+
## @fields.find_all {|f| ('006') === f.tag}.each { | fxd_fld |
|
236
|
+
# next unless fxd_fld.value[0,1].match(/[cdij]{1}/)
|
237
|
+
# next if fxd_fld.value[3,1] == ' '
|
238
|
+
# if human_readable
|
239
|
+
# return fmus_map[fxd_fld.value[3,1]]
|
240
|
+
# else
|
241
|
+
# return fxd_fld.value[3,1]
|
242
|
+
# end
|
243
|
+
# }
|
244
|
+
# return false
|
245
|
+
end
|
246
|
+
|
247
|
+
def has_index?
|
248
|
+
return true if self['008'].value[31,1] == '1'
|
249
|
+
@fields.find_all {|f| ('006') === f.tag}.each { | fxd_fld |
|
250
|
+
return true if fxd_fld.value[14,1] == '1'
|
251
|
+
}
|
252
|
+
return false
|
253
|
+
end
|
254
|
+
|
255
|
+
def literary_text(human_readable=true)
|
256
|
+
ltxt_map = {'a'=>'Autobiography', 'b'=>'Biography','c'=>'Conference proceeding','d'=>'Drama',
|
257
|
+
'e'=>'Essay','f'=>'Fiction','g'=>'Reporting','h'=>'History','i'=>'Instruction','j'=>'Language instruction',
|
258
|
+
'k'=>'Comedy','l'=>'Lecture/speech','m'=>'Memoir','n'=>'N/A','o'=>'Folktale','p'=>'Poetry','r'=>'Rehearsal',
|
259
|
+
's'=>'Sounds','t'=>'Interview','z'=>'Other'}
|
260
|
+
txts = []
|
261
|
+
|
262
|
+
if ['SCO', 'REC'].index(@record_type)
|
263
|
+
self['008'].value[30,2].split(//).each { | char |
|
264
|
+
next if char == " "
|
265
|
+
if human_readable
|
266
|
+
txts << ltxt_map[char]
|
267
|
+
else
|
268
|
+
txts << char
|
269
|
+
end
|
270
|
+
}
|
271
|
+
end
|
272
|
+
@fields.find_all {|f| ('006') === f.tag}.each { | fxd_fld |
|
273
|
+
|
274
|
+
if fxd_fld.value[0,1].match(/[cdij]{1}/)
|
275
|
+
fxd_fld.value[13,2].split(//).each { | char |
|
276
|
+
next if char == " "
|
277
|
+
if human_readable
|
278
|
+
txts << ltxt_map[char]
|
279
|
+
else
|
280
|
+
txts << char
|
281
|
+
end
|
282
|
+
}
|
283
|
+
end
|
284
|
+
}
|
285
|
+
return false if txts.empty?
|
286
|
+
return txts
|
287
|
+
end
|
288
|
+
protected
|
289
|
+
def field_parser(eight, six, human_readable_map=nil)
|
290
|
+
if self.record_type.match(eight[:match])
|
291
|
+
unless self['008'].value[eight[:start],eight[:end]] == ' '*eight[:end]
|
292
|
+
if human_readable_map
|
293
|
+
return human_readable_map[self['008'].value[eight[:start],eight[:end]]]
|
294
|
+
else
|
295
|
+
return self['008'].value[eight[:start],eight[:end]]
|
296
|
+
end
|
297
|
+
end
|
298
|
+
end
|
299
|
+
@fields.find_all {|f| ('006') === f.tag}.each { | fxd_fld |
|
300
|
+
next unless fxd_fld.value[0,1].match(six[:match])
|
301
|
+
next if fxd_fld.value[six[:start],six[:end]] == ' '*six[:end]
|
302
|
+
if human_readable_map
|
303
|
+
return human_readable_map[fxd_fld.value[six[:start],six[:end]]]
|
304
|
+
else
|
305
|
+
return fxd_fld.value[six[:start],six[:end]]
|
306
|
+
end
|
307
|
+
}
|
308
|
+
return false
|
309
|
+
end
|
310
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module MARC
|
2
|
+
|
3
|
+
# A class that represents an individual MARC record. Every record
|
4
|
+
# is made up of a collection of MARC::Field objects.
|
5
|
+
|
6
|
+
class ScoreRecord < Record
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
super
|
10
|
+
@leader[6] = 'c' if @leader[6,1] == ' '
|
11
|
+
@leader[7] = 'm' if @leader[7,1] == ' '
|
12
|
+
@record_type = 'SCO'
|
13
|
+
@bibliographic_level = @leader.get_blvl
|
14
|
+
self.extend ScoreType
|
15
|
+
self.inspect_fixed_fields
|
16
|
+
end
|
17
|
+
|
18
|
+
def is_valid_type?
|
19
|
+
return false unless @leader[6,1].match(/[cd]{1}/)
|
20
|
+
return true
|
21
|
+
end
|
22
|
+
def is_valid_blvl?
|
23
|
+
return true if @leader[7,1].match(/[acdim]{1}/) and @leader[6,1].match('d')
|
24
|
+
return true if @leader[7,1].match(/[abcdims]{1}/) and @leader[6,1].match('c')
|
25
|
+
return false
|
26
|
+
end
|
27
|
+
def self.new_from_record(record)
|
28
|
+
rec = ScoreRecord.new
|
29
|
+
record.instance_variables.each { | var |
|
30
|
+
rec.instance_variable_set(var, record.instance_variable_get(var))
|
31
|
+
}
|
32
|
+
return Exception.new("Incorrect type declaration in leader") unless rec.is_valid_type?
|
33
|
+
return Exception.new("Incorrect bibliographic declaration in leader") unless rec.is_valid_blvl?
|
34
|
+
return rec
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module MARC
|
2
|
+
|
3
|
+
# A class that represents an individual MARC record. Every record
|
4
|
+
# is made up of a collection of MARC::Field objects.
|
5
|
+
|
6
|
+
class SerialRecord < Record
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
super
|
10
|
+
@leader[6] = 'a' if @leader[6,1] == ' '
|
11
|
+
@leader[7] = 's' if @leader[7,1] == ' '
|
12
|
+
@record_type = 'SER'
|
13
|
+
@bibliographic_level = @leader.get_blvl
|
14
|
+
self.extend SerialType
|
15
|
+
self.inspect_fixed_fields
|
16
|
+
end
|
17
|
+
|
18
|
+
def is_valid_type?
|
19
|
+
return false unless @leader[6,1].match('a')
|
20
|
+
return true
|
21
|
+
end
|
22
|
+
def is_valid_blvl?
|
23
|
+
return false unless @leader[7,1].match(/[bis]{1}/)
|
24
|
+
return true
|
25
|
+
end
|
26
|
+
def self.new_from_record(record)
|
27
|
+
rec = SerialRecord.new
|
28
|
+
record.instance_variables.each { | var |
|
29
|
+
rec.instance_variable_set(var, record.instance_variable_get(var))
|
30
|
+
}
|
31
|
+
return Exception.new("Incorrect type declaration in leader") unless rec.is_valid_type?
|
32
|
+
return Exception.new("Incorrect bibliographic declaration in leader") unless rec.is_valid_blvl?
|
33
|
+
return rec
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
module SerialType
|
2
|
+
include RecordType
|
3
|
+
public :is_govdoc?, :nature_of_contents, :is_conference?, :form
|
4
|
+
def alphabet(human_readable=false)
|
5
|
+
alph_map = {'a'=>'Roman', 'b'=>'Extended Roman', 'c'=>'Cyrillic',
|
6
|
+
'd'=>'Japanese', 'e'=>'Chinese', 'f'=>'Arabic', 'g'=>'Greek',
|
7
|
+
'h'=>'Hebrew', 'i'=>'Thai', 'j'=>'Devanagari', 'k'=>'Korean', 'l'=>'Tamil',
|
8
|
+
'u'=>'Unknown', 'z'=>'Other'
|
9
|
+
}
|
10
|
+
human_readable = alph_map if human_readable
|
11
|
+
return self.field_parser({:match=>'SER', :start=>33,:end=>1}, {:match=>'s', :start=>16,:end=>1}, human_readable)
|
12
|
+
end
|
13
|
+
|
14
|
+
def frequency(human_readable=false)
|
15
|
+
freq_map = {'a'=>'Annual','b'=>'Bimonthly','c'=>'Semiweekly','d'=>'Daily',
|
16
|
+
'e'=>'Biweekly','f'=>'Semiannual','g'=>'Biennial','h'=>'Triennial','i'=>'3 times/week',
|
17
|
+
'j'=>'3 times/month', 'k'=>'Continuously updated','m'=>'Monthly','q'=>'Quarterly',
|
18
|
+
's'=>'Semimonthly','t'=>'3 times/year','u'=>'Unknown','w'=>'Weekly','z'=>'Other'
|
19
|
+
}
|
20
|
+
human_readable = freq_map if human_readable
|
21
|
+
resp = self.field_parser({:match=>'SER', :start=>18,:end=>1}, {:match=>'s', :start=>1,:end=>1}, human_readable)
|
22
|
+
return resp if resp
|
23
|
+
if human_readable
|
24
|
+
return 'No determinable frequency'
|
25
|
+
else
|
26
|
+
return false
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def regularity(human_readable=false)
|
31
|
+
regl_map = {'n'=>'Normalized irregular','r'=>'Regular','u'=>'Unknown','x'=>'Completely irregular'}
|
32
|
+
human_readable = regl_map if human_readable
|
33
|
+
return self.field_parser({:match=>'SER', :start=>19,:end=>1}, {:match=>'s', :start=>2,:end=>1}, human_readable)
|
34
|
+
end
|
35
|
+
|
36
|
+
def serial_type(human_readable=false)
|
37
|
+
srtp_map = {'d'=>'Database','l'=>'Loose-leaf','m'=>'Monographic series','n'=>'Newspaper','p'=>'Periodical','w'=>'Website'}
|
38
|
+
human_readable = srtp_map if human_readable
|
39
|
+
resp = self.field_parser({:match=>'SER', :start=>21,:end=>1}, {:match=>'s', :start=>4,:end=>1}, human_readable)
|
40
|
+
return resp if resp
|
41
|
+
if human_readable
|
42
|
+
return 'Other'
|
43
|
+
else
|
44
|
+
return false
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
def original_form(human_readable=false)
|
49
|
+
orig_map = {'a'=>'Microfilm','b'=>'Microfiche','c'=>'Microopaque','d'=>'Large print',
|
50
|
+
'e'=>'Newspaper format','f'=>'Braille','s'=>'Electronic'}
|
51
|
+
human_readable = orig_map if human_readable
|
52
|
+
resp = self.field_parser({:match=>'SER', :start=>22,:end=>1}, {:match=>'s', :start=>5,:end=>1}, human_readable)
|
53
|
+
return resp if resp
|
54
|
+
|
55
|
+
if human_readable
|
56
|
+
return 'Other'
|
57
|
+
else
|
58
|
+
return false
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
def nature_of_work(human_readable=false)
|
64
|
+
entw_map = {'a'=>'Abstracts','b'=>'Bibliography','c'=>'Catalog','d'=>'Dictionary',
|
65
|
+
'e'=>'Encyclopedia', 'f'=>'Handbook', 'g'=>'Legal article', 'h'=>'Biography', 'i'=>'Index',
|
66
|
+
'j'=>'Patent document', 'k'=>'Discography', 'l'=>'Legislation', 'm'=>'Thesis', 'n'=>'Literature survey',
|
67
|
+
'o'=>'Review', 'p'=>'Programmed text', 'q'=>'Filmography', 'r'=>'Directory', 's'=>'Statistics',
|
68
|
+
't'=>'Technical report', 'u'=>'Standard/specification', 'v'=>'Legal case', 'w'=>'Law report', 'x'=>'Other report',
|
69
|
+
'z'=>'Treaty'}
|
70
|
+
|
71
|
+
human_readable = entw_map if human_readable
|
72
|
+
resp = self.field_parser({:match=>'SER', :start=>24,:end=>1}, {:match=>'s', :start=>7,:end=>1}, human_readable)
|
73
|
+
return resp if resp
|
74
|
+
if human_readable
|
75
|
+
return 'Not specified'
|
76
|
+
else
|
77
|
+
return false
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
|
82
|
+
def entry(human_readable=false)
|
83
|
+
entry_map = {'0'=>'Successive','1'=>'Latest','2'=>'Integrated'}
|
84
|
+
human_readable = entry_map if human_readable
|
85
|
+
return self.field_parser({:match=>'SER', :start=>34,:end=>1}, {:match=>'s', :start=>17,:end=>1}, human_readable)
|
86
|
+
end
|
87
|
+
end
|