mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 17:57:16 +00:00
Classifier: check if class exists
This commit is contained in:
parent
fcecc0ed92
commit
05422c6cf9
1 changed files with 5 additions and 0 deletions
|
@ -255,12 +255,17 @@ public class MessageClassifier {
|
|||
if (maxMatchedWords == 0)
|
||||
return null;
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
List<Chance> chances = new ArrayList<>();
|
||||
for (String clazz : classStats.keySet()) {
|
||||
Integer messages = classMessages.get(account).get(clazz);
|
||||
if (messages == null || messages == 0)
|
||||
continue;
|
||||
|
||||
EntityFolder folder = db.folder().getFolderByName(account, clazz);
|
||||
if (folder == null)
|
||||
continue;
|
||||
|
||||
Stat stat = classStats.get(clazz);
|
||||
double chance = (double) stat.totalFrequency / messages / maxMatchedWords;
|
||||
Chance c = new Chance(clazz, chance);
|
||||
|
|
Loading…
Reference in a new issue