Sha256: c27305d93552e24978dc80476122768705bfce6362788239e690338f16f8a75c

Contents?: true

Size: 408 Bytes

Versions: 29

Compression:

Stored size: 408 Bytes

Contents

#!/usr/bin/env ruby
# encoding: utf-8

require 'twitter_ebooks'
require 'minitest/autorun'
require 'benchmark'

module Ebooks
  class TestKeywords < Minitest::Test
    corpus = NLP.normalize(File.read(ARGV[0]))
    puts "Finding and ranking keywords"
    puts Benchmark.measure {
      NLP.keywords(corpus).top(50).each do |keyword|
        puts "#{keyword.text} #{keyword.weight}"
      end
    }
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
twitter_ebooks-2.3.2 test/keywords.rb
twitter_ebooks-2.3.1 test/keywords.rb
twitter_ebooks-2.3.0 test/keywords.rb
twitter_ebooks-2.2.9 test/keywords.rb
twitter_ebooks-2.2.8 test/keywords.rb
twitter_ebooks-2.2.7 test/keywords.rb
twitter_ebooks-2.2.6 test/keywords.rb
twitter_ebooks-2.2.5 test/keywords.rb
twitter_ebooks-2.2.4 test/keywords.rb
twitter_ebooks-2.2.3 test/keywords.rb
twitter_ebooks-2.2.2 test/keywords.rb
twitter_ebooks-2.2.1 test/keywords.rb
twitter_ebooks-2.2.0 test/keywords.rb
twitter_ebooks-2.1.9 test/keywords.rb
twitter_ebooks-2.1.8 test/keywords.rb
twitter_ebooks-2.1.7 test/keywords.rb
twitter_ebooks-2.1.6 test/keywords.rb
twitter_ebooks-2.1.5 test/keywords.rb
twitter_ebooks-2.1.4 test/keywords.rb
twitter_ebooks-2.1.3 test/keywords.rb