Fix translatable strings

This commit is contained in:
dr. M.S. (Matthijs) Berends 2023-04-15 09:32:13 +02:00
parent ed70f95380
commit 1a02d302d4
15 changed files with 20 additions and 17 deletions

View File

@ -1,6 +1,6 @@
Package: AMR
Version: 2.0.0.9006
Date: 2023-04-14
Version: 2.0.0.9007
Date: 2023-04-15
Title: Antimicrobial Resistance Data Analysis
Description: Functions to simplify and standardise antimicrobial resistance (AMR)
data analysis and to work with microbial and antimicrobial properties by

View File

@ -1,4 +1,4 @@
# AMR 2.0.0.9006
# AMR 2.0.0.9007
## Changed
* formatting fix for `sir_interpretation_history()`

24
R/mo.R
View File

@ -947,25 +947,25 @@ convert_colloquial_input <- function(x) {
out <- rep(NA_character_, length(x))
# Streptococci, like GBS = Group B Streptococci (B_STRPT_GRPB)
out[x %like_case% "^g[abcdfghkl]s$"] <- gsub("g([abcdfghkl])s",
out[x %like_case% "^g[abcdefghijkl]s$"] <- gsub("g([abcdefghijkl])s",
"B_STRPT_GRP\\U\\1",
x[x %like_case% "^g[abcdfghkl]s$"],
x[x %like_case% "^g[abcdefghijkl]s$"],
perl = TRUE
)
# Streptococci in different languages, like "estreptococos grupo B"
out[x %like_case% "strepto[ck]o[ck].* [abcdfghkl]$"] <- gsub(".*e?strepto[ck]o[ck].* ([abcdfghkl])$",
out[x %like_case% "strepto[ck]o[ck].* [abcdefghijkl]$"] <- gsub(".*e?strepto[ck]o[ck].* ([abcdefghijkl])$",
"B_STRPT_GRP\\U\\1",
x[x %like_case% "strepto[ck]o[ck].* [abcdfghkl]$"],
x[x %like_case% "strepto[ck]o[ck].* [abcdefghijkl]$"],
perl = TRUE
)
out[x %like_case% "strep[a-z]* group [abcdfghkl]$"] <- gsub(".* ([abcdfghkl])$",
out[x %like_case% "strep[a-z]* group [abcdefghijkl]$"] <- gsub(".* ([abcdefghijkl])$",
"B_STRPT_GRP\\U\\1",
x[x %like_case% "strep[a-z]* group [abcdfghkl]$"],
x[x %like_case% "strep[a-z]* group [abcdefghijkl]$"],
perl = TRUE
)
out[x %like_case% "group [abcdfghkl] strepto[ck]o[ck]"] <- gsub(".*group ([abcdfghkl]) strepto[ck]o[ck].*",
out[x %like_case% "group [abcdefghijkl] strepto[ck]o[ck]"] <- gsub(".*group ([abcdefghijkl]) strepto[ck]o[ck].*",
"B_STRPT_GRP\\U\\1",
x[x %like_case% "group [abcdfghkl] strepto[ck]o[ck]"],
x[x %like_case% "group [abcdefghijkl] strepto[ck]o[ck]"],
perl = TRUE
)
out[x %like_case% "ha?emoly.*strep"] <- "B_STRPT_HAEM"
@ -975,14 +975,14 @@ convert_colloquial_input <- function(x) {
out[x %like_case% "(viridans.* (strepto|^s).*|^vgs[^a-z]*$)"] <- "B_STRPT_VIRI"
# Salmonella in different languages, like "Salmonella grupo B"
out[x %like_case% "salmonella.* [abcd]$"] <- gsub(".*salmonella.* ([abcd])$",
out[x %like_case% "salmonella.* [abcdefgh]$"] <- gsub(".*salmonella.* ([abcdefgh])$",
"B_SLMNL_GRP\\U\\1",
x[x %like_case% "salmonella.* [abcd]$"],
x[x %like_case% "salmonella.* [abcdefgh]$"],
perl = TRUE
)
out[x %like_case% "group [abcd] salmonella"] <- gsub(".*group ([abcd]) salmonella*",
out[x %like_case% "group [abcdefgh] salmonella"] <- gsub(".*group ([abcdefgh]) salmonella*",
"B_SLMNL_GRP\\U\\1",
x[x %like_case% "group [abcd] salmonella"],
x[x %like_case% "group [abcdefgh] salmonella"],
perl = TRUE
)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
3d92820386230a7ac3c9367ce6d96db9
aec0e9d495ebee3079f9aab766d7a38f

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1380,6 +1380,9 @@ for (nm in to_restore) {
# Save to package ---------------------------------------------------------
# set class <mo> if still needed (if you run only this part coming from other scripts)
class(microorganisms$mo) <- c("mo", "character")
microorganisms <- microorganisms %>% arrange(fullname)
usethis::use_data(microorganisms, overwrite = TRUE, version = 2, compress = "xz")
rm(microorganisms)

Binary file not shown.

View File

@ -280,7 +280,7 @@ expect_equal(length(summary(example_isolates$mo)), 6)
# WHONET codes and NA/NaN
expect_equal(
as.character(as.mo(c("xxx", "na", "nan"), debug = TRUE)),
as.character(as.mo(c("xxx", "na", "nan"))),
rep(NA_character_, 3)
)
expect_equal(as.character(as.mo("con")), "UNKNOWN")