1
0
mirror of https://github.com/msberends/AMR.git synced 2025-07-08 16:42:10 +02:00

support for portuguese, language determination based on system

This commit is contained in:
2018-09-08 16:06:47 +02:00
parent b8a6c9af19
commit 26f5be0033
19 changed files with 307 additions and 106 deletions

7
R/mo.R
View File

@ -125,6 +125,8 @@ as.mo <- function(x, Becker = FALSE, Lancefield = FALSE) {
x <- unique(x)
x_backup <- x
# translate to English for supported languages of mo_property
x <- gsub("(Gruppe|gruppe|groep|grupo)", "group", x)
# remove dots and other non-text in case of "E. coli" except spaces
x <- gsub("[^a-zA-Z0-9 ]+", "", x)
# but spaces before and after should be omitted
@ -170,6 +172,11 @@ as.mo <- function(x, Becker = FALSE, Lancefield = FALSE) {
x[i] <- 'HAEINF'
next
}
if (tolower(x[i]) == '^c.*difficile$') {
# avoid detection of Clostridium difficile in case of C. difficile
x[i] <- 'CLODIF'
next
}
if (tolower(x[i]) == '^st.*au$'
| tolower(x[i]) == '^stau$'
| tolower(x[i]) == '^staaur$') {