numb_replacements {doseminer}R Documentation

Dictionary of English names of numbers

Description

For internal use in words2number. When passed as a replacement to a function like str_replace_all, it turns the string into an arithmetic expression that can be evaluated to give an integer representation of the named number.

Usage

numb_replacements

Format

An object of class character of length 49.

Details

Lifted from Ben Marwick's words2number package and converted into a named vector (previously a chain of gsub calls).

Note

Does not yet fully support decimals, fractions or mixed fractions. Some limited support for 'half' expressions, e.g. 'one and a half'.

Source

https://github.com/benmarwick/words2number

Examples

## Not run: 
stringr::str_replace_all('one hundred and forty-two', numb_replacements)

## End(Not run)


[Package doseminer version 0.1.2 Index]