Skip to content

Commit

Permalink
fix(resources): fix matching of some ICBN names
Browse files Browse the repository at this point in the history
  • Loading branch information
larsgw committed Dec 16, 2024
1 parent 4c29b3b commit 3c18458
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/bin/process-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,15 @@ class ResourceProcessor {
continue
}

// Fix author scoring for some species, see https://github.com/gnames/gnverifier/issues/129
matches.sort((a: Record<string, any>, b: Record<string, any>) => {
if (a.sortScore !== b.sortScore) {
return b.sortScore - a.sortScore
}

return name === a.matchedName ? -1 : name === b.matchedName ? 1 : 0
})

for (const match of matches) {
const source = match.dataSourceId
const currentRank = match.classificationRanks.split('|').pop()
Expand Down

0 comments on commit 3c18458

Please sign in to comment.