module Anonymize::GoogleNews

Public Class Methods

longest_words(text) click to toggle source
# File lib/anonymize/google_news.rb, line 17
def longest_words(text)
  strip_html(text).scan(/\w+/).uniq.sort_by(&:length)
end
strip_html(string) click to toggle source
# File lib/anonymize/google_news.rb, line 25
def strip_html(string)
  string.gsub(/<[^>]+>/,'')
end
utf8_to_ascii(string) click to toggle source
# File lib/anonymize/google_news.rb, line 21
def utf8_to_ascii(string)
  string.encode('ascii', 'utf-8', :undef => :replace, :invalid => :replace, :replace => '')
end