Sha256: 8bbe73f7545c71da5aad4466e35ee1c74b79b7e35f60214149bd102b77107202
Contents?: true
Size: 677 Bytes
Versions: 2
Compression:
Stored size: 677 Bytes
Contents
class NameSpotter class NetiNetiClient < Client def initialize(opts = { host: '0.0.0.0', port: 6384 }) super end def find(text) # the form does not get sent if text is nil or empty return [] if text.nil? || text.empty? response = RestClient.post("http://#{@host}:#{@port}", data: text) response.body.split("|").collect do |info| name, offset_start = info.split(',') name.force_encoding('utf-8') normalized_name = NameSpotter::ScientificName.normalize(name) NameSpotter::ScientificName.new(name, :scientific_name => normalized_name, :start_position => offset_start.to_i) end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
name-spotter-0.1.0 | lib/name-spotter/neti_neti_client.rb |
name-spotter-0.0.7 | lib/name-spotter/neti_neti_client.rb |