lib/rbbt/document/corpus/pubmed.rb in rbbt-text-1.3.1 vs lib/rbbt/document/corpus/pubmed.rb in rbbt-text-1.3.2

- old
+ new

@@ -4,18 +4,18 @@ def add_pmid(pmid, type = nil) pmids = Array === pmid ? pmid : [pmid] type = nil if String === type and type.empty? res = PubMed.get_article(pmids).collect do |pmid, article| - Log.debug "Loading pmid #{pmid}" document = if type.nil? || type.to_sym == :abstract Document.setup(article.abstract || "", "PMID", pmid, :abstract, self, :corpus => self) elsif type.to_sym == :title Document.setup(article.title, :PMID, pmid, :title, self) else raise "No FullText available for #{ pmid }" if article.full_text.nil? Document.setup(article.full_text, :PMID, pmid, :fulltext, self, :corpus => self) end + Log.debug "Loading pmid #{pmid}" add_document(document) end Document.setup(res) end