mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Merge "Stop uselessly remembering a value (A2)"
This commit is contained in:
commit
58722d83f0
@ -118,15 +118,15 @@ public class AutoCorrection {
|
|||||||
final int autoCorrectionSuggestionScore = sortedScores[0];
|
final int autoCorrectionSuggestionScore = sortedScores[0];
|
||||||
// TODO: when the normalized score of the first suggestion is nearly equals to
|
// TODO: when the normalized score of the first suggestion is nearly equals to
|
||||||
// the normalized score of the second suggestion, behave less aggressive.
|
// the normalized score of the second suggestion, behave less aggressive.
|
||||||
mNormalizedScore = BinaryDictionary.calcNormalizedScore(
|
final double normalizedScore = BinaryDictionary.calcNormalizedScore(
|
||||||
typedWord.toString(), autoCorrectionSuggestion.toString(),
|
typedWord.toString(), autoCorrectionSuggestion.toString(),
|
||||||
autoCorrectionSuggestionScore);
|
autoCorrectionSuggestionScore);
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
Log.d(TAG, "Normalized " + typedWord + "," + autoCorrectionSuggestion + ","
|
Log.d(TAG, "Normalized " + typedWord + "," + autoCorrectionSuggestion + ","
|
||||||
+ autoCorrectionSuggestionScore + ", " + mNormalizedScore
|
+ autoCorrectionSuggestionScore + ", " + normalizedScore
|
||||||
+ "(" + autoCorrectionThreshold + ")");
|
+ "(" + autoCorrectionThreshold + ")");
|
||||||
}
|
}
|
||||||
if (mNormalizedScore >= autoCorrectionThreshold) {
|
if (normalizedScore >= autoCorrectionThreshold) {
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
Log.d(TAG, "Auto corrected by S-threshold.");
|
Log.d(TAG, "Auto corrected by S-threshold.");
|
||||||
}
|
}
|
||||||
|
@ -388,7 +388,11 @@ public class Suggest implements Dictionary.WordCallback {
|
|||||||
StringUtils.removeDupes(mSuggestions);
|
StringUtils.removeDupes(mSuggestions);
|
||||||
|
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
double normalizedScore = mAutoCorrection.getNormalizedScore();
|
final CharSequence autoCorrectionSuggestion = mSuggestions.get(0);
|
||||||
|
final int autoCorrectionSuggestionScore = mScores[0];
|
||||||
|
double normalizedScore = BinaryDictionary.calcNormalizedScore(
|
||||||
|
typedWord.toString(), autoCorrectionSuggestion.toString(),
|
||||||
|
autoCorrectionSuggestionScore);
|
||||||
ArrayList<SuggestedWords.SuggestedWordInfo> scoreInfoList =
|
ArrayList<SuggestedWords.SuggestedWordInfo> scoreInfoList =
|
||||||
new ArrayList<SuggestedWords.SuggestedWordInfo>();
|
new ArrayList<SuggestedWords.SuggestedWordInfo>();
|
||||||
scoreInfoList.add(new SuggestedWords.SuggestedWordInfo("+", false));
|
scoreInfoList.add(new SuggestedWords.SuggestedWordInfo("+", false));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user