Don't speak leading zero in times (eg. 02:30)

git-svn-id: https://espeak.svn.sourceforge.net/svnroot/espeak/trunk@2 d46cf337-b52f-0410-862d-fd96e6ae7743
This commit is contained in:
jonsd
2007-05-05 20:50:26 +00:00
parent 8d59235f7a
commit bf23831778
+9 -2
View File
@@ -19,7 +19,7 @@
***************************************************************************/
#include "StdAfx.h"
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
@@ -525,7 +525,14 @@ int Translator::TranslateNumber_1(char *word, char *ph_out, unsigned int *flags,
if((word[0] == '0') && (prev_thousands == 0) && (word[1] != langopts.decimal_sep))
{
return(0); // number string with leading zero, speak as individual digits
if((n_digits == 2) && (word[3] == ':') && isdigit(word[5]) && isspace(word[7]))
{
// looks like a time 02:30, omit the leading zero
}
else
{
return(0); // number string with leading zero, speak as individual digits
}
}
if((langopts.numbers & 0x1000) && (word[n_digits] == ' '))