[sword-devel] possibly bug of Sword 1.5.8 found?

Martin Gruner mg.pub at gmx.net
Wed Apr 13 01:02:46 MST 2005


Troy,

this is definitely not a StringMgr bug. Please see the attached test program. 
It iterates through ZhEnglish (and you can read that ;), showing the loop. 
This uses the standard Sword StringMgr. Might this be a faulty module? Other 
modules, like WebstersDict, and ZhHanzi, both of which use Unicode heavily, 
do work!

Blessings

mg

Am Dienstag, 12. April 2005 21:24 schrieb Troy A. Griffitts:
> The LD module driver uses a binary search algol to lookup a key.  The
> infinite loop suggests that the module is not in alphabetical order.  My
> first impression is that the bug could be caused by a few things:
>
> 	The StringMgr used to read the module alphabetized differently than the
> string functions used to create the module
>
> 	The write method is broken, not adding in order correctly.
> 	The binary search algol is broken.
>
> 	Could either of you find a module (preferably one with letters that I
> can read :) ) and exact entry it gets stuck on?  Code something like:
>
> 	mod.setKey("XYY");
> 	mod++;	// fails here.
>
> would be great!  I'll try to look into the problem if we can nail down a
> case like this.  Also please be sure to report what StringMgr you are
> using.  Thanks for the report!
>
> 		-Troy.
>
> Martin Gruner wrote:
> > Hi,
> >
> > I noticed that opening certain lexicons does not work atm. I tried it
> > with ZhEnglish. BibleTime loops through all lexicon entries first and
> > creates a cache file (delete this for testing). It is an endless loop,
> > however:
> >
> > (BibleTime 1.5pre) WARNING: Entry: 1 00 MILLION
> > (BibleTime 1.5pre) WARNING: Entry: 1 5TH PARTY CONGRESS
> > (BibleTime 1.5pre) WARNING: Entry: 1 CHRONICLES
> > (BibleTime 1.5pre) WARNING: Entry: 1 CORINTHIANS
> > (BibleTime 1.5pre) WARNING: Entry: 1 JOHN
> > (BibleTime 1.5pre) WARNING: Entry: 1 KINGS
> > (BibleTime 1.5pre) WARNING: Entry: 1 PETER
> > (BibleTime 1.5pre) WARNING: Entry: 1 SAMUEL
> > (BibleTime 1.5pre) WARNING: Entry: 1 THESSALONIANS
> > (BibleTime 1.5pre) WARNING: Entry: 1 TIMOTHY
> > (BibleTime 1.5pre) WARNING: Entry: 1-3 A.M.
> > (BibleTime 1.5pre) WARNING: Entry: 1-3 P.M.
> > (BibleTime 1.5pre) WARNING: Entry: 10 OF A PECK
> > (BibleTime 1.5pre) WARNING: Entry: 10 PECKS
> > (BibleTime 1.5pre) WARNING: Entry: 10 PERCENT
> > (BibleTime 1.5pre) WARNING: Entry: 100 MU
> > (BibleTime 1.5pre) WARNING: Entry: 100-METER DASH
> > (BibleTime 1.5pre) WARNING: Entry: 1000 TONS
> > (BibleTime 1.5pre) WARNING: Entry: 10000
> > (BibleTime 1.5pre) WARNING: Entry: 105 BILLION
> > (BibleTime 1.5pre) WARNING: Entry: 10TH EARTHLY BRANCH
> > (BibleTime 1.5pre) WARNING: Entry: 10TH HEAVENLY STEM
> > (BibleTime 1.5pre) WARNING: Entry: 11 A.M.-1 P.M.
> > (BibleTime 1.5pre) WARNING: Entry: 11 P.M.-1 A.M.
> > (BibleTime 1.5pre) WARNING: Entry: 11TH EARTHLY BRANCH
> > (BibleTime 1.5pre) WARNING: Entry: 12
> > (BibleTime 1.5pre) WARNING: Entry: 1 00 MILLION
> >
> > The corresponding code is this:
> >
> > do {
> >   if (isUnicode()) {
> >     m_entryList->append(QString::fromUtf8(module()->KeyText()));
> >   }
> >   else { //for latin1 modules use fromLatin1 because of speed
> >     m_entryList->append(QString(module()->KeyText()));
> >   }
> >   (*module())++;
> > } while ( !module()->Error() );
> >
> > So this looks like (on first sight) it might be a Sword bug.
> >
> > mg
> > _______________________________________________
> > sword-devel mailing list: sword-devel at crosswire.org
> > http://www.crosswire.org/mailman/listinfo/sword-devel
> > Instructions to unsubscribe/change your settings at above page
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
-------------- next part --------------
A non-text attachment was scrubbed...
Name: indextest.cpp
Type: text/x-c++src
Size: 421 bytes
Desc: not available
Url : http://www.crosswire.org/pipermail/sword-devel/attachments/20050413/5e855d52/indextest.bin


More information about the sword-devel mailing list