-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
The replace_time function will also currently change ratios. For example,
x = "We use a training-validation-test split of 60:20:20 for both datasets."
replace_time(x)
[1] "We use a training-validation-test split of 6zero twenty and twenty seconds for both datasets."
I think the regex pattern needs a break at the start. The simplest character is a space, but this might not be ideal:
time_pattern = " (2[0-3]|[01]?[0-9]):([0-5][0-9])[.:]?([0-5]?[0-9])?"
replace_time(x, time_pattern)
[1]"We use a training-validation-test split of 60:20:20 for both datasets."
x <- c(
NA, '12:47 to "twelve forty-seven" and also 8:35:02',
'what about 14:24.5', 'And then 99:99:99?'
)
replace_time(x, time_pattern)
[1] NA
[2] "12:47 to \"twelve forty-seven\" and also eight thirty-five and two seconds"
[3] "what about fourteen twenty-four and five seconds"
[4] "And then 99:99:99?"
Metadata
Metadata
Assignees
Labels
No labels