perseus_match 0.0.4 → 0.0.5
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/README +1 -1
- data/lib/perseus_match/token_set.rb +2 -2
- data/lib/perseus_match/version.rb +1 -1
- data/spec/perseus_match/cluster_spec.rb +6 -6
- data/spec/perseus_match_spec.rb +2 -0
- metadata +2 -2
data/README
CHANGED
@@ -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.
|
89
|
+
x.each_line { |res|
|
90
90
|
case res
|
91
91
|
when /<(.*?)\s=\s\[(.*)\]>/
|
92
92
|
a, b = $1, $2
|
@@ -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.
|
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.
|
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.
|
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.
|
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.
|
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.
|
42
|
+
matches.should_not include(nil)
|
43
43
|
}
|
44
44
|
end
|
45
45
|
|
data/spec/perseus_match_spec.rb
CHANGED
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
|
+
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-
|
12
|
+
date: 2009-01-22 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|