lib/BeverageScrapper.rb
#Makes an overall summary of the text in regards to beverages and drinks, in string form
Makes an overall summary of the text in regards to beverages and drinks, in string form
Makes an overall summary of the text in regards to beverages and drinks in string form
def summary(text)
    descrating = BeverageScrapper::Classify.descriptrating(text)
    opinionrating = BeverageScrapper::Classify.opinionrating(text)
    bevtopic = BeverageScrapper::Classify.beveragerating(text)
    mostcommondrink = BeverageScrapper::Find.mostcommondrink(text)
    summ = "The analyzed passage has a beverage topic rating of #{bevtopic}, the frequency of words about beverages or brands of beverages.\n"
    summ += "The passage has a net positive opinion of #{opinionrating}, based on the frequency of positive and negative adjectives.\n"
    summ += "The passage has a descriptive rating of #{descrating}, the proportion of words that describe a beverage.\n"
    summ += "#{mostcommondrink} was the most commonly mentioned drink word in the passage.\n"
    return summ
  end
def summary ( text ) descrating = BeverageScrapper :: Classify . descriptrating ( text ) opinionrating = BeverageScrapper :: Classify . opinionrating ( text ) bevtopic = BeverageScrapper :: Classify . beveragerating ( text ) mostcommondrink = BeverageScrapper :: Find . mostcommondrink ( text ) summ = "The analyzed passage has a beverage topic rating of #{bevtopic}, the frequency of words about beverages or brands of beverages.\n" summ += "The passage has a net positive opinion of #{opinionrating}, based on the frequency of positive and negative adjectives.\n" summ += "The passage has a descriptive rating of #{descrating}, the proportion of words that describe a beverage.\n" summ += "#{mostcommondrink} was the most commonly mentioned drink word in the passage.\n" return summ end
Makes an overall summary of the text in regards to beverages and drinks, in string form
Makes an overall summary of the text in regards to beverages and drinks in string form
text