1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-13 01:12:08 +02:00

complexes

This commit is contained in:
2022-11-17 15:23:29 +01:00
parent f6862a139d
commit 05d536ebb7
7 changed files with 23 additions and 6 deletions

6
R/mo.R
View File

@ -180,6 +180,10 @@ as.mo <- function(x,
x <- replace_ignore_pattern(x, ignore_pattern)
x_lower <- tolower(x)
if (any(trimws2(x_lower) %like_case% "complex$", na.rm = TRUE)) {
warning_("in `as.mo()`: translation of complexes is not supported at the moment - the input text 'complex' was ignored.", call = FALSE)
}
# WHONET: xxx = no growth
x[x_lower %in% c("", "xxx", "na", "nan")] <- NA_character_
@ -521,7 +525,7 @@ mo_cleaning_regex <- function() {
"|",
"([({]|\\[).+([})]|\\])",
"|",
"(^| )(e?spp|e?ssp|e?ss|e?sp|e?subsp|sube?species|biovar|biotype|serovar|e?species)[.]*( |$))"
"(^| )(e?spp|e?ssp|e?ss|e?sp|e?subsp|sube?species|biovar|biotype|serovar|serogr.?up|e?species|complex)[.]*( |$))"
)
}