Re: [htdig] problems with the "accent" patch


Subject: Re: [htdig] problems with the "accent" patch
From: Gilles Detillieux (grdetil@scrc.umanitoba.ca)
Date: Thu Mar 02 2000 - 14:38:27 PST


According to Robert Marchand:
> I will add a correction to have accents keys in sync with the
> maximum_word_length parameter.

Here's a kludgy fix, which I haven't tested yet, but I think will work.
I'm not wild about the external reference to config, while other methods
in this class have the config object passed to them, but it should get
the job done. Obviously, this patch should be applied after the one
I posted earlier today, still using patch -p1.

--- htdig-3.1.5.accents/htfuzzy/Accents.cc.notrunc Thu Mar 2 11:25:42 2000
+++ htdig-3.1.5.accents/htfuzzy/Accents.cc Thu Mar 2 16:33:10 2000
@@ -134,10 +134,16 @@ Accents::writeDB(Configuration &config)
 void
 Accents::generateKey(char *word, String &key)
 {
+ extern Configuration config;
+ static int maximum_word_length = config.Value("maximum_word_length", 12);
 
     if (!word || !*word)
       return;
 
+ String temp(word);
+ if (temp.length() > maximum_word_length)
+ temp.chop(temp.length()-maximum_word_length);
+ word = temp.get();
     key = '0';
     while (*word) {
       key << MinusculeISOLAT1[ (unsigned char) *word++ ];

-- 
Gilles R. Detillieux              E-mail: <grdetil@scrc.umanitoba.ca>
Spinal Cord Research Centre       WWW:    http://www.scrc.umanitoba.ca/~grdetil
Dept. Physiology, U. of Manitoba  Phone:  (204)789-3766
Winnipeg, MB  R3E 3J7  (Canada)   Fax:    (204)789-3930

------------------------------------ To unsubscribe from the htdig mailing list, send a message to htdig-unsubscribe@htdig.org You will receive a message to confirm this.



This archive was generated by hypermail 2b28 : Thu Mar 02 2000 - 14:42:47 PST