Method: DissertationCatch#filter

Defined in:
app/referent_filters/dissertation_catch.rb

#filter(referent) ⇒ Object

input: Umlaut Referent object Is this a citation to a Dissertation Abstracts issn, or do we otherwise think it’s a dissertation citation? Then change it to a dissertation citation.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'app/referent_filters/dissertation_catch.rb', line 32

def filter(referent)
  issn = get_identifier(:urn, "issn", referent)
  return unless issn

  # normalize removing hyphen
  issn.gsub!('-', '')
  
  if ( @@da_issns.find { |i| i == issn } )
    # || lc($jtitle) =~ /dissertation/i || lc($jtitle2) =~ /dissertation/i)

    referent.enhance_referent("genre", "dissertation")

     = referent.

    # Reset it's title to the dissertation title
    title = if ['atitle'].present?
      ['atitle']
    elsif ['title'].present?
      ['title']
    end
    referent.enhance_referent("btitle", title) if title.present?
    referent.enhance_referent("title", title, true, false, :overwrite => true) if title.present?

    # Now erase titles that do not apply 
    referent.remove_value("atitle")
    referent.remove_value("jtitle")
    referent.remove_value("stitle")
    # issn or isbn are wrong, probably point to Dissertation Abstracts
    referent.remove_value("issn")
    referent.remove_value("isbn")
    # Same with all article level metadata
    referent.remove_value("volume")
    referent.remove_value("issue")
    referent.remove_value("issue_start")
    referent.remove_value("spage")
    referent.remove_value("epage")
    referent.remove_value("pages")
  end

end