From 2d39b89243a8287e4defe60e42ea1b087f3b6659 Mon Sep 17 00:00:00 2001 From: Carlo Strub Date: Fri, 10 Mar 2017 21:53:39 +0000 Subject: [PATCH] move filter stuff into separate source file --- filter.go | 17 +++++++++++++++++ main.go | 14 -------------- 2 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 filter.go diff --git a/filter.go b/filter.go new file mode 100644 index 0000000..5d1f7a3 --- /dev/null +++ b/filter.go @@ -0,0 +1,17 @@ +package main + +import ( + "github.com/jbrukh/bayesian" +) + +const ( + // good is the class of good mails that are not supposed to be Spam + good bayesian.Class = "Good" + // junk is the class of Spam mails + junk bayesian.Class = "Junk" +) + +// Classifiers contains the classifiers for mail subjects and bodies +type Classifiers struct { + Subject, Body *bayesian.Classifier +} diff --git a/main.go b/main.go index b6fd3b0..441f3b6 100644 --- a/main.go +++ b/main.go @@ -5,15 +5,6 @@ import ( "fmt" "log" "os" - - "github.com/jbrukh/bayesian" -) - -const ( - // good is the class of good mails that are not supposed to be Spam - good bayesian.Class = "Good" - // junk is the class of Spam mails - junk bayesian.Class = "Junk" ) var ( @@ -21,11 +12,6 @@ var ( Processed map[string]bool ) -// Classifiers contains the classifiers for mail subjects and bodies -type Classifiers struct { - Subject, Body *bayesian.Classifier -} - func main() { // Get the Maildir to be handled wd, err := os.Getwd()