Sha256: da5064ceaad3026776a955cdb8607e276bb1c7d203fcc0805c47570241cf9062
Contents?: true
Size: 640 Bytes
Versions: 5
Compression:
Stored size: 640 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(',') 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
5 entries across 5 versions & 1 rubygems