It's not a bug. It may not be the way you want it
to perform, but it -is- performing as designed and
documented.
It was designed this way in a (as far as I can tell,
misguided) attempt to provide better speed for search
results for the 90% of cases where word-start is what
you're after.
I say misguided because you still have to compare
characters against -something- (i.e. space char)
in order to find the start of the next word, so you
might as well just compare against the pattern.
Of course, using regular expressions would be a
real speed-killer, but mere substring searching
shouldn't add significantly.
Finally, there's a great search algorithm that
actually eliminates the normal requirement that
each character in the search space get compared
against something -- I'd love to see Palm use
this in order to speed things up.
Instead of comparing the first char of the pattern
against the current char in the search space, you
compare the LAST char of the pattern against the
Nth char in the search space. If they match, then
you compare the next-to-last and the N-1th until you
get to the first char of the pattern (complete match)
or you mismatch. Here's the tricky part: if you mismatch
you then check the char in the search space (the one
that didn't match) against a table you've built from
the pattern. If the mismatched char does not appear in
the pattern at all, you can increment the start ptr
by the entire length of the pattern before trying
to match again (from the last char, back). If the
char -does- appear in the pattern, but not at the
position it's currently lined up against, you can
calculate the increment required to get that char
to line up against the same char in the pattern (the
table I mentioned records the position of the last
occurrance of each char that appears in the pattern,
for use in this calculation) and once those chars
are lined up, try matching from the end again.
As long as the mismatching char does not appear
in the pattern, you can increment your search ptr
by fairly large values each time, cutting down
on the number of comparisons you actually do have
to make. It slows down a little if the mismatching
char does appear in the pattern, but not by much.
--
-Richard M. Hartman
[EMAIL PROTECTED]
186,000 mi./sec ... not just a good idea, it's the LAW!
> -----Original Message-----
> From: Bobby Kolev [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 02, 1999 6:55 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Bug in PalmOS3.3-Search
>
>
> I really can't see how is this related to us.
> What you describe is a popular bug of the Palm's Search
> function and I would
> recommend taking a look at www.klyatskin.da.ru for the small
> patch that
> fixes it.
>
> Regards,
> Bobby Kolev
> www.beiks.com
>
> ----- Original Message -----
> From: <[EMAIL PROTECTED]>
> To: <kolev>
> Sent: Thursday, December 02, 1999 4:20 AM
> Subject: Bug in PalmOS3.3-Search
>
>
> >
> >
> > Greetings,
> >
> > first: Im not shure if this is the appropriate place to
> send bug-reports
> to, but
> > maybe we can find out if somebody else can reproduce the bug.
> >
> > The problem I encountered is in the "Search"-function of my
> PalmV. If I
> try to
> > search for a part of a telefone-number in my adress book,
> it will only
> find
> > "full-words".
> >
> > Here is an example:
> > I have the following phone-numbers (records) in my adress-book:
> >
> > 0664 5015693
> > 49 89 50068 653
> >
> > If I search (by pressing on the "lense") for "068" it wont
> find any record
> > although 068 is in the second number. If I search for 89
> the second record
> will
> > be found. If I look for "50" both numbers are found. It
> seems, that palm
> finds
> > all records *beginning* with the search-string but not
> *containing* the
> > search-string.
> >
> > As far as I could find out, this problem occurs with PalmOS
> V3.3. It seems
> to
> > work with PalmOS V3.1...
> >
> > Anyone can copy this problem?
> >
> > Gery
> > -------------------------------------------------------------------
> > Wolfgang Gernot Bauer
> > Projektleiter Internet
> > SKWB Schoellerbank AG
> > Sterneckstrasse 5, 5024 Salzburg, Austria/Europe
> > Tel.: ++43-662-8684-364
> > Fax.: ++43-662-8684-44364
> > e-Mail: [EMAIL PROTECTED]
> >
> >
> >
>
>