Sha256: 2230cecf4e18d47d3fdd6d5cb86896866e8d5a941679016d81e246b2f91c5d22

Contents?: true

Size: 454 Bytes

Versions: 7

Compression:

Stored size: 454 Bytes

Contents

require File.join(File.dirname(__FILE__), 'preamble')
require "text/porter_stemming"

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

7 entries across 7 versions & 1 rubygems

Version Path
text-1.2.0 test/test_porter_stemming.rb
text-1.0.4 test/test_porter_stemming.rb
text-1.0.3 test/test_porter_stemming.rb
text-1.0.2 test/test_porter_stemming.rb
text-1.0.1 test/test_porter_stemming.rb
text-1.0.0 test/test_porter_stemming.rb
text-0.2.0 test/test_porter_stemming.rb