[Spambayes] Oh good!
Tegels, Kent
Kent.Tegels at hdrinc.com
Mon Dec 15 10:38:46 EST 2003
Humm... If I unzipped the package to g:\temp\sbi\, what do I need to set
pythonpath too? This is what I'm getting pretty consistently if I set
pythonpath to anything.
G:\Python23\Scripts>set pythonpath=G:\temp\sbi\
G:\Python23\Scripts>sb_dbexpimp.py -e -v -d "G:\Documents and
Settings\ktegels\A
pplication Data\SpamBayes\default_bayes_database.db" -f data.txt
Loading state from G:\Documents and Settings\ktegels\Application
Data\SpamBayes\
default_bayes_database.db pickle
Traceback (most recent call last):
File "G:\Python23\Scripts\sb_dbexpimp.py", line 262, in ?
runExport(dbFN, useDBM, flatFN)
File "G:\Python23\Scripts\sb_dbexpimp.py", line 112, in runExport
bayes = spambayes.storage.PickledClassifier(dbFN)
File "G:\Python23\Lib\site-packages\spambayes\storage.py", line 90, in
__init_
_
self.load()
File "G:\Python23\Lib\site-packages\spambayes\storage.py", line 113,
in load
tempbayes = pickle.load(fp)
EOFError
Humm...
kt
-----Original Message-----
From: Tony Meyer [mailto:tameyer at ihug.co.nz]
Sent: Saturday, December 13, 2003 8:28 PM
To: 'kent tegels'; spambayes at python.org
Subject: RE: [Spambayes] Oh good!
> Or am I just asking for too much.
You're not, but I'll answer this anyway <wink>.
> If am I, could somebody point me at a depickle/otherwise export the
> .db files to some other format so I can get back to the first task I
> wanted to -- get the wordlist and the ham and spam counts?
The sb_dbexpimp.py script in the scripts folder of the source will do
this.
You can convert to and from pickle and bsddb, and also to/from 'flat'
text ('`' delimited, for some reason). You'll need need the full source
package to do this (well, some subset of that, anyway). Easiest to just
unpack the archive, "set pythonpath=path:\to\archive" and then run the
script. Running with no options will give example usage.
=Tony Meyer
More information about the Spambayes
mailing list