mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Make logging less chatty
This commit is contained in:
parent
455c3741ae
commit
0b7c386d11
@ -70,7 +70,7 @@ public class LanguageModel {
|
|||||||
List<String> personalDictionary,
|
List<String> personalDictionary,
|
||||||
String[] bannedWords
|
String[] bannedWords
|
||||||
) {
|
) {
|
||||||
Log.d("LanguageModel", "getSuggestions called");
|
//Log.d("LanguageModel", "getSuggestions called");
|
||||||
|
|
||||||
if (mNativeState == 0) {
|
if (mNativeState == 0) {
|
||||||
loadModel();
|
loadModel();
|
||||||
@ -249,7 +249,7 @@ public class LanguageModel {
|
|||||||
suggestion.mOriginatesFromTransformerLM = true;
|
suggestion.mOriginatesFromTransformerLM = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.d("LanguageModel", "returning " + String.valueOf(suggestions.size()) + " suggestions");
|
//Log.d("LanguageModel", "returning " + String.valueOf(suggestions.size()) + " suggestions");
|
||||||
|
|
||||||
return suggestions;
|
return suggestions;
|
||||||
}
|
}
|
||||||
|
@ -155,7 +155,7 @@ public class LanguageModelFacilitator(
|
|||||||
val emoji = emojiData.emojiAliases[word.lowercase()]
|
val emoji = emojiData.emojiAliases[word.lowercase()]
|
||||||
|
|
||||||
if(emoji != null) {
|
if(emoji != null) {
|
||||||
Log.i("LanguageModelFacilitator", "Found emoji ${emoji.emoji} for $word")
|
//Log.i("LanguageModelFacilitator", "Found emoji ${emoji.emoji} for $word")
|
||||||
return SuggestedWordInfo(
|
return SuggestedWordInfo(
|
||||||
emoji.emoji,
|
emoji.emoji,
|
||||||
"",
|
"",
|
||||||
@ -268,8 +268,8 @@ public class LanguageModelFacilitator(
|
|||||||
suggestionBlacklist.isSuggestedWordOk(it)
|
suggestionBlacklist.isSuggestedWordOk(it)
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.d("LanguageModelFacilitator", "suggestedWordsDict = ${suggestedWordsDictList?.map { "$it ${it.mScore}" }}")
|
//Log.d("LanguageModelFacilitator", "suggestedWordsDict = ${suggestedWordsDictList?.map { "$it ${it.mScore}" }}")
|
||||||
Log.d("LanguageModelFacilitator", "lmSuggestions = ${lmSuggestions.map { "$it ${it.mScore}" }}")
|
//Log.d("LanguageModelFacilitator", "lmSuggestions = ${lmSuggestions.map { "$it ${it.mScore}" }}")
|
||||||
|
|
||||||
val maxWordDict = suggestedWordsDictList?.maxByOrNull {
|
val maxWordDict = suggestedWordsDictList?.maxByOrNull {
|
||||||
if(it == suggestedWordsDict.typedWordInfo) { Int.MIN_VALUE } else { it.mScore }
|
if(it == suggestedWordsDict.typedWordInfo) { Int.MIN_VALUE } else { it.mScore }
|
||||||
@ -328,7 +328,7 @@ public class LanguageModelFacilitator(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.d("LanguageModelFacilitator", "final suggestionResults = ${suggestionResults.map { "$it ${it.mScore}" }}")
|
//Log.d("LanguageModelFacilitator", "final suggestionResults = ${suggestionResults.map { "$it ${it.mScore}" }}")
|
||||||
val wordComposer = inputLogic.mWordComposer
|
val wordComposer = inputLogic.mWordComposer
|
||||||
val suggestedWords = Suggest.obtainNonBatchedInputSuggestedWords(
|
val suggestedWords = Suggest.obtainNonBatchedInputSuggestedWords(
|
||||||
wordComposer, values.inputStyle, true, -1, locale, suggestionResults, settingsValues.mAutoCorrectionThreshold)
|
wordComposer, values.inputStyle, true, -1, locale, suggestionResults, settingsValues.mAutoCorrectionThreshold)
|
||||||
@ -380,7 +380,7 @@ public class LanguageModelFacilitator(
|
|||||||
launch {
|
launch {
|
||||||
withContext(Dispatchers.Default) {
|
withContext(Dispatchers.Default) {
|
||||||
sharedFlow.conflate().collect { value ->
|
sharedFlow.conflate().collect { value ->
|
||||||
Log.d("LanguageModelFacilitator", "Collecting")
|
//Log.d("LanguageModelFacilitator", "Collecting")
|
||||||
processUpdateSuggestionStrip(value)
|
processUpdateSuggestionStrip(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -440,7 +440,7 @@ public class LanguageModelFacilitator(
|
|||||||
)
|
)
|
||||||
|
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
Log.d("LanguageModelFacilitator", "Emitting values")
|
//Log.d("LanguageModelFacilitator", "Emitting values")
|
||||||
sharedFlow.emit(values)
|
sharedFlow.emit(values)
|
||||||
}
|
}
|
||||||
} catch(e: Exception) {
|
} catch(e: Exception) {
|
||||||
|
Loading…
Reference in New Issue
Block a user