uea-stemmer 0.9.11 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.11
1
+ 0.10.0
data/lib/uea-stemmer.rb CHANGED
@@ -27,11 +27,12 @@ class UEAStemmer
27
27
  include StringHelpers
28
28
 
29
29
  attr_accessor :max_acronym_length, :max_word_length
30
- attr_reader :rules
30
+ attr_reader :rules, :options
31
31
 
32
- def initialize(max_word_length = nil, max_acronym_length = nil)
32
+ def initialize(max_word_length = nil, max_acronym_length = nil, options = {})
33
33
  @max_word_length = max_word_length || 'deoxyribonucleicacid'.size
34
34
  @max_acronym_length = max_acronym_length || 'CAVASSOO'.size
35
+ @options = options.dup
35
36
 
36
37
  @rules = Array.new
37
38
  create_rules
@@ -54,10 +55,12 @@ class UEAStemmer
54
55
  stemmed_word = remove_suffix(stemmed_word, 1)
55
56
  end
56
57
 
57
- stemmed_word.gsub!(/n't/, ' not')
58
- stemmed_word.gsub!(/'ve/, ' have')
59
- stemmed_word.gsub!(/'re/, ' are')
60
- stemmed_word.gsub!(/'m/, ' am')
58
+ unless options[:skip_contractions]
59
+ stemmed_word.gsub!(/n't/, ' not')
60
+ stemmed_word.gsub!(/'ve/, ' have')
61
+ stemmed_word.gsub!(/'re/, ' are')
62
+ stemmed_word.gsub!(/'m/, ' am')
63
+ end
61
64
 
62
65
  Word.new(stemmed_word, 93)
63
66
  else
data/uea-stemmer.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{uea-stemmer}
8
- s.version = "0.9.11"
8
+ s.version = "0.10.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Marie-Claire Jenkins", "Dan J. Smith", "Richard Churchill", "Jason Adams"]
12
- s.date = %q{2009-10-01}
12
+ s.date = %q{2009-10-13}
13
13
  s.description = %q{Port of UEA-Lite Stemmer to Ruby, a conservative stemmer for search and indexing.}
14
14
  s.email = %q{jasonmadams@gmail.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uea-stemmer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.11
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marie-Claire Jenkins
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2009-10-01 00:00:00 -04:00
15
+ date: 2009-10-13 00:00:00 -04:00
16
16
  default_executable:
17
17
  dependencies: []
18
18