[fpc-pascal] How create a full text search with TChmWriter?

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Feb 23 00:01:08 CET 2012


On Wed, 22 Feb 2012 12:06:08 -0500
Andrew Haines <AndrewD207 at aol.com> wrote:

> On 02/21/12 10:08, Mattias Gaertner wrote:
> > 
> > Andrew Haines <andrewd207 at aol.com> hat am 21. Februar 2012 um 15:24
> > geschrieben:
> 
> > 
> >> I guess then you are using AddStreamToArchive.
> > 
> >  
> > 
> > No. I set 
> > 
> >     Writer.OnGetFileData :=@OnWriterGetFileData;
> > And in OnWriterGetFileData I write the html into the stream.
> > 
> 
> 
> Ok I found a bug here which may affect you or not.
> 
> in OnWriterGetFileData make sure you set Stream.Size = 0 before you
> write your file to it. It will keep the size of the biggest stream you
> have given it to compress otherwise.

Yes, this helped. 
Now the files are done in under a minute and with only 500MB. But then
mem consumption goes up again. Then it goes down to 5GB and seems to
be stuck in an endless loop. I cancelled it.

I tried with only 500 files and it worked. That means I get a help and
it finds files. But choosing a page just shows black. And after that
any page is black.
Note: If I don't use the search but the Index, then I see the pages.

I compiled the chm units with -Criot and found various range check
errors and uninitialized variables which I can fix myself. But then I
came to a point where don't know what to do:

chmfiftimain.pas(361,49) Warning: Constructing a class "TLeafNode" with abstract method "ChildIsFull"
chmfiftimain.pas(72,15) Hint: Found abstract method: TFIftiNode.ChildIsFull(<TFIftiNode>,AnsiString,LongWord);

And I get an exception in:
#5  0x00000000005552aa in CHILDISFULL (this=0x415906, 
    AWORD=0x409d0c "\311\303f\220H\203\354(H\211\\$\bL\211d$\020L\211l$\030L\211t$ I\211\376I\211\365f\211\323L\211\350H\203", <incomplete sequence \370>, ANODEOFFSET=8234056) at chmfiftimain.pas:688
#6  0x00000000005552aa in CHILDISFULL (this=0x7fffdd9a0b40, AWORD=0x0, ANODEOFFSET=3579960) at chmfiftimain.pas:688


Mattias




More information about the fpc-pascal mailing list