Module: Match

Defined in:
lib/match/otu/taxon_name.rb

Overview

Matches an array of name strings to TaxonName records and their associated OTUs.

Usage:

result = Match::Otu::TaxonName.new(
names: ['Aus bus', 'Cus dus'],
project_id: 1,
levenshtein_distance: 0,
taxon_name_id: nil,
resolve_synonyms: false
).call

Returns an Array of Hashes, one per input name:

[
{
  scientific_name: 'Aus bus',
  taxon_name_id: 123,
  taxon_name: <TaxonName>,
  otus: [<Otu>, ...],
  ambiguous: false,
  matched: true
}, ...
]

When candidates: is provided each Hash also carries candidates: [<TaxonName>, ...], the ranked match set (best first) rather than only the single best match.

All options added after the initial implementation are opt-in: with their defaults the returned Hashes and the matches themselves are identical to the original behaviour.

Claude (Anthropic) provided > 50% of the code for this class.

Defined Under Namespace

Modules: Otu