From cd6eaddf78359281f78e1c68e72d6667149aca65 Mon Sep 17 00:00:00 2001 From: "Andrew G. Brown" Date: Wed, 25 Oct 2023 13:23:07 -0700 Subject: [PATCH] allow and/or for range in classes --- R/parseOSD_functions.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 }