Subject: [htdig3-dev] htword cosmetics + bug fix
From: loic@ceic.com
Date: Thu Jan 13 2000 - 07:53:22 PST
Hi,
These are more htword cosmetic changes. Plus a bug fix. The WordType
instance was not initialized soon enough, that triggered some memory corruption
in some cases. I took advantage of this fix to simplify WordContext a lot.
make distcheck is on the way.
Cheers,
* htword/WordContext.h (class WordContext): simplifies a lot. WordContext is
no longer a repository for pointers of class instances. Only a place to call
Initialize for classes that have a single instance.
* htlib/HtWordType.cc: added to include definition of functions shortcuts for
WordType.
* htword/WordRecord.h,WordType.h,WordKeyInfo.h: implement homogeneous scheme to
handle unique instance of the class.
- constructor takes const Configuration& argument and init object with config
values
- static member instance
- static method Initialize the static member instance
- static method Instance returns the pointer in instance data member
* htword/WordRecord.cc: add constructor for WordRecordInfo, and Instance static
function. Add WORD_RECORD_INVALID to depict uninitialize WordRecordInfo object.
* htword/WordKeyInfo.h: rename SetKeyDescriptionFromFile and SetKeyDescriptionFromString
to InitializeFromFile and InitializeFromString and implement them by calling Initialize.
rename SetKeyDescriptionRandom to InitializeRandom
rename Initialize(String& line) to GetNFields(String& line)
rename Initialize(int nfields) to Alloc(int nfields)
* htdig/htdig.cc,htmerge/htmerge.cc,htsearch/htsearch.cc,test/word.cc: replace
WordList::Initialize with WordContext::Initialize and run immediately after
config is read. Otherwise WordType fails to work and configuration value
extraction will fail.
* htmerge/htmerge.cc: move initialization
* test/conf/htdig.conf2.in: reorder so that it looks as much as possible as conf.in
-- Loic Dachary24 av Secretan 75019 Paris Tel: 33 1 42 45 09 16 e-mail: loic@dachary.org URL: http://www.senga.org/
------------------------------------ To unsubscribe from the htdig3-dev mailing list, send a message to htdig3-dev-unsubscribe@htdig.org You will receive a message to confirm this.
This archive was generated by hypermail 2b28 : Thu Jan 13 2000 - 06:48:38 PST