> 1. scan returns a list maximumTerms long (or to the end of the
> list) whether the scanClause finds a match or not. scan just
> attempts to find the position in the list of terms where the
> searchTerm falls if it exists in the database. If it does, great,
> if not, here's the list of terms around it.
Exactly right.
> 2. Use emptyTerm (or 0 or !) to make sure the list that's returned
> starts at the beginning of the list of all terms in the db.
Yes. You'd better use the empty term, though: if you use "0" you'll
miss all the entries that begin with punctuation; if you use "!"
you'll miss all the entries that (perhaps accidentally) begin with a
space; if you use " ", you'll miss entries that begin with control
characters. Also, if you use any of these, you are at the mercy of
the locale-specific sorting rules to do what you hope they will. But
_nothing_ sorts before the empty string, in any locale!
_/|_ ___________________________________________________________________
/o ) \/ Mike Taylor <[log in to unmask]> http://www.miketaylor.org.uk
)_v__/\ "Hearsay in a nice font" -- Jaron Collis's analysis of "quality"
newspapers' football coverage.
|