perseus_match 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to perseus_match version 0.0.4
5
+ This documentation refers to perseus_match version 0.0.5
6
6
 
7
7
 
8
8
  == DESCRIPTION
@@ -26,7 +26,7 @@
26
26
  ###############################################################################
27
27
  #++
28
28
 
29
- $KCODE = 'u'
29
+ $KCODE = 'u' unless RUBY_VERSION >= '1.9'
30
30
 
31
31
  require 'pathname'
32
32
  require 'rbconfig'
@@ -86,7 +86,7 @@ class PerseusMatch
86
86
  )}
87
87
 
88
88
  parse = lambda { |x|
89
- x.each { |res|
89
+ x.each_line { |res|
90
90
  case res
91
91
  when /<(.*?)\s=\s\[(.*)\]>/
92
92
  a, b = $1, $2
@@ -4,7 +4,7 @@ class PerseusMatch
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 0
7
- TINY = 4
7
+ TINY = 5
8
8
 
9
9
  class << self
10
10
 
@@ -3,14 +3,14 @@ describe PerseusMatch::Cluster do
3
3
  it 'should accept limit option in sort_by' do
4
4
  PerseusMatch::Cluster.new(%w[foo bar]).sort_by(:similarity, :limit => 1).all? { |phrase, matches|
5
5
  matches.size.should == 1
6
- matches.size.should == matches.nitems
6
+ matches.should_not include(nil)
7
7
  }
8
8
  end
9
9
 
10
10
  it 'should accept threshold option in sort_by (1a)' do
11
11
  PerseusMatch::Cluster.new(%w[foo bar]).sort_by(:similarity, :threshold => 0.1).all? { |phrase, matches|
12
12
  matches.size.should == 1
13
- matches.size.should == matches.nitems
13
+ matches.should_not include(nil)
14
14
  matches.each { |match| match.target.should == phrase }
15
15
  }
16
16
  end
@@ -18,28 +18,28 @@ describe PerseusMatch::Cluster do
18
18
  it 'should accept threshold option in sort_by (1b)' do
19
19
  PerseusMatch::Cluster.new(%w[foo bar]).sort_by(:similarity, :threshold => 0).all? { |phrase, matches|
20
20
  matches.size.should == 2
21
- matches.size.should == matches.nitems
21
+ matches.should_not include(nil)
22
22
  }
23
23
  end
24
24
 
25
25
  it 'should accept threshold option in sort_by (2)' do
26
26
  PerseusMatch::Cluster.new(%w[foo bar]).sort_by(:target, :threshold => 'c').all? { |phrase, matches|
27
27
  matches.size.should == 1
28
- matches.size.should == matches.nitems
28
+ matches.should_not include(nil)
29
29
  }
30
30
  end
31
31
 
32
32
  it 'should accept both limit and threshold options in sort_by (1)' do
33
33
  PerseusMatch::Cluster.new(%w[foo bar]).sort_by(:target, :threshold => 'z', :limit => 1).all? { |phrase, matches|
34
34
  matches.size.should == 1
35
- matches.size.should == matches.nitems
35
+ matches.should_not include(nil)
36
36
  }
37
37
  end
38
38
 
39
39
  it 'should accept both limit and threshold options in sort_by (2)' do
40
40
  PerseusMatch::Cluster.new(%w[foo bar]).sort_by(:target, :threshold => 'a', :limit => 1).all? { |phrase, matches|
41
41
  matches.size.should be_zero
42
- matches.size.should == matches.nitems
42
+ matches.should_not include(nil)
43
43
  }
44
44
  end
45
45
 
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  require 'rubygems'
2
4
  require 'nuggets/tempfile/open'
3
5
  require 'nuggets/util/i18n'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perseus_match
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Wille
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-01-13 00:00:00 +01:00
12
+ date: 2009-01-22 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency