remove unused annotations

This commit is contained in:
Helium314 2024-02-01 22:42:25 +01:00
parent 978d76ed7c
commit 3a354524f3
37 changed files with 6 additions and 183 deletions

View file

@ -12,7 +12,6 @@ import android.util.SparseArray;
import androidx.annotation.NonNull;
import helium314.keyboard.annotations.UsedForTesting;
import helium314.keyboard.latin.Dictionary;
import helium314.keyboard.latin.NgramContext;
import helium314.keyboard.latin.SuggestedWords.SuggestedWordInfo;
@ -52,13 +51,9 @@ public final class BinaryDictionary extends Dictionary {
public static final int DICTIONARY_MAX_WORD_LENGTH = 48;
public static final int MAX_PREV_WORD_COUNT_FOR_N_GRAM = 3;
@UsedForTesting
public static final String UNIGRAM_COUNT_QUERY = "UNIGRAM_COUNT";
@UsedForTesting
public static final String BIGRAM_COUNT_QUERY = "BIGRAM_COUNT";
@UsedForTesting
public static final String MAX_UNIGRAM_COUNT_QUERY = "MAX_UNIGRAM_COUNT";
@UsedForTesting
public static final String MAX_BIGRAM_COUNT_QUERY = "MAX_BIGRAM_COUNT";
public static final int NOT_A_VALID_TIMESTAMP = -1;
@ -364,7 +359,6 @@ public final class BinaryDictionary extends Dictionary {
return getMaxProbabilityOfExactMatchesNative(mNativeDict, codePoints);
}
@UsedForTesting
public boolean isValidNgram(final NgramContext ngramContext, final String word) {
return getNgramProbability(ngramContext, word) != NOT_A_PROBABILITY;
}
@ -505,7 +499,6 @@ public final class BinaryDictionary extends Dictionary {
return true;
}
@UsedForTesting
public void updateEntriesForInputEvents(final WordInputEventForPersonalization[] inputEvents) {
if (!isValidDictionary()) {
return;
@ -620,7 +613,6 @@ public final class BinaryDictionary extends Dictionary {
}
}
@UsedForTesting
public String getPropertyForGettingStats(final String query) {
if (!isValidDictionary()) {
return "";

View file

@ -6,7 +6,6 @@
package com.android.inputmethod.latin.utils;
import helium314.keyboard.annotations.UsedForTesting;
import com.android.inputmethod.latin.BinaryDictionary;
import helium314.keyboard.latin.common.StringUtils;
import helium314.keyboard.latin.makedict.DictionaryHeader;
@ -31,7 +30,6 @@ public final class BinaryDictionaryUtils {
JniUtils.loadNativeLibrary();
}
@UsedForTesting
private static native boolean createEmptyDictFileNative(String filePath, long dictVersion,
String locale, String[] attributeKeyStringArray, String[] attributeValueStringArray);
private static native float calcNormalizedScoreNative(int[] before, int[] after, int score);
@ -82,7 +80,6 @@ public final class BinaryDictionaryUtils {
return false;
}
@UsedForTesting
public static boolean createEmptyDictFile(final String filePath, final long dictVersion,
final Locale locale, final Map<String, String> attributeMap) {
final String[] keyArray = new String[attributeMap.size()];
@ -112,7 +109,6 @@ public final class BinaryDictionaryUtils {
* @param currentTime seconds since the unix epoch
* @return current time got in the native code.
*/
@UsedForTesting
public static int setCurrentTimeForTest(final int currentTime) {
return setCurrentTimeForTestNative(currentTime);
}

View file

@ -8,7 +8,6 @@ package com.android.inputmethod.latin.utils;
import helium314.keyboard.latin.utils.Log;
import helium314.keyboard.annotations.UsedForTesting;
import helium314.keyboard.latin.NgramContext;
import helium314.keyboard.latin.common.StringUtils;
import helium314.keyboard.latin.define.DecoderSpecificConstants;
@ -34,7 +33,6 @@ public final class WordInputEventForPersonalization {
// Time stamp in seconds.
public final int mTimestamp;
@UsedForTesting
public WordInputEventForPersonalization(final CharSequence targetWord,
final NgramContext ngramContext, final int timestamp) {
mTargetWord = StringUtils.toCodePointArray(targetWord);