Skip to content

Commit

Permalink
allow and/or for range in classes
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed Oct 25, 2023
1 parent 756078c commit cd6eadd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/parseOSD_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit cd6eadd

Please sign in to comment.