Utterly Voice icon image Utterly Voice

Numbers

Number settings are found in the config\numbers.yaml file found in the application directory. These settings define how spoken words are interpreted as numbers.

Sign Words

The signWords setting controls how words are interpreted as numeric signs when spoken before a number. This setting is a list collection, and each item in the list is a map collection with the following two settings:

Setting Type Description
word String A word that can be interpreted as a sign.
value Number This is set to either -1 (negative) or 1 (positive).

Replacements

The replacements setting controls how certain text is replaced before processing words as a number. This is helpful because some recognizers misinterpret basic numbers as time or other types. This setting is a list collection. The order of items in this list are important, because text replacement is processed in the order supplied. Each item in the list is a map collection with the following two settings:

Setting Type Description
input String Text that should be replaced.
output String Text that will replace the input.
matchWholeWord Boolean If this is true, input is only replaced if it matches an entire word within the utterance. If this is false, input is replaced no matter where it occurs in the utterance.

Magnitudes

The magnitudes setting is used to define words that are used to set magnitudes within a number. For example, "thousand" is a magnitude setting number. This setting is a list collection, and each item in the list is a map collection with the following settings:

Setting Type Description
word String A word that can be interpreted as a magnitude.
factor Number This is a positive integer that is used to multiply the part of the number spoken before it. For example, "three thousand" is interpreted as 3 * 1000. If the word starts the decimal part of a number ("point"), set this value to 1.
isPartDelimiter Boolean If true, the word is used as a delimiter for a part of the number. For example, "thousand" is spoken to finish the part that is 4-6 characters to the left of the decimal point ("654" for "654321").

If false, the word is never used as a part delimiter. For example, "hundred".

Number Words

The numberWords setting defines how individual words are interpreted as digits of a number. These words are only used when the input is known to be numeric, so you can be fairly aggressive when interpreting like-sounding words as numbers. This setting is a list collection, and each item in the list is a map collection with the following settings:

Setting Type Description
word String A word that can be interpreted as a number.
alternates List Collection A list of strings that can also be interpreted as this number.
value Number The numeric value of the word.
mayBeDigitOneOfTwo Boolean If true, this word might be the first part of a two digit portion of a number. For example, "twenty" might be the first digit of 24.

If false, this word is never the first part of a two digit portion of a number. For example, "five" is never the first digit of a two digit number.
mayBeDigitTwoOfTwo Boolean If true, this word might be the second part of a two digit portion of a number. For example, "four" might be the second digit of 24.

If false, this word is never the second part of a two digit portion of a number. For example, "twenty" is never the second digit of a two digit number.