FindReplace


Subject: FindReplace
From: Allan Shark Clark (shark@blueyonder.co.uk)
Date: Thu Aug 03 2000 - 19:16:51 CDT


Hi
  Fiddling around with the find and replace, I have changed it so that it
uses what I think is a faster string matching algorithm. Find the patch
attached.
There are still a couple of issues, one is the "magic number" where we
struggle if the document is massive, we have at the moment a foundAt
variable declared as a UT_sint32 and set to -1 which we later check to see
if we have found the string, I thought a quick fix for just now would be to
use an UT_uint32, this would give us twice the document size, we could
initialize it to the maxium for an int and then test to see if it was still
that value when we want to know if the string has been found (true this
would fail a bit if the string was found in that exact position but I don't
think that's going to happen very often and the current method would fail
anyway), I can't help thinking there is something wrong with this idea
though, someone please point out the obvious that I'm missing.
Secondly I'm going to change the findNext and _findNext functions to accept
another argument which would be the prefix function of the find string, this
would mean computing the prefix function could be done in the Replace dialog
code that way when we do a ReplaceAll we don't have to continually
re-compute the prefix function.
I'll try it anyway see how it goes.
Lastly once I have done that I was thinking of having a crack at
implementing searching for regular expressions, just wanted to make sure
that no-one else was currently working on this as I don't want to duplicate
effort.

Allan Clark
shark@blueyonder.co.uk




This archive was generated by hypermail 2b25 : Thu Aug 03 2000 - 19:15:46 CDT