mirror of
https://github.com/msberends/AMR.git
synced 2025-07-11 10:21:54 +02:00
(v1.0.1.9006) added generic CLSI rules
This commit is contained in:
11
R/ab.R
11
R/ab.R
@ -253,7 +253,7 @@ as.ab <- function(x, ...) {
|
||||
next
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!isFALSE(list(...)$initial_search)) {
|
||||
# transform back from other languages and try again
|
||||
x_translated <- paste(lapply(strsplit(x[i], "[^a-zA-Z0-9 ]"),
|
||||
@ -294,6 +294,15 @@ as.ab <- function(x, ...) {
|
||||
}
|
||||
}
|
||||
|
||||
# try by removing all trailing capitals
|
||||
if (x[i] %like_case% "[a-z]+[A-Z]+$") {
|
||||
found <- suppressWarnings(as.ab(gsub("[A-Z]+$", "", x[i])))
|
||||
if (length(found) > 0 & !is.na(found)) {
|
||||
x_new[i] <- found[1L]
|
||||
next
|
||||
}
|
||||
}
|
||||
|
||||
# not found
|
||||
x_unknown <- c(x_unknown, x_bak[x[i] == x_bak_clean][1])
|
||||
}
|
||||
|
Reference in New Issue
Block a user