mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Cleanup
Remove an unused method, make others static, fix a formatting issue Change-Id: I40cb0b5e01a6f8e2f7b953bd9aad3168dfee71d1
This commit is contained in:
parent
4ee186920e
commit
d6662ecd30
@ -180,7 +180,7 @@ public class Suggest implements Dictionary.WordCallback {
|
|||||||
return mUnigramDictionaries;
|
return mUnigramDictionaries;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getApproxMaxWordLength() {
|
public static int getApproxMaxWordLength() {
|
||||||
return APPROX_MAX_WORD_LENGTH;
|
return APPROX_MAX_WORD_LENGTH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,23 +215,8 @@ public class Suggest implements Dictionary.WordCallback {
|
|||||||
mAutoCorrectionThreshold = threshold;
|
mAutoCorrectionThreshold = threshold;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
private static CharSequence capitalizeWord(final boolean all, final boolean first,
|
||||||
* Number of suggestions to generate from the input key sequence. This has
|
final CharSequence word) {
|
||||||
* to be a number between 1 and 100 (inclusive).
|
|
||||||
* @param maxSuggestions
|
|
||||||
* @throws IllegalArgumentException if the number is out of range
|
|
||||||
*/
|
|
||||||
public void setMaxSuggestions(int maxSuggestions) {
|
|
||||||
if (maxSuggestions < 1 || maxSuggestions > 100) {
|
|
||||||
throw new IllegalArgumentException("maxSuggestions must be between 1 and 100");
|
|
||||||
}
|
|
||||||
mPrefMaxSuggestions = maxSuggestions;
|
|
||||||
mScores = new int[mPrefMaxSuggestions];
|
|
||||||
mBigramScores = new int[PREF_MAX_BIGRAMS];
|
|
||||||
mSuggestions = new ArrayList<CharSequence>(mPrefMaxSuggestions);
|
|
||||||
}
|
|
||||||
|
|
||||||
private CharSequence capitalizeWord(boolean all, boolean first, CharSequence word) {
|
|
||||||
if (TextUtils.isEmpty(word) || !(all || first)) return word;
|
if (TextUtils.isEmpty(word) || !(all || first)) return word;
|
||||||
final int wordLength = word.length();
|
final int wordLength = word.length();
|
||||||
final StringBuilder sb = new StringBuilder(getApproxMaxWordLength());
|
final StringBuilder sb = new StringBuilder(getApproxMaxWordLength());
|
||||||
|
@ -191,10 +191,6 @@ public class SuggestedWords {
|
|||||||
return mAllowsToBeAutoCorrected;
|
return mAllowsToBeAutoCorrected;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasAutoCorrection() {
|
|
||||||
return mHasAutoCorrection;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
// Pretty-print method to help debug
|
// Pretty-print method to help debug
|
||||||
|
Loading…
x
Reference in New Issue
Block a user