mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-11-03 20:38:59 +00:00 
			
		
		
		
	add example syntax for new-style number and date spelling
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@21420 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		
							
								
								
									
										129
									
								
								configs/say.conf.sample
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										129
									
								
								configs/say.conf.sample
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,129 @@
 | 
			
		||||
; say.conf
 | 
			
		||||
; 
 | 
			
		||||
; language configuration
 | 
			
		||||
;
 | 
			
		||||
; The new language routines produce strings of the form
 | 
			
		||||
;	prefix:[format:]data
 | 
			
		||||
; that are matched against the rules in this file to produce
 | 
			
		||||
; an output.
 | 
			
		||||
;
 | 
			
		||||
; The data is generally the string to be spelled (either a number,
 | 
			
		||||
; an ascii string or a date/time in the format specified below).
 | 
			
		||||
; It is available, in the right hand side of a rule, as variable ${SAY}.
 | 
			
		||||
;
 | 
			
		||||
; The format is optional and normally used only for date/time.
 | 
			
		||||
; The prefix is used to select the pronunciation - standard
 | 
			
		||||
; prefixes are
 | 
			
		||||
;	num		used for numbers
 | 
			
		||||
;	enum		used for enumerations
 | 
			
		||||
;	date 		for dates
 | 
			
		||||
;	time 		for times
 | 
			
		||||
;	datetime	for dates and times
 | 
			
		||||
;	char		for character strings
 | 
			
		||||
;	phonetic	for phonetic strings
 | 
			
		||||
;
 | 
			
		||||
; but others can be used at will.
 | 
			
		||||
;
 | 
			
		||||
; Processing occurs as follows:
 | 
			
		||||
; If the format is empty, or there is no format, the entire
 | 
			
		||||
; string is matched agains one of the pattern on the left hand side.
 | 
			
		||||
; On the first match, the various comma-separated components on the right
 | 
			
		||||
; hand side are pronounced, as follows:
 | 
			
		||||
; + a component starting with a prefix: (i.e. with a ':' in it)
 | 
			
		||||
;   is re-processed according to these rules;
 | 
			
		||||
; + a component without a ':' in it is considered a filename and
 | 
			
		||||
;   the corresponding file is played.
 | 
			
		||||
;
 | 
			
		||||
; If the format is non-empty, the format is split into its components
 | 
			
		||||
; (individual characters, or filenames in single quotes), and then
 | 
			
		||||
; filenames are played, whereas single characters are used to
 | 
			
		||||
; generate a new string format:pat:data to be processed.
 | 
			
		||||
;
 | 
			
		||||
; DATES/AND TIMES assume that the date info is available in
 | 
			
		||||
; the form	 YYYYMMDDHHmm.ss-dow-doy
 | 
			
		||||
; with 4 digits for the year, 2 for month, day, hour, minutes, seconds,
 | 
			
		||||
; one digit for the day-of-week, and 3 digits for the day-of-year.
 | 
			
		||||
;
 | 
			
		||||
; Example:
 | 
			
		||||
;     datetime::200604172030.00-4-102
 | 
			
		||||
; (typical format for a date) is first matched against the line
 | 
			
		||||
;	datetime::. => date:AdBY 'digits/at' IMp:${SAY}
 | 
			
		||||
; which is normally present with the default format for dates.
 | 
			
		||||
; In turn, the format string "AdBY 'digits/at' IMp" results in
 | 
			
		||||
; the sequence
 | 
			
		||||
;	date:A:200604172030.00-4-102
 | 
			
		||||
;	date:d:200604172030.00-4-102
 | 
			
		||||
;	date:B:200604172030.00-4-102
 | 
			
		||||
;	date:Y:200604172030.00-4-102
 | 
			
		||||
;	digits/at
 | 
			
		||||
;	date:I:200604172030.00-4-102
 | 
			
		||||
;	date:M:200604172030.00-4-102
 | 
			
		||||
;	date:p:200604172030.00-4-102
 | 
			
		||||
;
 | 
			
		||||
; 
 | 
			
		||||
; Remember, normally X Z N are special, and the search is
 | 
			
		||||
; case insensitive, so you must use [X] [N] [Z] .. if you
 | 
			
		||||
; want exact match.
 | 
			
		||||
 | 
			
		||||
[en-base](!)
 | 
			
		||||
_[n]um:0. => num:${SAY:1}
 | 
			
		||||
_[n]um:X => digits/${SAY}
 | 
			
		||||
_[n]um:1X => digits/${SAY}
 | 
			
		||||
_[n]um:[2-9]0 =>  digits/${SAY}
 | 
			
		||||
_[n]um:[2-9][1-9] =>  digits/${SAY:0:1}0, num:${SAY:1}
 | 
			
		||||
_[n]um:XXX => num:${SAY:0:1}, digits/hundred, num:${SAY:1}
 | 
			
		||||
 | 
			
		||||
_[n]um:XXXX => num:${SAY:0:1}, digits/thousand, num:${SAY:1}
 | 
			
		||||
_[n]um:XXXXX => num:${SAY:0:2}, digits/thousand, num:${SAY:2}
 | 
			
		||||
_[n]um:XXXXXX => num:${SAY:0:3}, digits/thousand, num:${SAY:3}
 | 
			
		||||
 | 
			
		||||
_[n]um:XXXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1}
 | 
			
		||||
_[n]um:XXXXXXXX => num:${SAY:0:2}, digits/million, num:${SAY:2}
 | 
			
		||||
_[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/million, num:${SAY:3}
 | 
			
		||||
 | 
			
		||||
_[n]um:XXXXXXXXXX => num:${SAY:0:1}, digits/billion, num:${SAY:1}
 | 
			
		||||
_[n]um:XXXXXXXXXXX => num:${SAY:0:2}, digits/billion, num:${SAY:2}
 | 
			
		||||
_[n]um:XXXXXXXXXXXX => num:${SAY:0:3}, digits/billion, num:${SAY:3}
 | 
			
		||||
 | 
			
		||||
; enumeration
 | 
			
		||||
_e[n]um:X => digits/h-${SAY}
 | 
			
		||||
_e[n]um:1X => digits/h-${SAY}
 | 
			
		||||
_e[n]um:[2-9]0 => digits/h-${SAY}
 | 
			
		||||
_e[n]um:[2-9][1-9] => num:${SAY:0:1}0, digits/h-${SAY:1}
 | 
			
		||||
_e[n]um:[1-9]XX => num:${SAY:0:1}, digits/hundred, enum:${SAY:1}
 | 
			
		||||
 | 
			
		||||
[en](en-base)
 | 
			
		||||
 | 
			
		||||
[it]
 | 
			
		||||
_[n]um:0. => num:${SAY:1}
 | 
			
		||||
_[n]um:X => digits/${SAY}
 | 
			
		||||
_[n]um:1X => digits/${SAY}
 | 
			
		||||
_[n]um:[2-9]0 =>  digits/${SAY}
 | 
			
		||||
_[n]um:[2-9][1-9] =>  digits/${SAY:0:1}0, num:${SAY:1}
 | 
			
		||||
_[n]um:1XX => digits/hundred, num:${SAY:1}
 | 
			
		||||
_[n]um:[2-9]1XX => num:${SAY:0:1}, digits/hundred, num:${SAY:1}
 | 
			
		||||
 | 
			
		||||
_[n]um:1XXX => digits/thousand, num:${SAY:1}
 | 
			
		||||
_[n]um:[2-9]XXX => num:${SAY:0:1}, digits/thousands, num:${SAY:1}
 | 
			
		||||
_[n]um:XXXXX => num:${SAY:0:2}, digits/thousands, num:${SAY:2}
 | 
			
		||||
_[n]um:XXXXXX => num:${SAY:0:3}, digits/thousands, num:${SAY:3}
 | 
			
		||||
 | 
			
		||||
_[n]um:1XXXXXX => num:${SAY:0:1}, digits/million, num:${SAY:1}
 | 
			
		||||
_[n]um:[2-9]XXXXXX => num:${SAY:0:1}, digits/millions, num:${SAY:1}
 | 
			
		||||
_[n]um:XXXXXXXX => num:${SAY:0:2}, digits/millions, num:${SAY:2}
 | 
			
		||||
_[n]um:XXXXXXXXX => num:${SAY:0:3}, digits/millions, num:${SAY:3}
 | 
			
		||||
 | 
			
		||||
; YYYYMMDDHHmm.ss-dow-doy
 | 
			
		||||
_datetime::. => date:AdBY 'digits/at' IMp:${SAY}
 | 
			
		||||
_date::. => date:AdBY:${SAY}
 | 
			
		||||
_time::. => date:IMp:${SAY}
 | 
			
		||||
_date:Y:. => num:${SAY:0:4}	; year, 19xx
 | 
			
		||||
_date:[Bb]:. => digits/mon-$[${SAY:4:2}-1]	; month name, 0..11
 | 
			
		||||
_date:[Aa]:. => digits/day-${SAY:16:1}	; day of week
 | 
			
		||||
_date:[de]:. => num:${SAY:6:2}		; day of month
 | 
			
		||||
_date:[hH]:. => num:${SAY:8:2}		; hour
 | 
			
		||||
_date:[I]:. => num:$[${SAY:8:2} % 12]	; hour 0-12
 | 
			
		||||
_date:[M]:. => num:${SAY:10:2}		; minute
 | 
			
		||||
; _date:[pP]:. => digits/$[ ${SAY:10:2} > 12 ? "p-m" :: "a-m"]	; am pm
 | 
			
		||||
_date:[pP]:. => digits/p-m	; am pm
 | 
			
		||||
_date:[S]:. => num:${SAY:13:2}		; seconds
 | 
			
		||||
		Reference in New Issue
	
	Block a user