Skip to content

Commit

Permalink
Parse the names of the organizations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Genia Kazymova committed Jun 25, 2024
1 parent d2dfa29 commit dd17061
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/trln_argon/solr_document/citation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,16 @@ def parse_authors_and_editors(docvalue)
editors = []
docvalue.each do |doc|
parsed_doc = JSON.parse(doc)
if parsed_doc['rel'] == 'editor'
if parsed_doc['type'] == 'no_rel'
authors << "{#{parsed_doc['name']}}"
elsif parsed_doc['rel'] == 'editor'
editors << parsed_doc['name']
elsif parsed_doc['rel'] != 'illustrator'
else
authors << parsed_doc['name']
end
end
puts "authors=", authors
puts "editors=", editors
[authors.join(' and '), editors.join(' and ')]
end

Expand All @@ -102,7 +106,7 @@ def process_citations(bibliography, citation_hash)
processor = CiteProc::Processor.new(style: style, format: 'html')
processor.import(bibliography.to_citeproc)
citation = processor.render(:bibliography, id: bibliography.first.id).first
citation_hash[format] = citation
citation_hash[format] = citation.tr('{}', '')
end
end

Expand Down

0 comments on commit dd17061

Please sign in to comment.