Stop new BigramDictionary.

BigramDictionary is allocated inside of Dictionary.

Change-Id: If224b4c408403f43eb3d2e292c0e0ecb86429290
diff --git a/native/jni/src/suggest/core/dictionary/dictionary.cpp b/native/jni/src/suggest/core/dictionary/dictionary.cpp
index ffa96e1..c26e3aa 100644
--- a/native/jni/src/suggest/core/dictionary/dictionary.cpp
+++ b/native/jni/src/suggest/core/dictionary/dictionary.cpp
@@ -37,7 +37,7 @@
 Dictionary::Dictionary(JNIEnv *env, DictionaryStructureWithBufferPolicy::StructurePolicyPtr
         dictionaryStructureWithBufferPolicy)
         : mDictionaryStructureWithBufferPolicy(std::move(dictionaryStructureWithBufferPolicy)),
-          mBigramDictionary(new BigramDictionary(mDictionaryStructureWithBufferPolicy.get())),
+          mBigramDictionary(mDictionaryStructureWithBufferPolicy.get()),
           mGestureSuggest(new Suggest(GestureSuggestPolicyFactory::getGestureSuggestPolicy())),
           mTypingSuggest(new Suggest(TypingSuggestPolicyFactory::getTypingSuggestPolicy())) {
     logDictionaryInfo(env);
@@ -78,7 +78,7 @@
         SuggestionResults *const outSuggestionResults) const {
     TimeKeeper::setCurrentTime();
     if (length <= 0) return;
-    mBigramDictionary->getPredictions(word, length, outSuggestionResults);
+    mBigramDictionary.getPredictions(word, length, outSuggestionResults);
 }
 
 int Dictionary::getProbability(const int *word, int length) const {
@@ -94,7 +94,7 @@
 int Dictionary::getBigramProbability(const int *word0, int length0, const int *word1,
         int length1) const {
     TimeKeeper::setCurrentTime();
-    return mBigramDictionary->getBigramProbability(word0, length0, word1, length1);
+    return mBigramDictionary.getBigramProbability(word0, length0, word1, length1);
 }
 
 void Dictionary::addUnigramWord(const int *const word, const int length, const int probability,
diff --git a/native/jni/src/suggest/core/dictionary/dictionary.h b/native/jni/src/suggest/core/dictionary/dictionary.h
index 2dea9ff..ce032fc 100644
--- a/native/jni/src/suggest/core/dictionary/dictionary.h
+++ b/native/jni/src/suggest/core/dictionary/dictionary.h
@@ -109,14 +109,13 @@
  private:
     DISALLOW_IMPLICIT_CONSTRUCTORS(Dictionary);
 
-    typedef std::unique_ptr<BigramDictionary> BigramDictionaryPtr;
     typedef std::unique_ptr<SuggestInterface> SuggestInterfacePtr;
 
     static const int HEADER_ATTRIBUTE_BUFFER_SIZE;
 
     const DictionaryStructureWithBufferPolicy::StructurePolicyPtr
             mDictionaryStructureWithBufferPolicy;
-    const BigramDictionaryPtr mBigramDictionary;
+    const BigramDictionary mBigramDictionary;
     const SuggestInterfacePtr mGestureSuggest;
     const SuggestInterfacePtr mTypingSuggest;