module ZombieWriter

Constants

VERSION

Public Class Methods

citation_constructor(paragraph) click to toggle source
# File lib/zombie_writer.rb, line 8
def self.citation_constructor(paragraph)
  if (paragraph[:sourceurl] && paragraph[:sourcetext])
    "---[#{paragraph[:sourcetext]}](#{paragraph[:sourceurl]})"
  elsif paragraph[:sourcetext]
    "---#{paragraph[:sourcetext]}"
  elsif paragraph[:sourceurl]
    "---[#{paragraph[:sourceurl]}](#{paragraph[:sourceurl]})"
  else
    ""
  end
end
formatted_article(header, final_article) click to toggle source
# File lib/zombie_writer.rb, line 33
def self.formatted_article(header, final_article)
  "#{header}\n\n#{final_article}\n"
end
header(index, article_for_summarization) click to toggle source
# File lib/zombie_writer.rb, line 20
def self.header(index, article_for_summarization)
  begin
    generated_title = ClassifierReborn::Summarizer.summary(article_for_summarization, 1)
  rescue Exception
    generated_title = nil
  end
  if generated_title
    "## #{index} - #{generated_title}"
  else
    "## #{index}"
  end
end