Merge "Make UserHistoryDictionary use updateEntriesForWordWithNgramContext()"
diff --git a/dictionaries/de_wordlist.combined.gz b/dictionaries/de_wordlist.combined.gz
index 8065e04..803211c 100644
--- a/dictionaries/de_wordlist.combined.gz
+++ b/dictionaries/de_wordlist.combined.gz
Binary files differ
diff --git a/java/res/raw/main_de.dict b/java/res/raw/main_de.dict
index 4a8cdf1..45b2883 100644
--- a/java/res/raw/main_de.dict
+++ b/java/res/raw/main_de.dict
Binary files differ
diff --git a/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/content/probability_dict_content.cpp b/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/content/probability_dict_content.cpp
index 4a740d4..ef6166f 100644
--- a/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/content/probability_dict_content.cpp
+++ b/native/jni/src/suggest/policyimpl/dictionary/structure/backward/v402/content/probability_dict_content.cpp
@@ -74,8 +74,8 @@
                 return false;
             }
             writingPos += getEntrySize();
-            mSize++;
         }
+        mSize = terminalId + 1;
     }
     return writeEntry(probabilityEntry, entryPos);
 }
@@ -100,7 +100,6 @@
 bool ProbabilityDictContent::runGC(
         const TerminalPositionLookupTable::TerminalIdMap *const terminalIdMap,
         const ProbabilityDictContent *const originalProbabilityDictContent) {
-    mSize = 0;
     for (TerminalPositionLookupTable::TerminalIdMap::const_iterator it = terminalIdMap->begin();
             it != terminalIdMap->end(); ++it) {
         const ProbabilityEntry probabilityEntry =
@@ -109,7 +108,6 @@
             AKLOGE("Cannot set probability entry in runGC. terminalId: %d", it->second);
             return false;
         }
-        mSize++;
     }
     return true;
 }