Skip to content

Commit

Permalink
do not throw away year from authority string in "A in B 1900" case
Browse files Browse the repository at this point in the history
  • Loading branch information
nleanba committed Sep 27, 2024
1 parent 518e3a2 commit 5871f9b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gg2rdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ export function gg2rdf(

let baseAuthority: string = cTaxon.getAttribute("baseAuthorityName") ?? "";
if (baseAuthority) {
baseAuthority = substringBefore(baseAuthority, " in ");
baseAuthority = baseAuthority.replace(/\bin\b[^0-9]*/, "");
if (baseAuthority === "L.") baseAuthority = "Linnaeus";
if (baseAuthority.length >= 2 && !/[a-z]/.test(baseAuthority)) {
baseAuthority = baseAuthority.replaceAll(
Expand Down Expand Up @@ -620,7 +620,7 @@ export function gg2rdf(
}
let authority: string = cTaxon.getAttribute("authorityName") ?? "";
if (authority) {
authority = substringBefore(authority, " in ");
authority = authority.replace(/\bin\b[^0-9]*/, "");
if (authority === "L.") authority = "Linnaeus";
if (authority.length >= 2 && !/[a-z]/.test(authority)) {
authority = authority.replaceAll(
Expand Down Expand Up @@ -671,7 +671,7 @@ export function gg2rdf(
} else if (cTaxon.getAttribute("authority")) {
let authority: string = cTaxon.getAttribute("authority") ?? "";
if (authority) {
authority = substringBefore(authority, " in ");
authority = authority.replace(/\bin\b[^0-9]*/, "");
if (authority === "L.") authority = "Linnaeus";
if (authority.length >= 2 && !/[a-z]/.test(authority)) {
authority = authority.replaceAll(
Expand Down

0 comments on commit 5871f9b

Please sign in to comment.