Module: Vendor::Gnfinder

Defined in:
lib/vendor/gnfinder.rb,
lib/vendor/gnfinder/name.rb,
lib/vendor/gnfinder/result.rb

Overview

TODO

Verify mode! do this first
   user has manually entered all names - should see matches on playground 
   highlight where not

Curate/add mode 
 * talk to Hernán about getting `gnfinder` in shell or GRPC
 * flesh out the Name model
 * get José to add `name=` params to new combination
 * get José to add `name=` params to new taxon name   
 * bonus - include `source_id=` to auto-cite result

 * Show missmatched classification for match names
 * Show page numbers

Defined Under Namespace

Classes: Name, Result

Class Method Summary collapse

Class Method Details

.finderObject



19
20
21
# File 'lib/vendor/gnfinder.rb', line 19

def self.finder
  ::Gnfinder::Client.new
end

.result(text, verification: true, tokens: 3, language: nil, detect_language: true, sources: [ ], project_id: []) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/vendor/gnfinder.rb', line 23

def self.result(text, verification: true, tokens: 3, language: nil, detect_language: true, sources: [ ], project_id: [])
  opts = {
    verification: verification,
    words_around: tokens,
    sources: sources
  }
  opts[:language] = 'detect' if detect_language
  opts[:language] = language unless language.nil?

  res = finder.find_names(text, opts)
  ap res
  ::Vendor::Gnfinder::Result.new(res, project_id)
end