According to Geoff Hutchison:
> OK, I promised a patch for the valid_punctuation problem. Here's a patch
> that adds the original user input, with punctuation, to the StringMatch
> used for excerpts.
> 
> However, I just noticed excerpt hilighting seems broken on my system. So I
> can't test it out. :-( I did put in debugging output, so I know it's
> setting the StringMatch correctly.
> 
> If someone could test this, I'd appreciate it. If someone can figure out
> why my excerpt hilighting isn't working, I'd be very, very happy.

It's working fine on my system, with the new databases.  Your patch seems
to work fine as well.  I've made a couple small changes, in the patch
below.  When I saw the IgnoreCase() after Pattern(), instead of before,
it just looked wrong to me, because everywhere else it's the other way
around.  Oddly enough, it seems to work either way, even though Pattern()
does make use of the existing trans table.  In the process of poking
around in IgnoreCase(), I think I uncovered a memory leak.  It's probably
small and inconsequential, but it seems IgnoreCase() should do this:

    if (local_alloc)
        delete [] trans;

before allocating a new table.  The other change in my patch is to move the
pos--; back to where it was, just after the loop that overincremented it.

--- htsearch/htsearch.cc.geoff  Fri Jan 29 10:01:00 1999
+++ htsearch/htsearch.cc        Fri Jan 29 10:29:10 1999
@@ -280,8 +280,8 @@
     // Assemble the full pattern for excerpt matching and highlighting
     //
     origPattern += logicalPattern;
-    searchWordsPattern.Pattern(origPattern);
     searchWordsPattern.IgnoreCase();
+    searchWordsPattern.Pattern(origPattern);
     if (debug)
       cout << "Excerpt pattern: " << origPattern << "\n";
     //
@@ -466,6 +466,7 @@
                    word << (char) t;
                    t = *pos++;
                }
+               pos--;
                if (boolean && mystrcasecmp(word.get(), "and") == 0)
                {
                    tempWords.Add(new WeightWord("&", -1.0));
@@ -495,7 +496,6 @@
                        tempWords.Add(ww);
                    }
                }
-               pos--;
                break;
            }
        }

-- 
Gilles R. Detillieux              E-mail: <[EMAIL PROTECTED]>
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 htdig3-dev mailing list, send a message to
[EMAIL PROTECTED] containing the single word "unsubscribe" in
the SUBJECT of the message.

Reply via email to