bogotune logic errors?
David Relson
relson at osagesoftware.com
Sat Nov 6 02:56:34 CET 2004
On Fri, 5 Nov 2004 13:37:52 -0500
Clint Adams wrote:
> % bogotune -D -n ham.msgcount -s spam.msgcount
> The wordlist contains 1338 non-spam and 3174 spam messages.
> Bogotune must be run with at least 2000 of each.
>
>
> A quick look suggests that ds_file is being set unconditionally,
> and that DS_DSK and DS_RAM are never used.
Hi Clint,
Close; but not totally correct. You _do_ get an "A" for spotting a bug,
but it's not quite th eone you think. What's wrong is that the 'D'
option should be clearing ds_file, but isn't.
At startup, bogotune attempts to determine the location of wordlist.db
and stores that info in ds_file. During argument processing, "-d dir"
can over-ride that value or "-D" can be used to create a wordlist in
memory. ds_flag is presently used just to make sure options '-d' and
'-D' are used once and once only. Elsewhere in bogotune whether ds_file
is NULL or non-NULL is used to determine whether the wordlist is read
from disk (a.k.a. DS_DSK) or built in ram (a.k.a. DS_RAM).
Testing ds_flag against DS_DSK/DS_RAM (rather than test ds_file against
NULL/non-NULL) will make the code clearer. I'm in process of making the
change.
Thanks for bringing this to my attention.
David
More information about the bogofilter-dev
mailing list