diff --git a/R/parseOSD_functions.R b/R/parseOSD_functions.R index fa79642000..7de9ada200 100644 --- a/R/parseOSD_functions.R +++ b/R/parseOSD_functions.R @@ -207,8 +207,8 @@ # vectorized parsing of effervescence class .parse_eff_class <- function(x) { - .zerochar_to_na(gsub("^.*[;,]? ?\\b([a-z]+ ?effervescen[tce]+ to [a-z]+ ?effervescen[tce]+).*$|^.*[;,] ?\\b(very [a-z]+ effervescen[tce]+).*$|^.*[;,] ?\\b([a-z]+ ?effervescen[tce]+).*$|^.*[;,]? ?\\b(very [a-z]+ effervescen[tce]+).*$|^.*[;,]? ?\\b([a-z]+ ?effervescen[tce]+).*$|.*", - "\\1\\2\\3\\4\\5", x, ignore.case = TRUE)) + .zerochar_to_na(gsub("^.*[;,]? ?\\b([a-z]+ ?effervescen[tce]+ (to|and|or) [a-z]+ ?effervescen[tce]+).*$|^.*[;,] ?\\b(very [a-z]+ effervescen[tce]+).*$|^.*[;,] ?\\b([a-z]+ ?effervescen[tce]+).*$|^.*[;,]? ?\\b(very [a-z]+ effervescen[tce]+).*$|^.*[;,]? ?\\b([a-z]+ ?effervescen[tce]+).*$|.*", + "\\1\\3\\4\\5\\6", x, ignore.case = TRUE)) # factors cannot be preserved in JSON output, and wont work for multiple classes/ranges of classes }