epiverse-trace / numberize

Convert words to numbers in English, French and Spanish
https://epiverse-trace.github.io/numberize/
Other
4 stars 2 forks source link

account for the presence of numeric values in a vector of characters #9

Closed Karim-Mane closed 6 months ago

Karim-Mane commented 6 months ago

This PR aims at addressing the following issue:

bahadzie commented 6 months ago

Thanks for catching this @Karim-Mane

Please add the test below so we never have this problem in future.


test_that("vector with number and words and NA is properly handled", {
  res <- numberize(
    c(17, "dix", "soixante-cinq", "deux mille vingt-quatre", NA),
    lang = "fr"
  )
  expect_identical(res, c(17, 10, 65, 2024, NA))
})