[spambayes-dev] RE: [Spambayes-checkins]
spambayes/spambayesOptions.py, 1.90, 1.91 UserInterface.py, 1.35,
1.36 classifier.py, 1.11, 1.12
Tony Meyer
tameyer at ihug.co.nz
Mon Dec 15 21:48:35 EST 2003
[...]
> + # Need to regenerate the tokens (is there a way to
> + # 'rewind' or copy a generator? Would that be
> + # more efficient?
[...]
> Change the first line of the function to:
>
> tokens = list(tokenizer.tokenize(message))
>
> There's no need to tokenize again, then. The construction of
> clues can be the one-liner:
>
> clues = [(tok, None) for tok in tokens]
Thanks. The _getclues call later was expecting a generator rather than a
list, but I've fixed that too, and the code is nicer now, I think. I've
checked this in.
=Tony Meyer
More information about the spambayes-dev
mailing list