Sha256: 9652c70289e2259f914a175fca30dd2fd3d5e06462ffdc44177d17ec7b572ee2

Contents?: true

Size: 424 Bytes

Versions: 5

Compression:

Stored size: 424 Bytes

Contents

require File.join(File.dirname(__FILE__), 'preamble')

class PorterStemmingTest < Test::Unit::TestCase

  def slurp(*path)
    File.read(File.rel(*path)).split(/\n/)
  end
  
  def test_cases
    cases = slurp('data', 'porter_stemming_input.txt').zip(slurp('data', 'porter_stemming_output.txt'))
    cases.each do |word, expected_output|
      assert_equal expected_output, Text::PorterStemming.stem(word)
    end
  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
text-0.1.14 test/test_porter_stemming.rb
text-0.1.13 test/test_porter_stemming.rb
Text-1.1.2 test/test_porter_stemming.rb
Text-1.1.0 test/porter_stemming_test.rb
Text-1.1.1 test/test_porter_stemming.rb