dimus-taxamatch_rb 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/taxamatch_rb.rb +1 -1
- data/spec/taxamatch_rb_spec.rb +4 -0
- metadata +1 -1
data/lib/taxamatch_rb.rb
CHANGED
@@ -24,7 +24,7 @@ module Taxamatch
|
|
24
24
|
def taxamatch(str1, str2)
|
25
25
|
preparsed_1 = @parser.parse(str1)
|
26
26
|
preparsed_2 = @parser.parse(str2)
|
27
|
-
taxamatch_preparsed(preparsed_1, preparsed_2)['match']
|
27
|
+
taxamatch_preparsed(preparsed_1, preparsed_2)['match'] rescue false
|
28
28
|
end
|
29
29
|
|
30
30
|
#takes two hashes of parsed scientific names, analyses them and returns back
|
data/spec/taxamatch_rb_spec.rb
CHANGED
@@ -65,6 +65,10 @@ describe 'Taxamatch::Base' do
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
+
it 'should work with names that cannot be parsed' do
|
69
|
+
res = @tm.taxamatch('Quadraspidiotus ostreaeformis MacGillivray, 1921','Quadraspidiotus ostreaeformis Curtis)')
|
70
|
+
res = false
|
71
|
+
end
|
68
72
|
|
69
73
|
it 'should compare genera' do
|
70
74
|
#edit distance 1 always match
|