def marc_lcsh_formatted(options = {})
      spec            = options[:spec] || "600:610:611:630:648:650:651:654:662"
      subd_separator  = options[:subdivison_separator] || " — "
      other_separator = options[:other_separator] || " "

      extractor       = MarcExtractor.new(spec)

      return lambda do |record, accumulator|
        accumulator.concat( extractor.collect_matching_lines(record) do |field, spec|
          Marc21Semantics.assemble_lcsh(field, subd_separator, other_separator)
        end)
      end

    end
def marc_lcsh_formatted(options = {})
      spec            = options[:spec] || "600:610:611:630:648:650:651:654:662"
      subd_separator  = options[:subdivison_separator] || " — "
      other_separator = options[:other_separator] || " "

      extractor       = MarcExtractor.new(spec)

      return lambda do |record, accumulator|
        accumulator.concat( extractor.collect_matching_lines(record) do |field, spec|
          Marc21Semantics.assemble_lcsh(field, subd_separator, other_separator)
        end)
      end

    end
Extracts LCSH-carrying fields, and formatting them
 as a pre-coordinated LCSH string, for instance suitable for including
 in a facet.

 You can supply your own list of fields as a spec, but for significant
 customization you probably just want to write your own method in
 terms of the Marc21Semantics.assemble_lcsh method.