Skip to content

Commit

Permalink
more updates to effervescence
Browse files Browse the repository at this point in the history
 - greediness: preferentially take first class (after comma or semicolon most likely to be matrix eff)
 - allow ranges of classes separated by "to" (like drainage class)
 - note there are a wide range of narrative comments still not yet handled e.g. "slightly effervescent but strongly effervescent in spots"
  • Loading branch information
brownag committed Oct 25, 2023
1 parent 3102f8e commit 66a2a18
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) {
SoilKnowledgeBase:::.zerochar_to_na(gsub("^.*(very [a-z]+ effervescen[tce]+).*$|^.*\\b([a-z]+ ?effervescen[tce]+).*$|.*",
"\\1\\2", x, ignore.case = TRUE))
SoilKnowledgeBase:::.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))
# factors cannot be preserved in JSON output, and wont work for multiple classes/ranges of classes
}

Expand Down

0 comments on commit 66a2a18

Please sign in to comment.