1 # frozen_string_literal: true
5 "Business Description:", "Additional Keywords:"
16 doc = Nokogiri::HTML(text.to_html)
21 doc.xpath("//a").each do |link|
23 link_size += link.content.length
26 link_proportion = link_size.to_f / doc.content.length
29 spammy_phrases = SPAMMY_PHRASES.count do |phrase|
30 doc.content.include?(phrase)
33 ([link_proportion - 0.2, 0.0].max * 200) +