[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gperf-bugs] Revised gperf 2.7.2 patch
From: |
Bruno Haible |
Subject: |
Re: [Gperf-bugs] Revised gperf 2.7.2 patch |
Date: |
Thu, 28 Nov 2002 22:36:40 +0100 (CET) |
Bruce Lilly writes:
> Consider the keyword set
> foo
> far
> fat
>
> Key position 1 has the same letter for all keywords so is not useful.
> Key position 2 has the same letter for two of the keywords. In some
> keyword sets, that might be useful as part of a key position set (but
> not in this example). Key position 3 has a different letter for each
> keyword in the set; it therefore suffices to use only that key position
> in hash computations for this keyword set -- key position 3 alone is
> the minimal (optimal) key position set for hash computation for this
> keyword set.
>
> If keyword "fao" is added to the above set, key position 3 no longer
> uniquely identifies keywords. Both positions 2 and 3 are potentially
> useful in differentiating keywords, and in fact the combination of
> positions 2 and 3 is the minimal key position set for that expanded
> keyword set.
Thanks for the explanation. The algorithm for finding a good position
set in gperf-2.8 will implicitly recognize the different kinds of
positions, simply as a side effect of the way its search for a good
position set is done.
Bruno