say.conf.sample 9.4 KB

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