classifier 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'rake/rdoctask'
5
5
  require 'rake/gempackagetask'
6
6
  require 'rake/contrib/rubyforgepublisher'
7
7
 
8
- PKG_VERSION = "1.3.2"
8
+ PKG_VERSION = "1.3.3"
9
9
 
10
10
  PKG_FILES = FileList[
11
11
  "lib/**/*", "bin/*", "test/**/*", "[A-Z]*", "Rakefile", "html/**/*"
@@ -66,7 +66,7 @@ spec = Gem::Specification.new do |s|
66
66
 
67
67
  #### Dependencies and requirements.
68
68
 
69
- s.add_dependency('stemmer', '>= 1.0.0')
69
+ s.add_dependency('fast-stemmer', '>= 1.0.0')
70
70
  s.requirements << "A porter-stemmer module to split word stems."
71
71
 
72
72
  #### Author and project details.
@@ -2,13 +2,7 @@
2
2
  # Copyright:: Copyright (c) 2005 Lucas Carlson
3
3
  # License:: LGPL
4
4
 
5
- begin
6
- require 'stemmer'
7
- rescue LoadError
8
- puts "Please install stemmer from http://rubyforge.org/projects/stemmer or 'gem install stemmer'"
9
- exit(-1)
10
- end
11
-
5
+ require 'fast_stemmer'
12
6
  require 'classifier/extensions/word_hash'
13
7
 
14
8
  class Object
@@ -287,7 +287,7 @@ module Classifier
287
287
  s[ord] = 0.0 if s[ord] < s_cutoff
288
288
  end
289
289
  # Reconstruct the term document matrix, only with reduced rank
290
- u * Matrix.diag( s ) * v.trans
290
+ u * ($GSL ? GSL::Matrix : ::Matrix).diag( s ) * v.trans
291
291
  end
292
292
 
293
293
  def node_for_content(item, &block)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: classifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Carlson
@@ -13,7 +13,7 @@ date: 2010-07-06 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: stemmer
16
+ name: fast-stemmer
17
17
  type: :runtime
18
18
  version_requirement:
19
19
  version_requirements: !ruby/object:Gem::Requirement