1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/asterisk/say.conf Mon Apr 27 12:19:05 2009 +0200 1.3 @@ -0,0 +1,171 @@ 1.4 +; say.conf 1.5 +; 1.6 +; language configuration 1.7 +; 1.8 +; The new language routines produce strings of the form 1.9 +; prefix:[format:]data 1.10 +; that are matched against the rules in this file to produce 1.11 +; an output. 1.12 +; 1.13 +; The data is generally the string to be spelled (either a number, 1.14 +; an ascii string or a date/time in the format specified below). 1.15 +; It is available, in the right hand side of a rule, as variable ${SAY}. 1.16 +; 1.17 +; The format is optional and normally used only for date/time. 1.18 +; The prefix is used to select the pronunciation - standard 1.19 +; prefixes are 1.20 +; num used for numbers 1.21 +; enum used for enumerations 1.22 +; date for dates 1.23 +; time for times 1.24 +; datetime for dates and times 1.25 +; char for character strings 1.26 +; phonetic for phonetic strings 1.27 +; digit for digit strings 1.28 +; 1.29 +; but others can be used at will. 1.30 +; 1.31 +; Processing occurs as follows: 1.32 +; If the format is empty, or there is no format, the entire 1.33 +; string is matched against one of the pattern on the left hand side. 1.34 +; On the first match, the various comma-separated components on the right 1.35 +; hand side are pronounced, as follows: 1.36 +; + a component starting with a prefix: (i.e. with a ':' in it) 1.37 +; is re-processed according to these rules; 1.38 +; + a component without a ':' in it is considered a filename and 1.39 +; the corresponding file is played. 1.40 +; 1.41 +; If the format is non-empty, the format is split into its components 1.42 +; (individual characters, or filenames in single quotes), and then 1.43 +; filenames are played, whereas single characters are used to 1.44 +; generate a new string format:pat:data to be processed. 1.45 +; 1.46 +; DATES/AND TIMES assume that the date info is available in 1.47 +; the form YYYYMMDDHHmm.ss-dow-doy 1.48 +; with 4 digits for the year, 2 for month, day, hour, minutes, seconds, 1.49 +; one digit for the day-of-week, and 3 digits for the day-of-year. 1.50 +; 1.51 +; Example: 1.52 +; datetime::200604172030.00-4-102 1.53 +; (typical format for a date) is first matched against the line 1.54 +; datetime::. => date:AdBY 'digits/at' IMp:${SAY} 1.55 +; which is normally present with the default format for dates. 1.56 +; In turn, the format string "AdBY 'digits/at' IMp" results in 1.57 +; the sequence 1.58 +; date:A:200604172030.00-4-102 1.59 +; date:d:200604172030.00-4-102 1.60 +; date:B:200604172030.00-4-102 1.61 +; date:Y:200604172030.00-4-102 1.62 +; digits/at 1.63 +; date:I:200604172030.00-4-102 1.64 +; date:M:200604172030.00-4-102 1.65 +; date:p:200604172030.00-4-102 1.66 +; 1.67 +; 1.68 +; Remember, normally X Z N are special, and the search is 1.69 +; case insensitive, so you must use [X] [N] [Z] .. if you 1.70 +; want exact match. 1.71 + 1.72 +; We start with the basic rules that might be more-or-less 1.73 +; language-independent 1.74 + 1.75 +[digit-base](!) ; base rule for digit strings 1.76 + ; XXX incomplete yet 1.77 + _digit:[0-9] => digits/${SAY} 1.78 + _digit:[-] => letters/dash 1.79 + _digit:[*] => letters/star 1.80 + _digit:[@] => letters/at 1.81 + _digit:[0-9]. => digit:${SAY:0:1}, digit:${SAY:1} 1.82 + 1.83 +[date-base](!) ; base rules for dates and times 1.84 + ; the 'SAY' variable contains YYYYMMDDHHmm.ss-dow-doy 1.85 + ; these rule map the strftime attributes. 1.86 + _date:Y:. => num:${SAY:0:4} ; year, 19xx 1.87 + _date:[Bb]:. => digits/mon-$[${SAY:4:2}-1] ; month name, 0..11 1.88 + _date:[Aa]:. => digits/day-${SAY:16:1} ; day of week 1.89 + _date:[de]:. => num:${SAY:6:2} ; day of month 1.90 + _date:[hH]:. => num:${SAY:8:2} ; hour 1.91 + _date:[I]:. => num:$[${SAY:8:2} % 12] ; hour 0-12 1.92 + _date:[M]:. => num:${SAY:10:2} ; minute 1.93 + ; XXX too bad the '?' function does not remove the quotes 1.94 + ; _date:[pP]:. => digits/$[ ${SAY:10:2} > 12 ? "p-m" :: "a-m"] ; am pm 1.95 + _date:[pP]:. => digits/p-m ; am pm 1.96 + _date:[S]:. => num:${SAY:13:2} ; seconds 1.97 + 1.98 +[en-base](!) 1.99 + _[n]um:0. => num:${SAY:1} 1.100 + _[n]um:X => digits/${SAY} 1.101 + _[n]um:1X => digits/${SAY} 1.102 + _[n]um:[2-9]0 => digits/${SAY} 1.103 + _[n]um:[2-9][1-9] => digits/${SAY:0:1}0, num:${SAY:1} 1.104 + _[n]um:XXX => num:${SAY:0:1}, digits/hundred, num:${SAY:1} 1.105 + 1.106 + _[n]um:XXXX => num:${SAY:0:1}, digits/thousand, num:${SAY:1} 1.107 + _[n]um:XXXXX => num:${SAY:0:2}, digits/thousand, num:${SAY:2} 1.108 + _[n]um:XXXXXX => num:${SAY:0:3}, digits/thousand, num:${SAY:3} 1.109 + 1.110 + _[n]um:XXXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1} 1.111 + _[n]um:XXXXXXXX => num:${SAY:0:2}, digits/million, num:${SAY:2} 1.112 + _[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/million, num:${SAY:3} 1.113 + 1.114 + _[n]um:XXXXXXXXXX => num:${SAY:0:1}, digits/billion, num:${SAY:1} 1.115 + _[n]um:XXXXXXXXXXX => num:${SAY:0:2}, digits/billion, num:${SAY:2} 1.116 + _[n]um:XXXXXXXXXXXX => num:${SAY:0:3}, digits/billion, num:${SAY:3} 1.117 + 1.118 + ; enumeration 1.119 + _e[n]um:X => digits/h-${SAY} 1.120 + _e[n]um:1X => digits/h-${SAY} 1.121 + _e[n]um:[2-9]0 => digits/h-${SAY} 1.122 + _e[n]um:[2-9][1-9] => num:${SAY:0:1}0, digits/h-${SAY:1} 1.123 + _e[n]um:[1-9]XX => num:${SAY:0:1}, digits/hundred, enum:${SAY:1} 1.124 + 1.125 +[it](digit-base,date-base) 1.126 + _[n]um:0. => num:${SAY:1} 1.127 + _[n]um:X => digits/${SAY} 1.128 + _[n]um:1X => digits/${SAY} 1.129 + _[n]um:[2-9]0 => digits/${SAY} 1.130 + _[n]um:[2-9][1-9] => digits/${SAY:0:1}0, num:${SAY:1} 1.131 + _[n]um:1XX => digits/hundred, num:${SAY:1} 1.132 + _[n]um:[2-9]XX => num:${SAY:0:1}, digits/hundred, num:${SAY:1} 1.133 + 1.134 + _[n]um:1XXX => digits/thousand, num:${SAY:1} 1.135 + _[n]um:[2-9]XXX => num:${SAY:0:1}, digits/thousands, num:${SAY:1} 1.136 + _[n]um:XXXXX => num:${SAY:0:2}, digits/thousands, num:${SAY:2} 1.137 + _[n]um:XXXXXX => num:${SAY:0:3}, digits/thousands, num:${SAY:3} 1.138 + 1.139 + _[n]um:1XXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1} 1.140 + _[n]um:[2-9]XXXXXX => num:${SAY:0:1}, digits/millions, num:${SAY:1} 1.141 + _[n]um:XXXXXXXX => num:${SAY:0:2}, digits/millions, num:${SAY:2} 1.142 + _[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/millions, num:${SAY:3} 1.143 + 1.144 + _datetime::. => date:AdBY 'digits/at' IMp:${SAY} 1.145 + _date::. => date:AdBY:${SAY} 1.146 + _time::. => date:IMp:${SAY} 1.147 + 1.148 +[en](en-base,date-base,digit-base) 1.149 + _datetime::. => date:AdBY 'digits/at' IMp:${SAY} 1.150 + _date::. => date:AdBY:${SAY} 1.151 + _time::. => date:IMp:${SAY} 1.152 + 1.153 +[de](date-base,digit-base) 1.154 + _[n]um:0. => num:${SAY:1} 1.155 + _[n]um:X => digits/${SAY} 1.156 + _[n]um:1X => digits/${SAY} 1.157 + _[n]um:[2-9]0 => digits/${SAY} 1.158 + _[n]um:[2-9][1-9] => digits/${SAY:1}-and, digits/${SAY:0:1}0 1.159 + _[n]um:1XX => digits/ein, digits/hundred, num:${SAY:1} 1.160 + _[n]um:[2-9]XX => digits/${SAY:0:1}, digits/hundred, num:${SAY:1} 1.161 + _[n]um:1XXX => digits/ein, digits/thousand, num:${SAY:1} 1.162 + _[n]um:[2-9]XXX => digits/${SAY:0:1}, digits/thousand, num:${SAY:1} 1.163 + _[n]um:XXXXX => num:${SAY:0:2}, digits/thousand, num:${SAY:2} 1.164 + _[n]um:X00XXX => digits/${SAY:0:1}, digits/hundred, digits/thousand, num:${SAY:3} 1.165 + _[n]um:XXXXXX => digits/${SAY:0:1}, digits/hundred, num:${SAY:1} 1.166 + _[n]um:1XXXXXX => digits/eine, digits/million, num:${SAY:1} 1.167 + _[n]um:[2-9]XXXXXX => digits/${SAY:0:1}, digits/millions, num:${SAY:1} 1.168 + _[n]um:XXXXXXXX => num:${SAY:0:2}, digits/millions, num:${SAY:2} 1.169 + _[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/millions, num:${SAY:3} 1.170 + 1.171 + _datetime::. => date:AdBY 'digits/at' IMp:${SAY} 1.172 + _date::. => date:AdBY:${SAY} 1.173 + _time::. => date:IMp:${SAY} 1.174 +