Package 'numberize'

Title: Convert Words to Numbers in Multiple Languages
Description: Converts written out numbers into their equivalent numbers. Supports numbers written out in English, French, or Spanish.
Authors: Chris Hartgerink [rev] , Joshua W. Lambert [ctb] , Karim Mané [ctb] , Hugo Gruson [aut] , Bankole Ahadzie [aut, cre, cph]
Maintainer: Bankole Ahadzie <[email protected]>
License: MIT + file LICENSE
Version: 1.0.1
Built: 2024-10-28 21:16:45 UTC
Source: https://github.com/epiverse-trace/numberize

Help Index


Convert a vector string of spelled numbers in a supported language to its numeric equivalent.

Description

The range of words supported is between zero and nine hundred and ninety nine trillion, nine hundred and ninety nine billion, nine hundred and ninety nine million, nine hundred and ninety nine thousand, nine hundred and ninety nine

Usage

numberize(text, lang = c("en", "fr", "es"))

Arguments

text

String vector of spelled numbers in a supported language.

lang

The text's language. Currently one of c("en", "fr", "es"). Default is "en"

Value

A numeric vector.

Examples

# convert to numbers a scalar
numberize("five hundred and thirty eight")

# convert a vector of values
numberize(c("dix", "soixante-cinq", "deux mille vingt-quatre"), lang = "fr")