Module: WCID
- Defined in:
- lib/wcid.rb,
lib/wcid/id.rb,
lib/wcid/hit.rb,
lib/wcid/search.rb
Defined Under Namespace
Instance Method Summary collapse
-
#marc_file_to_auths(filename) ⇒ Object
given one or more MARC records it returns an array of associated name authorities as MARC::Record objects.
Instance Method Details
#marc_file_to_auths(filename) ⇒ Object
given one or more MARC records it returns an array of associated name authorities as MARC::Record objects
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/wcid.rb', line 29 def marc_file_to_auths(filename) = [] records = MARC::Reader.new(filename).to_a records.each do | record | fields = record.name_fields fields.each do | field | query = field.pnkey_from_marc wcid_obj = (WCID::Search.new(query)).search_exact next if wcid_obj.nil? auth = wcid_obj.get_lc_auth next if auth.nil? << auth end end return end |