On Fri, 26 Sep 2003 16:48:14 +0200 Xavier Nodet <[EMAIL PROTECTED]> wrote:

XN> > XN> But the most time-consuming task seems to be to convert *all* the
XN> > XN> searched strings to lower case so that the search is actually
XN> > XN> case-insensitive. Would it be possible to cache the lower-case version
XN> > XN> of the strings used in the address-book?
XN> 
XN> >  Yes, AdbEntry could do this. 
XN> 
XN> Correct. An AdbEntry would have additional members for the lower-case
XN> versions of all the searchable strings. We just have to reset them when
XN> the original string changes.

 Exactly. Do you have plans to do this in relatively near future? If not I
should add it to my short term TODO list...

XN> >  Or, rather, Matches() could do it (it would
XN> > just cache the values on the first call).
XN> 
XN> Yes, but we still need to reset them from time to time, and store them
XN> as additional members. Those changes would be global to the
XN> AdbEntryStoredInMemory class anyway, no?

 Yes, I just said that the caching should be done in Matches() method, not
when it is constructed.

XN> >  This shouldn't be a problem... as search takes literally seconds the
XN> > compilation time must be trivial.
XN> 
XN> But this must not be done for each search (I mean, we must not compile
XN> the pattern each time we want to compare it to *one* string): it is then
XN> longer than the current code. We need to give the wxQSPattern instance
XN> to the Matches method, so we have to change this code a little bit.

 Ok, but it's definitely worth it.

XN> I'm not so sure this can be done efficiently. And the point of compiling
XN> the search space is actually that it does not change from search to
XN> search, after all...

 Right, but here this is _almost_ the case... but not quite. In fact, we
could even do as if it didn't change and do search in 2 steps: first search
in the precompiled state and then verify that the matches we found are
still valid and look for any new ones among the changed strings only.
This does start to become a little complicated...

XN> Actually, I can't think of any feature that would benefit from compiling
XN> the set of strings in the ADB. Do we have any feature for which we need
XN> to answer the following question:
XN> 
XN>   Which, if any, of the ADB entries is included in this (rather long)
XN>   text?
XN> 

 No, I don't think so.

 Regards,
VZ



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-Developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-developers

Reply via email to