You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
2.0 KiB
53 lines
2.0 KiB
Text preprocessing
|
|
|
|
o If the middle digit is larger than one, then the appropriate “tens” word
|
|
is pronounced (e.g. TWENTY, THIRTY, etc.). If the middle digit is
|
|
one, then the appropriate “teens” word is selected based on the
|
|
rightmost digit (e.g. TEN, ELEVEN, TWELVE, etc.).
|
|
|
|
o If the middle digit is not one and the rightmost digit is not zero, then
|
|
|
|
the rightmost digit is pronounced.
|
|
|
|
If a period separates two numeric strings, then it is translated into the word
|
|
POINT and the following numeric string is pronounced digit-by-digit (e.g. .015—
|
|
POINT OH ONE FIVE). Note that 0 is pronounced OH in this case. A 0 is
|
|
pronounced as ZERO only if it is a one-digit number. For example:
|
|
|
|
¢ 715—SEVEN HUNDRED FIFTEEN
|
|
|
|
¢ 71.50 - SEVENTY ONE POINT FIVE OH
|
|
|
|
¢ 159,106 ~ONE HUNDRED FIFTY NINE THOUSAND ONE
|
|
HUNDRED SIX
|
|
|
|
2.4.7 Dollars and cents
|
|
If a dollar sign ($) precedes a number as described above, then the following
|
|
modifications to the pronunciation are made:
|
|
|
|
e The word DOLLAR or DOLLARS is inserted after the integer part.
|
|
¢ The decimal point is pronounced as AND instead of POINT.
|
|
¢ The fraction part is pronounced in two-digit decimal form.
|
|
|
|
e The word CENT or CENTS is appended after the fraction part.
|
|
For example, $71.50 - SEVENTY ONE DOLLARS AND FIFTY CENTS.
|
|
|
|
2.4.8 Years and comma-less numbers
|
|
A string of more than three digits without commas is given special treatment. If
|
|
the number has four digits, the first of which is 1, then it is considered to be a year
|
|
and is pronounced as follows:
|
|
¢ The leftmost two digits are pronounced as “teens”.
|
|
o If the rightmost two digits are both 0 then they are pronounced as
|
|
HUNDRED. If they are 0 followed by a nonzero digit then they are
|
|
pronounced individually. Otherwise, the rightmost two digits are
|
|
|
|
pronounced in decimal form.
|
|
|
|
Digit strings longer than three digits which do not contain commas (and are
|
|
not candidates for year pronunciation) are pronounced as individual digits. Strings
|
|
of less than four digits which begin with 0 are also pronounced individually.
|
|
|
|
Some examples are:
|
|
|
|
21
|