1
0
mirror of https://github.com/msberends/AMR.git synced 2026-05-14 03:10:50 +02:00

Fix emend. author bug in get_author_year() and update ref documentation

Strip emend. and everything after it so the ref column retains the
combination authority, not the emendation author. Update data.R and
mo_property.R docs to describe the correct semantics of the ref field.

https://claude.ai/code/session_01VH4Ju4Xq9aW1AHuoVbjGEo
This commit is contained in:
Claude
2026-05-02 14:34:45 +00:00
parent 0af3f84655
commit 9707450b89
5 changed files with 8 additions and 5 deletions

View File

@@ -122,8 +122,8 @@ get_author_year <- function(ref) {
authors <- gsub("[A-Z-][a-z-]?[.]", "", authors, ignore.case = FALSE)
# remove trailing and leading spaces
authors <- trimws(authors)
# keep only the part after last 'emend.' to get the latest authors
authors <- gsub(".*emend[.] ?", "", authors)
# strip emend. and everything after it to retain the combination authority
authors <- gsub(" ?emend[.]?.*", "", authors)
# only keep first author and replace all others by 'et al'
authors <- gsub("(,| and| et| &| ex| emend\\.?) .*", " et al.", authors)
# et al. always with ending dot