mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 11:25:13 +01:00
Small classifier fix / simplification
This commit is contained in:
@@ -56,7 +56,7 @@ public class MessageClassifier {
|
||||
|
||||
private static final int MAX_WORDS = 1000;
|
||||
|
||||
static synchronized void classify(EntityMessage message, EntityFolder folder, EntityFolder target, Context context) {
|
||||
static synchronized void classify(EntityMessage message, EntityFolder folder, boolean added, Context context) {
|
||||
try {
|
||||
if (!isEnabled(context))
|
||||
return;
|
||||
@@ -64,9 +64,6 @@ public class MessageClassifier {
|
||||
if (!folder.auto_classify_source)
|
||||
return;
|
||||
|
||||
if (target != null && !target.auto_classify_source)
|
||||
return;
|
||||
|
||||
long start = new Date().getTime();
|
||||
|
||||
// Build text to classify
|
||||
@@ -86,12 +83,13 @@ public class MessageClassifier {
|
||||
wordClassFrequency.put(folder.account, new HashMap<>());
|
||||
|
||||
// Classify texts
|
||||
String classified = classify(message, folder.name, texts, target == null, context);
|
||||
String classified = classify(message, folder.name, texts, added, context);
|
||||
|
||||
long elapsed = new Date().getTime() - start;
|
||||
EntityLog.log(context, EntityLog.Type.Classification, message,
|
||||
"Classifier" +
|
||||
" folder=" + folder.name +
|
||||
" added=" + added +
|
||||
" message=" + message.id +
|
||||
"@" + new Date(message.received) +
|
||||
":" + message.subject +
|
||||
|
||||
Reference in New Issue
Block a user