textclean
textclean copied to clipboard
replace_time error with repeating time values
replace_time has an issue with repeating values.
This is fine:
> c("01:30", "02:30", "3:30") |> textclean::replace_time()
[1] "one thirty" "two thirty" "three thirty"
Repeated value at beginning and end gets correct answer, with warning:
> c("01:30", "02:30", "3:30", "01:30") |> textclean::replace_time()
[1] "one thirty" "two thirty" "three thirty" "one thirty"
Warning message:
In as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names, :
Item 2 has 3 rows but longest item has 4; recycled with remainder.
Repeated value in middle puts results in wrong order, with warning:
> c("01:30", "02:30", "3:30", "01:30", "2:30") |> textclean::replace_time()
[1] "one thirty" "two thirty" "three thirty" "two thirty" "one thirty"
Warning message:
In as.data.table.list(x, keep.rownames = keep.rownames, check.names = check.names, :
Item 2 has 4 rows but longest item has 5; recycled with remainder.