estem 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +18 -0
- data/bin/es_stem.rb +178 -0
- data/lib/estem.rb +196 -0
- data/test/diffs.txt +28390 -0
- data/test/test_estem.rb +23 -0
- metadata +54 -0
data/test/test_estem.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
|
3
|
+
require 'test/unit'
|
4
|
+
require 'estem'
|
5
|
+
|
6
|
+
class EStemTest < Test::Unit::TestCase
|
7
|
+
def get_content(filename)
|
8
|
+
content = nil
|
9
|
+
File.open(filename, 'r:UTF-8') do |f|
|
10
|
+
content = f.read()
|
11
|
+
end
|
12
|
+
content.scan(/(\S+)(?:\s+)(\S+)/)
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_stem
|
16
|
+
# assuming we will run the test from the root directory of the project
|
17
|
+
# using "rake test" from the command-line
|
18
|
+
for word, good in get_content('test/diffs.txt')
|
19
|
+
assert_equal(good, word.es_stem, "input: " + word)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: estem
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Manuel A. Güílamo
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-05-20 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: ! 'Stem Spanish words regardless of the case they are without harming
|
15
|
+
the final root, what does that means? it means that, this gem do the job it is suppose
|
16
|
+
to do and nothing more. It''s not going to make unnecessary changes to the results.
|
17
|
+
For example: dividiéndose=>divid, aLBergueS => aLBerg, HABItantes => HABIt.'
|
18
|
+
email: maguilamo.c@gmail.com
|
19
|
+
executables: []
|
20
|
+
extensions: []
|
21
|
+
extra_rdoc_files: []
|
22
|
+
files:
|
23
|
+
- Rakefile
|
24
|
+
- bin/es_stem.rb
|
25
|
+
- lib/estem.rb
|
26
|
+
- test/diffs.txt
|
27
|
+
- test/test_estem.rb
|
28
|
+
homepage: ''
|
29
|
+
licenses: []
|
30
|
+
post_install_message:
|
31
|
+
rdoc_options: []
|
32
|
+
require_paths:
|
33
|
+
- lib
|
34
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
36
|
+
requirements:
|
37
|
+
- - ! '>='
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '0'
|
40
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
requirements: []
|
47
|
+
rubyforge_project:
|
48
|
+
rubygems_version: 1.8.24
|
49
|
+
signing_key:
|
50
|
+
specification_version: 3
|
51
|
+
summary: Fast, case-insensitive Spanish stemming gem.
|
52
|
+
test_files:
|
53
|
+
- test/diffs.txt
|
54
|
+
- test/test_estem.rb
|