Package Exports
- readint
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (readint) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
readint
Node application for a localized written number parsing, thought for being easily translated.
Examples
You can check out a demonstration of the component on its webpage.
Installation
Using NPM (Node Packaged Modules)
npm install readintStandalone JavaScript version (componented)
Download either the full or minified version in the dist folder, and include it to your web page.
Usage
readint(str[, locale])
Here's a list of the supported locales:
enEnglish (default)frFrenchesSpanishdeGerman
Testing suite
230/230 passing
make testTranslation files structure
All fields are mandatory, even if empty.
split(string, regex) – Used to.split()the input string into number tokens.replace(array) – Contains arrays used as parameters by the.replace()function :- (string, regex) – Value that will be replaced.
- (string) – Value that will replace the searched value.
LTRlevels(array) – Contains the levels that have to be read from left to right (for an explanation of what a level is, see the next field.) e.g., in English, the Level 1 is read from left to right (seventeen:7 + 10), unlike French (dix-sept:10 + 7)values(array) – Contains the written numbers of the language, ordered by ascending level. To simplify the translation and the execution, the given string number is tokenized, and each token is assigned its numbered value, and the level in which it is contained. Each level contains the level beneath it. The level 0 is used for digits and exceptions.- (object) – "stringValue": integerValue
Licence
MIT