2 ; language configuration
6 mode=old ; method for playing numbers and dates
7 ; old - using asterisk core function
8 ; new - using this configuration file
10 ; The new language routines produce strings of the form
11 ; prefix:[format:]data
12 ; that are matched against the rules in this file to produce
15 ; The data is generally the string to be spelled (either a number,
16 ; an ascii string or a date/time in the format specified below).
17 ; It is available, in the right hand side of a rule, as variable ${SAY}.
19 ; The format is optional and normally used only for date/time.
20 ; The prefix is used to select the pronunciation - standard
22 ; num used for numbers
23 ; enum used for enumerations
26 ; datetime for dates and times
27 ; char for character strings
28 ; phonetic for phonetic strings
29 ; digit for digit strings
31 ; but others can be used at will.
33 ; Processing occurs as follows:
34 ; If the format is empty, or there is no format, the entire
35 ; string is matched against one of the pattern on the left hand side.
36 ; On the first match, the various comma-separated components on the right
37 ; hand side are pronounced, as follows:
38 ; + a component starting with a prefix: (i.e. with a ':' in it)
39 ; is re-processed according to these rules;
40 ; + a component without a ':' in it is considered a filename and
41 ; the corresponding file is played.
43 ; If the format is non-empty, the format is split into its components
44 ; (individual characters, or filenames in single quotes), and then
45 ; filenames are played, whereas single characters are used to
46 ; generate a new string format:pat:data to be processed.
48 ; DATES/AND TIMES assume that the date info is available in
49 ; the form YYYYMMDDHHmm.ss-dow-doy
50 ; with 4 digits for the year, 2 for month, day, hour, minutes, seconds,
51 ; one digit for the day-of-week, and 3 digits for the day-of-year.
54 ; datetime::200604172030.00-4-102
55 ; (typical format for a date) is first matched against the line
56 ; datetime::. => date:AdBY 'digits/at' IMp:${SAY}
57 ; which is normally present with the default format for dates.
58 ; In turn, the format string "AdBY 'digits/at' IMp" results in
60 ; date:A:200604172030.00-4-102
61 ; date:d:200604172030.00-4-102
62 ; date:B:200604172030.00-4-102
63 ; date:Y:200604172030.00-4-102
65 ; date:I:200604172030.00-4-102
66 ; date:M:200604172030.00-4-102
67 ; date:p:200604172030.00-4-102
70 ; Remember, normally X Z N are special, and the search is
71 ; case insensitive, so you must use [X] [N] [Z] .. if you
74 ; We start with the basic rules that might be more-or-less
75 ; language-independent
77 [digit-base](!) ; base rule for digit strings
79 _digit:[0-9] => digits/${SAY}
80 _digit:[-] => letters/dash
81 _digit:[*] => letters/star
82 _digit:[@] => letters/at
83 _digit:[0-9]. => digit:${SAY:0:1}, digit:${SAY:1}
85 [date-base](!) ; base rules for dates and times
86 ; the 'SAY' variable contains YYYYMMDDHHmm.ss-dow-doy
87 ; these rule map the strftime attributes.
88 _date:Y:. => num:${SAY:0:4} ; year, 19xx
89 _date:[Bb]:. => digits/mon-$[${SAY:4:2}-1] ; month name, 0..11
90 _date:[Aa]:. => digits/day-${SAY:16:1} ; day of week
91 _date:[de]:. => num:${SAY:6:2} ; day of month
92 _date:[hH]:. => num:${SAY:8:2} ; hour
93 _date:[I]:. => num:$[${SAY:8:2} % 12] ; hour 0-12
94 _date:[M]:. => num:${SAY:10:2} ; minute
95 ; XXX too bad the '?' function does not remove the quotes
96 ; _date:[pP]:. => digits/$[ ${SAY:10:2} > 12 ? "p-m" :: "a-m"] ; am pm
97 _date:[pP]:. => digits/p-m ; am pm
98 _date:[S]:. => num:${SAY:13:2} ; seconds
101 _[n]um:0. => num:${SAY:1}
102 _[n]um:X => digits/${SAY}
103 _[n]um:1X => digits/${SAY}
104 _[n]um:[2-9]0 => digits/${SAY}
105 _[n]um:[2-9][1-9] => digits/${SAY:0:1}0, num:${SAY:1}
106 _[n]um:XXX => num:${SAY:0:1}, digits/hundred, num:${SAY:1}
108 _[n]um:XXXX => num:${SAY:0:1}, digits/thousand, num:${SAY:1}
109 _[n]um:XXXXX => num:${SAY:0:2}, digits/thousand, num:${SAY:2}
110 _[n]um:XXXXXX => num:${SAY:0:3}, digits/thousand, num:${SAY:3}
112 _[n]um:XXXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1}
113 _[n]um:XXXXXXXX => num:${SAY:0:2}, digits/million, num:${SAY:2}
114 _[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/million, num:${SAY:3}
116 _[n]um:XXXXXXXXXX => num:${SAY:0:1}, digits/billion, num:${SAY:1}
117 _[n]um:XXXXXXXXXXX => num:${SAY:0:2}, digits/billion, num:${SAY:2}
118 _[n]um:XXXXXXXXXXXX => num:${SAY:0:3}, digits/billion, num:${SAY:3}
121 _e[n]um:X => digits/h-${SAY}
122 _e[n]um:1X => digits/h-${SAY}
123 _e[n]um:[2-9]0 => digits/h-${SAY}
124 _e[n]um:[2-9][1-9] => num:${SAY:0:1}0, digits/h-${SAY:1}
125 _e[n]um:[1-9]XX => num:${SAY:0:1}, digits/hundred, enum:${SAY:1}
127 [it](digit-base,date-base)
128 _[n]um:0. => num:${SAY:1}
129 _[n]um:X => digits/${SAY}
130 _[n]um:1X => digits/${SAY}
131 _[n]um:[2-9]0 => digits/${SAY}
132 _[n]um:[2-9][1-9] => digits/${SAY:0:1}0, num:${SAY:1}
133 _[n]um:1XX => digits/hundred, num:${SAY:1}
134 _[n]um:[2-9]XX => num:${SAY:0:1}, digits/hundred, num:${SAY:1}
136 _[n]um:1XXX => digits/thousand, num:${SAY:1}
137 _[n]um:[2-9]XXX => num:${SAY:0:1}, digits/thousands, num:${SAY:1}
138 _[n]um:XXXXX => num:${SAY:0:2}, digits/thousands, num:${SAY:2}
139 _[n]um:XXXXXX => num:${SAY:0:3}, digits/thousands, num:${SAY:3}
141 _[n]um:1XXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1}
142 _[n]um:[2-9]XXXXXX => num:${SAY:0:1}, digits/millions, num:${SAY:1}
143 _[n]um:XXXXXXXX => num:${SAY:0:2}, digits/millions, num:${SAY:2}
144 _[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/millions, num:${SAY:3}
146 _datetime::. => date:AdBY 'digits/at' IMp:${SAY}
147 _date::. => date:AdBY:${SAY}
148 _time::. => date:IMp:${SAY}
150 [en](en-base,date-base,digit-base)
151 _datetime::. => date:AdBY 'digits/at' IMp:${SAY}
152 _date::. => date:AdBY:${SAY}
153 _time::. => date:IMp:${SAY}
155 [de](date-base,digit-base)
156 _[n]um:0. => num:${SAY:1}
157 _[n]um:X => digits/${SAY}
158 _[n]um:1X => digits/${SAY}
159 _[n]um:[2-9]0 => digits/${SAY}
160 _[n]um:[2-9][1-9] => digits/${SAY:1}-and, digits/${SAY:0:1}0
161 _[n]um:1XX => digits/ein, digits/hundred, num:${SAY:1}
162 _[n]um:[2-9]XX => digits/${SAY:0:1}, digits/hundred, num:${SAY:1}
163 _[n]um:1XXX => digits/ein, digits/thousand, num:${SAY:1}
164 _[n]um:[2-9]XXX => digits/${SAY:0:1}, digits/thousand, num:${SAY:1}
165 _[n]um:XXXXX => num:${SAY:0:2}, digits/thousand, num:${SAY:2}
166 _[n]um:X00XXX => digits/${SAY:0:1}, digits/hundred, digits/thousand, num:${SAY:3}
167 _[n]um:XXXXXX => digits/${SAY:0:1}, digits/hundred, num:${SAY:1}
168 _[n]um:1XXXXXX => digits/eine, digits/million, num:${SAY:1}
169 _[n]um:[2-9]XXXXXX => digits/${SAY:0:1}, digits/millions, num:${SAY:1}
170 _[n]um:XXXXXXXX => num:${SAY:0:2}, digits/millions, num:${SAY:2}
171 _[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/millions, num:${SAY:3}
173 _datetime::. => date:AdBY 'digits/at' IMp:${SAY}
174 _date::. => date:AdBY:${SAY}
175 _time::. => date:IMp:${SAY}
177 [hu](digit-base,date-base)
178 _[n]um:0. => num:${SAY:1}
179 _[n]um:X => digits/${SAY}
180 _[n]um:1[1-9] => digits/10en, digits/${SAY:1}
181 _[n]um:2[1-9] => digits/20on, digits/${SAY:1}
182 _[n]um:[1-9]0 => digits/${SAY}
183 _[n]um:[3-9][1-9] => digits/${SAY:0:1}0, num:${SAY:1}
184 _[n]um:XXX => num:${SAY:0:1}, digits/hundred, num:${SAY:1}
186 _[n]um:XXXX => num:${SAY:0:1}, digits/thousand, num:${SAY:1}
187 _[n]um:XXXXX => num:${SAY:0:2}, digits/thousand, num:${SAY:2}
188 _[n]um:XXXXXX => num:${SAY:0:3}, digits/thousand, num:${SAY:3}
190 _[n]um:XXXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1}
191 _[n]um:XXXXXXXX => num:${SAY:0:2}, digits/million, num:${SAY:2}
192 _[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/million, num:${SAY:3}
194 _[n]um:XXXXXXXXXX => num:${SAY:0:1}, digits/billion, num:${SAY:1}
195 _[n]um:XXXXXXXXXXX => num:${SAY:0:2}, digits/billion, num:${SAY:2}
196 _[n]um:XXXXXXXXXXXX => num:${SAY:0:3}, digits/billion, num:${SAY:3}
198 _datetime::. => date:YBdA k 'ora' M 'perc':${SAY}
199 _date::. => date:YBdA:${SAY}
200 _time::. => date:k 'ora' M 'perc':${SAY}