name-spotter 0.1.7 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.7
1
+ 0.1.8
@@ -8,7 +8,8 @@ class NameSpotter
8
8
  # the form does not get sent if text is nil or empty
9
9
  return [] if text.nil? || text.empty?
10
10
  resource = RestClient::Resource.new("http://#{@host}:#{@port}", timeout: 9_000_000, open_timeout: 9_000_000, connection: "Keep-Alive")
11
- response = resource.post(data: text)
11
+ #TODO: we should figure out a better delimiter in NetiNeti (or use json) so we don't need to susbitute pipe with a letter here
12
+ response = resource.post(data: text.gsub("|", "l")) #hhhhhhack
12
13
  response.body.split("|").collect do |info|
13
14
  res = info.split(",")
14
15
  name = res[0...-2].join(",")
data/name-spotter.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "name-spotter"
8
- s.version = "0.1.7"
8
+ s.version = "0.1.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Anthony Goddard", "Chuck Ha", "Dmitry Mozzherin"]
@@ -92,5 +92,12 @@ describe "NameSpotter" do
92
92
  res = @neti.find(text)
93
93
  res.should == {:names=>[{:verbatim=>"Ophioihrix nidis", :scientificName=>"Ophioihrix nidis", :offsetStart=>26, :offsetEnd=>41}, {:verbatim=>"OPHTOMVXIDAE", :scientificName=>"Ophtomvxidae", :offsetStart=>47, :offsetEnd=>58}, {:verbatim=>"Ophiocynodus", :scientificName=>"Ophiocynodus", :offsetStart=>70, :offsetEnd=>81}, {:verbatim=>"ASTÉROCHEMIDAE", :scientificName=>"Astérochemidae", :offsetStart=>98, :offsetEnd=>111}, {:verbatim=>"STFROPHVTIDAE", :scientificName=>"Stfrophvtidae", :offsetStart=>128, :offsetEnd=>140}, {:verbatim=>"Asleronyx excavata", :scientificName=>"Asleronyx excavata", :offsetStart=>153, :offsetEnd=>170}]}
94
94
  end
95
+
96
+ it "should not break NetiNeti results from processing OCR with | character in it" do
97
+ text = "We need to make sure that Oph|oihrix nidis and OPHTOMVX|DAE will not break results"
98
+ text = "We need to make sure that Oph|oihrix nidis and OPHTOMVX|DAE will not break results"
99
+ res = @neti.find(text)
100
+ res.should == {:names=>[{:verbatim=>"Ophloihrix nidis", :scientificName=>"Ophloihrix nidis", :offsetStart=>26, :offsetEnd=>41}]}
101
+ end
95
102
 
96
103
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: name-spotter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -269,7 +269,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
269
269
  version: '0'
270
270
  segments:
271
271
  - 0
272
- hash: -955592196308829789
272
+ hash: 765055699781609627
273
273
  required_rubygems_version: !ruby/object:Gem::Requirement
274
274
  none: false
275
275
  requirements: