The new release of smscleaner (version 0.2) is out now!
The main change is that version 0.2 really uses XML to store deleted SMS. Version 0.1 produced something looking like XML, but it wasn't ;-) Now, the smscleaner XML format has it's own Document Type Definition (also provided here, so that an XML validator like Validome really can check a smscleaner XML file against it's DTD).
Additionally, command line parameters were introduced and the code was tidied up a bit. See the ChangeLog file for all updates.
The new ebuild for Gentoo Linux is also ready, so have fun using the new version :-)
If you used smscleaner before and have old pseudo-XML files, you can use a tool shipped with the new version to fix them and make them real XML. See the README file for details.
I'll write this in English so that all the (millions and billions of ;-) b8 users out there can also read it.
b8 0.4 is finished. It only lacks Laurent Goussard's storage class for SQLite, so I made a pre-release. Everything is done, only the class with the documentation for it will be added in the final version, so I don't want to let you wait any longer :-)
Really a lot of stuff happened since the last release. The performance increased a lot, and so, the useability did (at least, I do hope so)! Here is the ChangeLog from the b8-0.4_pre5 release:
Let's go the whole hog. b8's class is now "b8" and no more "bayes", and all internal variables have now according names.
Reworked the whole (surprisingly crappy) implementation of b8. No more global() calls, everything happens inside the classes now. Made that whole stuff really object oriented (as good as possible with PHP's poor OOP model ;-).
No more PHP code in the configuration files.
Created an extra lexer class. This is now also configurable.
Storage classes now can create their own databases.
MySQL calls are no random shots anymore: either, a MySQL-link resource is passed to b8 on startup which will be used for the queries, or the class sets up it's own link
interface now uses a separate storage backend capable of SQL. In this way, we really can query the database for e. g. an ordered list of tokens. After doing what we wanted with this work database, the b8 database can be synced with it.
Added a lot of verbose error handling.
Fixed a dumb error: all tokens from a text were used for the spamminess calculation, because two for() loops both used $i as their counter. D'oh!!! Now, the filter's performance is way better.
Catched on the way how that whole math stuff works a little more ;-) Now, the calculation of the single probabilities proposed by Mr. Robinson does a little more the stuff it was intended to do, because …
Made some calculation constants parameters: the number of tokens to use, the default rating for unknown tokens and Gary Robinson's s constant.
Introduced an optional minimum deviation that a token's rating must have to be considered in the spamminess calculation.
The default extreme ratings for tokens only in ham or spam are now optional. One can also choose to calculate all ratings by Mr. Robinson's method.
Noticed that text primary keys are not case sensitive by default in MySQL, which has a noticeable impact on the filter's performance. Informed the MySQL users about that.
The whole code sucks much less ;-) b8 should be way more user friendly now.
Re-wrote the whole documentation.
That's all, folks! Have a lot of fun using the new b8 version if you don't use SQLite and just be pacient a few days more if you do ;-)
Nur so nebenbei, und für den Fall, daß ich nicht der einzige bin, der tanman benutzt: Version 0.4 ist fertig. Mit überarbeitetem Quellcode, einer Manpage, englischem Code und deutscher Lokalisierung ... und iTAN-Unterstützung.
Die neue Version meines Spam-Filters b8 steht in den Startlöchern. Mein Part (der Großteil ;-) ist schon fertig, ich warte jetzt nur noch darauf, daß Laurent Goussard mir seine angepaßte Speicherklasse für SQLite schickt. Dann gibt's das neue Release 0.4!
Geändert hat sich einiges.
Wenn schon, denn schon. Der Filter heißt b8, also sollte auch die Klasse b8 heißen, und nicht mehr bayes. Und die ganzen internen Variablen entsprechend. Aber das war nur Kosmetik ;-)
Der Filter ist jetzt deutlich sauberer implementiert: Keine global(...);-Aufrufe mehr (die kürzlich erst für Kollisionen gesorgt hatten), der ganze interne Kram spielt sich jetzt tatsächlich innerhalb der Klassen ab; das einbindende Script sollte damit in keinster Weise mehr behelligt werden.
Der ganze Code ist viel objektorientierter geworden, z. B. gibt es eine große Basis-Klasse, von der sich alle andern ableiten. Das ist aber eher eine Code-Qualität-Maßnahme gewesen und braucht den End-Anwender nicht zu interessieren ;-)
Die Funktionen, die einen Text zerlegen, wurden in eine extra Klasse ausgelagert. Wenn also jemand einen speziellen Zerleger für spezielle Anwendungen will, kann er einfach einen einfügen und muß nur einen Eintrag in einer Konfigurationsdatei ändern (und bitte mir schicken, damit ich ihn ins nächste Release einbauen kann!).
Die Konfigurationsdateien sind jetzt tatsächlich Konfigurationsdateien und enthalten keinen PHP-Code mehr.
Das Interface wurde komplett überarbeitet. Es wird nun nicht mehr auf die eigentlich Datenbank zugegriffen, sondern eine SQL-abfragbare Arbeits-Datenbank erstellt (über ein weiteres Storage-Backend). Das Datenbank-Layout von b8 ist einfach nicht für das Sortieren aller Einträge nach irgendwas o. Ä. gedacht, sondern für den effizienten Betrieb während der eigentlichen Filter-Aufgabe. Also erschien mir das als die vernünftigste Lösung. Wenn alle Arbeit getan ist, kann aus der Arbeits-Datenbank wieder eine b8-Datenbank gemacht werden. Obschon hier auch nochmals darauf hingewiesen sei, daß man am besten den Filter einfach seine Arbeit machen lassen sollte, und das eher für Interessierte und für's Debugging gedacht war/ist.
Die Speicherklassen können jetzt alle per Eintrag in der jeweiligen Konfigurationsdateien ihre Datenbanken selber erstellen.
Es gibt viel mehr Fehler-Abfangen und Fehlermeldungen, wenn was schiefgeht.
Für MySQL-Nutzer hat sich auch einiges geändert:
Die MySQL-Speicherklasse setzt jetzt nur noch addressierte Queries ab. Das heißt, die Queries werden jetzt nur noch mit einer Resource gemacht, nicht mehr „einfach so“. Falls also das Script, was b8 benutzt, ohnehin eine MySQL-Verbindung aufbaut, dann einfach den Rückgabewert von mysql_connect(...) an b8 weitergeben. Z. B.: $b8 = new b8($mysqlRes);. Das ist sinnvoll, wenn eben das Script sowieso eine MySQL-Verbindung macht, und die b8-Tabelle auch in der selben Datenbank liegt.
Ansonsten können in der MySQL-Konfigurationsdatei auch Zugangsdaten zu einem MySQL-Server angegeben werden, und die Klasse macht sich ihre Verbindung selber.
WICHTIG: Bitte macht ein Datenbankupdate. Nicht erst, wenn Version 0.4 da ist, sondern gleich: eine Tabelle, die mit den Angaben aus der bisherigen Anleitung erstellt wurde, macht keinen Unterschied zwischen der Groß- und Kleinschreibung der Token-Namen. Das ist aber wichtig für ein besseres Arbeiten von b8! Einfach folgenden Query absetzen: ALTER TABLE (Tabellen-Name) CHANGE token token VARCHAR(255) BINARY;. Das behebt den Fehler. BerkeleyDB- und SQLite-Nutzer sind davon nicht betroffen. Falls tatsächlich einer noch bayes-php <= Version 0.2.1 einsetzen sollte, bitte erst das in der aktuellen Version beschrieben Datenbankupdate durchführen.
So, das waren mal die groben Änderungen. jedenfalls alle, die mir gerade einfallen ;-) Sobald die SQLite-Speicherklasse da ist, gibt's das Release. Bis dahin: noch viel Spaß ;-)