[Subject Prev][Subject Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hts-users:01684] Re: ReadString: String too long


Hi,

Tienshyang Huei Liang wrote:

I met this problem when I used too long questions. For example,
"Question_One_s2_ {(*-aa+*,*-bb+*,*-cc+*,*-dd+*,*-ee+*,*-ff+*,*-gg+*,*-hh+*,*-ii+*,*-jj+*,*-kk+*,*-ll+*,*-mm+*,*-nn+*,*-oo+*,*-pp+*,*-qq+*,*-rr+*,*-ss+*,*-tt+*,*-uu+*,*-vv+*,*-ww+*,*-xx+*,*-yy+*,*-zz+*).state[2].stream[1]}"
this sort of questions can cause the "String too long" problem when HHEd.exe loads decision trees into memory in order to add unseen context-dependent phones.

I modified HHEd.c and HShell.h a little bit and thus this problem was avoided. From my personal point of view, it is likely to be an out-of-bounds exception of an array index happening to HHEd.exe.

(1) In the function "Tree *LoadTree(char *name, Source *src)" of HHEd.c
The statement
"char buf[MAXSTRLEN], bname[64], index[64], mname[MAXSTRLEN], *p;",
should be changed into
"char buf[MAXSTRLEN], bname[640], index[640], mname[MAXSTRLEN], *p;".
Or you may use a larger number.

In HTS-2.1, the above part was modified as

char buf[MAXSTRLEN],bname[PAT_LEN],index[PAT_LEN],mname[MAXSTRLEN],*p;

PAT_LEN=1024 (in default), so it doesn't happen.

(2) In the definition "#define MAXSTRLEN 256    /* max length of a string */" of HShell.h
I used 2560 instead of 256, due to the length of those questions.

In HTS-2.1, MAXSTRLEN, MAXFNAMELEN, SMAX, and PATLEN can be specified via configure script. So you don't need to modify source code.

Having modified the two statements, HHEd.exe worked well.
My experiment were carried out under the HTS 2.0 final version. Thanks.

I don't know why many users still use HTS-2.0 (or 2.0.1). Because you don't have enough time to port your modifications for HTS-2.0 to HTS-2.1?

I personally believe that HTS-2.1 is quite good. Let's start shifting from 2.0 to 2.1 :-)

Regards,

Heiga ZEN (Byung Ha CHUN)

--
Heiga ZEN (Byung Ha CHUN)
Speech Technology Group
Cambridge Research Lab
Toshiba Research Europe
phone: +44 1223 436975

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________
Follow-Ups
[hts-users:01687] Re: ReadString: String too long, Tienshyang Huei Liang
References
[hts-users:01683] Re: ReadString: String too long, Tienshyang Huei Liang