diff --git a/src/bin/process-resources.ts b/src/bin/process-resources.ts index 3d31bd8..03f5bbb 100644 --- a/src/bin/process-resources.ts +++ b/src/bin/process-resources.ts @@ -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, b: Record) => { + 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()