From 2725cc17d7e843fe1107f1209ce07458cffbf58c Mon Sep 17 00:00:00 2001
From: Keisuke Kuroyanagi <ksk@google.com>
Date: Mon, 23 Jun 2014 16:47:18 +0900
Subject: [PATCH] Enable beginning-of-sentence prediction.

Bug: 14119293
Change-Id: I23c407f0afed0ae4af290a1195b0e3bbcd5af8d7
---
 .../inputmethod/latin/ExpandableBinaryDictionary.java  | 10 ----------
 .../latin/personalization/ContextualDictionary.java    |  5 -----
 2 files changed, 15 deletions(-)

diff --git a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
index 6199c7dfe3..37879cf686 100644
--- a/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
+++ b/java/src/com/android/inputmethod/latin/ExpandableBinaryDictionary.java
@@ -122,12 +122,6 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
         return mBinaryDictionary.isValidDictionary();
     }
 
-    // TODO: Remove and always enable beginning of sentence prediction. Currently, this is enabled
-    // only for ContextualDictionary.
-    protected boolean enableBeginningOfSentencePrediction() {
-        return false;
-    }
-
     /**
      * Creates a new expandable binary dictionary.
      *
@@ -426,10 +420,6 @@ abstract public class ExpandableBinaryDictionary extends Dictionary {
                 if (mBinaryDictionary == null) {
                     return null;
                 }
-                if (composer.size() == 0 && prevWordsInfo.mIsBeginningOfSentence
-                        && !enableBeginningOfSentencePrediction()) {
-                    return null;
-                }
                 final ArrayList<SuggestedWordInfo> suggestions =
                         mBinaryDictionary.getSuggestions(composer, prevWordsInfo, proximityInfo,
                                 blockOffensiveWords, additionalFeaturesOptions, sessionId,
diff --git a/java/src/com/android/inputmethod/latin/personalization/ContextualDictionary.java b/java/src/com/android/inputmethod/latin/personalization/ContextualDictionary.java
index a96018fe95..ac55b93331 100644
--- a/java/src/com/android/inputmethod/latin/personalization/ContextualDictionary.java
+++ b/java/src/com/android/inputmethod/latin/personalization/ContextualDictionary.java
@@ -42,11 +42,6 @@ public class ContextualDictionary extends ExpandableBinaryDictionary {
         return new ContextualDictionary(context, locale, dictFile);
     }
 
-    @Override
-    protected boolean enableBeginningOfSentencePrediction() {
-        return true;
-    }
-
     @Override
     public boolean isValidWord(final String word) {
         // Strings out of this dictionary should not be considered existing words.
-- 
GitLab