fork download
  1. # encoding: utf-8
  2. Encoding.default_external = Encoding::UTF_8
  3. file = File.read("x.html").split(/\n/)
  4. c = Hash.new 0
  5. file.each { |line|
  6. m = line.scan /\p{Cyrillic}+/i
  7. m.each { |x| c[x] += 1 }
  8. }
  9.  
  10. xwords = ["Каришка", "Липцис", "Андрей", "Воронин", "Пересланные", "сообщения", "что", "меня", "мне", "как"]
  11.  
  12. c.reject {|k, v| xwords.include?(v) || k.length < 3 || v > 30000}.sort_by {|_key, value| value}.last(500).each { |k, v|
  13. p "#{k} => #{v}"
  14. }
Runtime error #stdin #stdout #stderr 0.01s 7416KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
prog.rb:3:in `read': No such file or directory - x.html (Errno::ENOENT)
	from prog.rb:3:in `<main>'