UNPKG

speech-rule-engine

Version:

A standalone speech rule engine for XML structures, based on the original engine from ChromeVox.

14 lines (13 loc) 361 B
import { NUMBERS as NUMB } from '../messages.js'; function numberToWords(num) { const digits = num.toString().split(''); return digits .map(function (digit) { return NUMBERS.ones[parseInt(digit, 10)]; }) .join(''); } export const NUMBERS = NUMB({ 'numberToWords': numberToWords, 'numberToOrdinal': numberToWords, });