lib/traject/lbcc_format_classifier.rb
def genre
        marc_genre_leader = Traject::TranslationMap.new("marc_genre_leader_lbcc")
        marc_genre_007    = Traject::TranslationMap.new("marc_genre_007_lbcc")

        results = marc_genre_leader[ record.leader.slice(6,2) ] ||
          marc_genre_leader[ record.leader.slice(6)] ||
          record.find_all {|f| f.tag == "007"}.collect {|f| marc_genre_007[f.value.slice(0)]}

        [results].flatten
      end
# Returns 1 or more values in an array from:
# Book; Journal/Newspaper; Musical Score; Map/Globe; Non-musical Recording; Musical Recording
# Image; Software/Data; Video/Film
#
# Uses leader byte 6, leader byte 7, and 007 byte 0.
#
# Gets actual labels from marc_genre_leader and marc_genre_007 translation maps,
# so you can customize labels if you want.
Returns 1 or more values in an array from:
Book; Journal/Newspaper; Musical Score; Map/Globe; Non-musical Recording; Musical Recording
Image; Software/Data; Video/Film

Uses leader byte 6, leader byte 7, and 007 byte 0.

Gets actual labels from marc_genre_leader and marc_genre_007 translation maps,
so you can customize labels if you want.
Returns 1 or more values in an array from : Book ; Journal / Newspaper ; Musical Score ; Map / Globe ; Non - musical Recording ; Musical Recording Image ; Software / Data ; Video / Film Uses leader byte 6 leader byte 7 and 007 byte 0 . Gets actual labels from marc_genre_leader and marc_genre_007 translation maps so you can customize labels if you want .
def genre
        marc_genre_leader = Traject::TranslationMap.new("marc_genre_leader_lbcc")
        marc_genre_007    = Traject::TranslationMap.new("marc_genre_007_lbcc")
        results = marc_genre_leader[ record.leader.slice(6,2) ] ||
          marc_genre_leader[ record.leader.slice(6)] ||
          record.find_all {|f| f.tag == "007"}.collect {|f| marc_genre_007[f.value.slice(0)]}
        [results].flatten
      end
def genre marc_genre_leader = Traject :: TranslationMap . new ( "marc_genre_leader_lbcc" ) marc_genre_007 = Traject :: TranslationMap . new ( "marc_genre_007_lbcc" ) results = marc_genre_leader [ record . leader . slice ( 6 , 2 ) ] || marc_genre_leader [ record . leader . slice ( 6 ) ] || record . find_all { | f | f . tag == "007" } . collect { | f | marc_genre_007 [ f . value . slice ( 0 ) ] } [ results ] . flatten end
Returns 1 or more values in an array from:
Book; Journal/Newspaper; Musical Score; Map/Globe; Non-musical Recording; Musical Recording
Image; Software/Data; Video/Film
Returns 1 or more values in an array from : Book ; Journal / Newspaper ; Musical Score ; Map / Globe ; Non - musical Recording ; Musical Recording Image ; Software / Data ; Video / Film