1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-27 10:17:18 +00:00

Optimization

This commit is contained in:
M66B 2021-01-03 11:11:24 +01:00
parent 4d6e8c740b
commit 9d709ccb69

View file

@ -249,15 +249,17 @@ public class MessageClassifier {
JSONArray jwords = new JSONArray();
for (Long account : classMessages.keySet())
for (String word : wordClassFrequency.get(account).keySet())
for (String clazz : wordClassFrequency.get(account).get(word).keySet()) {
for (String word : wordClassFrequency.get(account).keySet()) {
Map<String, Integer> classFrequency = wordClassFrequency.get(account).get(word);
for (String clazz : classFrequency.keySet()) {
JSONObject jword = new JSONObject();
jword.put("account", account);
jword.put("word", word);
jword.put("class", clazz);
jword.put("frequency", wordClassFrequency.get(account).get(word).get(clazz));
jword.put("frequency", classFrequency.get(clazz));
jwords.put(jword);
}
}
JSONObject jroot = new JSONObject();
jroot.put("messages", jmessages);