[Home]

Summary:ASTERISK-15013: [patch] default say.conf for new number method doesnt handle all numbers
Reporter:delvar (delvar)Labels:
Date Opened:2009-10-20 09:11:18Date Closed:2010-07-07 01:16:33
Priority:TrivialRegression?No
Status:Closed/CompleteComponents:Applications/app_playback
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) say.conf.en_GB.patch
( 1) say.conf.fix.patch
( 2) say.eng-base.conf
( 3) test.numbersay.conf
Description:the [en-base] in say.conf by default doesnt work very well when dealing with numbers like 100,100,100 (one hundred million one hundred thousand one hundred)

firstly it actualt says,
one hundred million zerro one hundred thousand zerro one hundred zerro
secondly its missing the 'and'

one hundred million one hundred thousand /and/ one hundred

anyway i spent an hour or so writing a new say.conf, ill upload it here along with a test dialplan to show it working.
Comments:By: delvar (delvar) 2009-10-20 09:18:43

maybe someone could test this too and make sure it works ok.
if all is good ill make a patch and submit it.

By: Tilghman Lesher (tilghman) 2009-10-20 09:21:24

There is no 'and' in English number pronunciation.

By: delvar (delvar) 2009-10-20 09:34:10

English does use 'and', American English doesn't.

a quick google turned this up,
http://esl.about.com/od/beginningvocabulary/a/ex_numbers.htm

'NOTE: British English takes 'and' between 'hundred and ...' American English omits 'and'. In the examples below, this is represented: (AND)'

By: David Woolley (davidw) 2009-10-20 10:03:34

It's true that British English uses "and" in numbers.  However, as the article says, it is only after "hundred", so the original example is wrong, or at least awkward.  (I think some people might put the "and" in before one hundred, but not before any other number of hundreds, and not if it wasn't a round hundred.)

By: delvar (delvar) 2009-10-20 10:18:43

the exact rules im not sure of, i can only go by what sounds right to me and the people i know (im no linguist!)
but there is always an ‘and’ between the Hundred and the tens or singles (if there are no other numbers after the hundred there is no ‘and’)
and there is always an ‘and’ before the last number is said be that 10, 100 or even 1,000

100,100,100
one hundred million one hundred thousand /and/ one hundred

100,123,100
one hundred million one hundred /and/ twenty tree thousand /and/ one hundred

100,123,123
one hundred million one hundred /and/ twenty three thousand one hundred /and/ twenty tree

105,001,000
one hundred /and/ five million /and/ one thousand

125,063,000
one hundred /and/ twenty five million /and/ sixty three thousand

if you want more examples I can go all day :D

By: Tilghman Lesher (tilghman) 2009-10-20 12:15:16

If you want to create a patch that adds "en_GB", that would be fine, but I'd prefer that we do not change the default "en" to include "and".  The number changes are fine, though.

By: delvar (delvar) 2009-10-20 12:16:51

ok ill work on this tomorrow and supply a patch.

By: delvar (delvar) 2009-10-21 04:23:41

Ok i have uploaded two patches,
say.conf.fix.patch this is the fix to en-base for the 100 and 1000 bug,
say.conf.en_GB.patch has the above but also includes en_GB with /and/ where required.

hope this is all ok. :)

By: Michael L. Young (elguero) 2010-07-06 21:36:44

The patch to fix the en-base for 100 and 1000 is working properly.

The patch adding en_GB works too.  

Just a thought though.  If someone wants to use en_GB as the language, wouldn't they normally have sound files for en_GB?  In looking at say.c, it handles the "and" properly.  The base en sounds do not have the sound file "digit/and".  The en_GB section would only be needed if someone wanted to follow the en_GB way of pronouncing numbers with the core en sound files.

In looking at how other languages are handled, it would appear they all have a "digit/and" sound file.  That is why say.c is programmed to look for "digit/and" under the languages sound directory.  It would make better sense to me to follow the same structure for uniformity sake.  With that said, a simple "cp /var/lib/asterisk/sounds/en/vm-and.gsm /var/lib/asterisk/sounds/en/digit/and.gsm" would accomplish this as well without the need to use say.conf.  Just my thoughts on this.  Perhaps, we should add some documentation to explain why the en_GB section was added.  Could help show the flexibility that is present by using say.conf?

By: Tilghman Lesher (tilghman) 2010-07-07 00:30:54

elguero:  yes, except that the core en sound files all sound like American English.  If someone wanted the British way of saying numbers, they would probably get recordings for the whole batch and the dialect would match.

By: Digium Subversion (svnbot) 2010-07-07 01:13:54

Repository: asterisk
Revision: 274417

U   branches/1.4/configs/say.conf.sample

------------------------------------------------------------------------
r274417 | tilghman | 2010-07-07 01:13:53 -0500 (Wed, 07 Jul 2010) | 8 lines

Correct how 100, 200, 300, etc. is said.  Also add the crazy British numbers.

(closes issue ASTERISK-15013)
Reported by: Delvar
Patches:
      say.conf.fix.patch uploaded by Delvar (license 908)
      (plus a few additional fixes and simplifications by me)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=274417

By: Digium Subversion (svnbot) 2010-07-07 01:15:43

Repository: asterisk
Revision: 274418

_U  trunk/
U   trunk/configs/say.conf.sample

------------------------------------------------------------------------
r274418 | tilghman | 2010-07-07 01:15:42 -0500 (Wed, 07 Jul 2010) | 15 lines

Merged revisions 274417 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
 r274417 | tilghman | 2010-07-07 01:13:54 -0500 (Wed, 07 Jul 2010) | 8 lines
 
 Correct how 100, 200, 300, etc. is said.  Also add the crazy British numbers.
 
 (closes issue ASTERISK-15013)
  Reported by: Delvar
  Patches:
        say.conf.fix.patch uploaded by Delvar (license 908)
        (plus a few additional fixes and simplifications by me)
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=274418

By: Digium Subversion (svnbot) 2010-07-07 01:16:32

Repository: asterisk
Revision: 274419

_U  branches/1.6.2/
U   branches/1.6.2/configs/say.conf.sample

------------------------------------------------------------------------
r274419 | tilghman | 2010-07-07 01:16:32 -0500 (Wed, 07 Jul 2010) | 22 lines

Merged revisions 274418 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk

................
 r274418 | tilghman | 2010-07-07 01:15:43 -0500 (Wed, 07 Jul 2010) | 15 lines
 
 Merged revisions 274417 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.4
 
 ........
   r274417 | tilghman | 2010-07-07 01:13:54 -0500 (Wed, 07 Jul 2010) | 8 lines
   
   Correct how 100, 200, 300, etc. is said.  Also add the crazy British numbers.
   
   (closes issue ASTERISK-15013)
    Reported by: Delvar
    Patches:
          say.conf.fix.patch uploaded by Delvar (license 908)
          (plus a few additional fixes and simplifications by me)
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=274419