diff --git a/Rakefile b/Rakefile index 83cf88e3..d1449d19 100644 --- a/Rakefile +++ b/Rakefile @@ -188,3 +188,32 @@ end task :collab => "artifacts/okennedy_collaborators.tsv" +file "artifacts/oracle_papers.txt" => [ $db.files, "artifacts", "Rakefile" ].flatten do + File.open("artifacts/oracle_papers.txt", "w+") do |fh| + fh.puts $db["publications"]. + where { |pub| pub.fetch("projects", []).include? "mimir" }. + map { |pub| + pub = LabMetadata::complete_venue(pub) + case pub["type"] + when "conference", "journal", "workshop", "abstract" then + [ pub["title"], + pub["authors"].join(", "), + "#{LabMetadata::venue_name(pub, size: :full_parens)} #{pub["year"]}", + pub["urls"].map { |k,v| "#{k.capitalize}: #{v}" }, + LabMetadata.bibtex_for(pub).split("\n") + ].flatten + when "thesis" then + [ pub["title"], + pub["authors"].join(", "), + "Thesis #{pub["degree"]} #{pub["year"]}", + pub["urls"].map { |k,v| "#{k.capitalize}: #{v}" }, + LabMetadata.bibtex_for(pub).split("\n") + ].flatten + else nil + end + }. + compact. + map { |record| "> #{record.join("\n ")}" }. + join("\n\n") + end +end \ No newline at end of file