mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-20 13:17:08 +00:00
Include subject for message classification
This commit is contained in:
parent
dea7f671d0
commit
611e1d696c
1 changed files with 6 additions and 4 deletions
|
@ -21,7 +21,6 @@ package eu.faircode.email;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
|
@ -73,8 +72,11 @@ public class MessageClassifier {
|
|||
if (!file.exists())
|
||||
return;
|
||||
|
||||
String text = HtmlHelper.getFullText(file);
|
||||
if (TextUtils.isEmpty(text))
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (message.subject != null)
|
||||
sb.append(message.subject).append('\n');
|
||||
sb.append(HtmlHelper.getFullText(file));
|
||||
if (sb.length() == 0)
|
||||
return;
|
||||
|
||||
load(context);
|
||||
|
@ -84,7 +86,7 @@ public class MessageClassifier {
|
|||
if (!wordClassFrequency.containsKey(account.id))
|
||||
wordClassFrequency.put(account.id, new HashMap<>());
|
||||
|
||||
String classified = classify(account.id, folder.name, text, added, context);
|
||||
String classified = classify(account.id, folder.name, sb.toString(), added, context);
|
||||
|
||||
EntityLog.log(context, "Classifier" +
|
||||
" folder=" + folder.name +
|
||||
|
|
Loading…
Reference in a new issue