Sha256: 906a6ac643753468d50382566688f666bb2402905f5728dacea00bf2edc10702
Contents?: true
Size: 584 Bytes
Versions: 6
Compression:
Stored size: 584 Bytes
Contents
require 'english/porter_stemming' require 'test/unit' class TC_PorterStemming < Test::Unit::TestCase DIR = File.dirname(__FILE__) DATA_INPUT = File.read(File.join(DIR,'fixture/porter_stemming_input.txt')).split(/\n/) DATA_OUTPUT = File.read(File.join(DIR,'fixture/porter_stemming_output.txt')).split(/\n/) #def slurp(*path) # File.read(File.join(DIR,*path)).split(/\n/) #end def test_cases cases = DATA_INPUT.zip(DATA_OUTPUT) cases.each do |word, expected_output| assert_equal expected_output, English::PorterStemming.stem(word) end end end
Version data entries
6 entries across 6 versions & 1 rubygems