Skip to content
Snippets Groups Projects
Commit 76e38619 authored by Jean Chalard's avatar Jean Chalard Committed by Android (Google) Code Review
Browse files

Merge "Straighten out the last bastion of the Builder"

parents febf9929 6ffb5018
No related branches found
No related tags found
No related merge requests found
...@@ -437,13 +437,20 @@ public class Suggest implements Dictionary.WordCallback { ...@@ -437,13 +437,20 @@ public class Suggest implements Dictionary.WordCallback {
} }
// Don't auto-correct words with multiple capital letter // Don't auto-correct words with multiple capital letter
autoCorrectionAvailable &= !wordComposer.isMostlyCaps(); autoCorrectionAvailable &= !wordComposer.isMostlyCaps();
final boolean shouldBlockAutoCorrectionBySatefyNet;
if (allowsToBeAutoCorrected && scoreInfoList.size() > 1 && mAutoCorrectionThreshold > 0
&& Suggest.shouldBlockAutoCorrectionBySafetyNet(typedWord,
scoreInfoList.get(1).mWord)) {
shouldBlockAutoCorrectionBySatefyNet = true;
} else {
shouldBlockAutoCorrectionBySatefyNet = false;
}
builder = new SuggestedWords.Builder(scoreInfoList, builder = new SuggestedWords.Builder(scoreInfoList,
!allowsToBeAutoCorrected /* typedWordValid */, !allowsToBeAutoCorrected /* typedWordValid */,
autoCorrectionAvailable /* hasMinimalSuggestion */, autoCorrectionAvailable /* hasMinimalSuggestion */,
allowsToBeAutoCorrected /* allowsToBeAutoCorrected */, allowsToBeAutoCorrected /* allowsToBeAutoCorrected */,
false /* isPunctuationSuggestions */); false /* isPunctuationSuggestions */);
if (allowsToBeAutoCorrected && builder.size() > 1 && mAutoCorrectionThreshold > 0 if (shouldBlockAutoCorrectionBySatefyNet) {
&& Suggest.shouldBlockAutoCorrectionBySafetyNet(typedWord, builder.getWord(1))) {
builder.setShouldBlockAutoCorrectionBySafetyNet(); builder.setShouldBlockAutoCorrectionBySafetyNet();
} }
return builder; return builder;
......
...@@ -170,7 +170,7 @@ public class SuggestedWords { ...@@ -170,7 +170,7 @@ public class SuggestedWords {
} }
public static class SuggestedWordInfo { public static class SuggestedWordInfo {
private final CharSequence mWord; public final CharSequence mWord;
private final CharSequence mDebugString; private final CharSequence mDebugString;
private final boolean mPreviousSuggestedWord; private final boolean mPreviousSuggestedWord;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment