[racket-dev] Potential search improvement

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Jun 14 13:22:43 EDT 2012

About two weeks ago, Sam Tobin-Hochstadt wrote:
> On Tue, May 29, 2012 at 11:53 AM, Eli Barzilay <eli at barzilay.org> wrote:
> > Three hours ago, Sam Tobin-Hochstadt wrote:
> >> Getting away from the discussion on sorting speed, I don't think
> >> my suggestion even requires sorting: just add a 1.5 for
> >> match-all-subword-parts-to-whole-id.
> >
> > That won't work, since "current-line-sep" will have the
> > all-subword match for both entries.  The first one is whatever
> > comes first in the alphabetically sorted index.  You can see the
> > same problem with a search for "current sep line".
> 
> No, what I mean is that you should separate based on whether the
> subwords in the search string cover the entire identifier.  So
> "current sep line" would rank "current-line-sep" ahead of
> "current-alist-line-sep" because "alist" isn't matched.

This is finally done.  It wasn't nearly as straightforward as you
think: the problem is that you need to compare two bags of strings,
which I did by a double loop over the input patterns sorted by length.

I think that this concludes the current work on the search, and will
commit soon.  More testing over the current version are welcome -- you
can use it at http://pre.racket-lang.org/docs/html/search/

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the dev mailing list.