diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b696a96a..9952d934 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,6 +23,7 @@ If you have questions or would like to communicate with the team, please [join u - [Bug reports](#bug-reports) - [Feature requests](#feature-requests) - [Pull requests](#pull-requests) +- [Adding keyboards](#adding-keyboards) - [Data edits](#data-edits) - [Localization](#localization) - [Documentation](#documentation) @@ -356,6 +357,16 @@ Thank you in advance for your contributions! Back to top. +## Adding keyboards + +Scribe has interest in adding keyboards for any language! Please let the community know if you'd like a Scribe keyboard in your second or native language. + +As of now the Scribe-Android keyboard application is leveraging AOSP based autosuggestions and autocompletions. This means that adding a new keyboard that has AOSP based dictionaries available is dramatically easier than adding other languages. Please see the following for a list of available dictionaries: + +- [Codeberg:Helium314/aosp-dictionaries](https://codeberg.org/Helium314/aosp-dictionaries) + +Back to top. + ## Data edits > [!NOTE]\ diff --git a/app/src/keyboards/java/be/scri/helpers/AutocompletionHandler.kt b/app/src/keyboards/java/be/scri/helpers/AutocompletionHandler.kt index b8475281..23686594 100644 --- a/app/src/keyboards/java/be/scri/helpers/AutocompletionHandler.kt +++ b/app/src/keyboards/java/be/scri/helpers/AutocompletionHandler.kt @@ -19,40 +19,50 @@ class AutocompletionHandler( private var autocompleteRunnable: Runnable? = null companion object { - private const val AUTOCOMPLETE_DELAY_MS = 50L + private const val AUTOCOMPLETE_DELAY_MS = 150L + private const val MAX_COMPLETIONS = 2 + + /** + * Filters dictionary/engine [completions] down to the ones worth showing + * alongside the word the user already typed: no duplicate of [typedWord], + * capped at [MAX_COMPLETIONS] (the word itself takes the remaining slot). + */ + internal fun buildCompletions( + typedWord: String, + completions: List, + ): List = + completions + .filterNot { it.equals(typedWord, ignoreCase = true) } + .take(MAX_COMPLETIONS) } /** * Processes the current word for autocompletion. * - * This function is called whenever the user types. - * It cancels any pending autocomplete request and schedules a new one - * after a short delay to prevent excessive lookups. + * This function is called whenever the user types. The word being typed is + * shown immediately (it's already known, no lookup needed), while the + * dictionary/engine completions are debounced to avoid excessive lookups. * * @param currentWord The word currently being typed by the user. */ fun processAutocomplete(currentWord: String?) { autocompleteRunnable?.let { handler.removeCallbacks(it) } + if (ime.currentState != ScribeState.IDLE || currentWord.isNullOrEmpty()) { + ime.clearAutocomplete() + return + } + + ime.updateTypedWordSuggestion(currentWord) + autocompleteRunnable = Runnable { - if (ime.currentState != ScribeState.IDLE) { - ime.clearAutocomplete() - return@Runnable - } - - if (currentWord.isNullOrEmpty()) { - ime.clearAutocomplete() - return@Runnable - } + if (ime.currentState != ScribeState.IDLE) return@Runnable - val completions = ime.getAutocompletions(currentWord, limit = 5) + val previousWord = ime.getPreviousWordBeforeCursor() + val completions = ime.getAutocompletions(currentWord, previousWord, limit = MAX_COMPLETIONS + 1) - if (completions.isNotEmpty()) { - ime.updateAutocompleteSuggestions(completions) - } else { - ime.clearAutocomplete() - } + ime.updateAutocompleteCompletions(buildCompletions(currentWord, completions)) } handler.postDelayed(autocompleteRunnable!!, AUTOCOMPLETE_DELAY_MS) diff --git a/app/src/keyboards/java/be/scri/services/GeneralKeyboardIME.kt b/app/src/keyboards/java/be/scri/services/GeneralKeyboardIME.kt index a7bbee29..8c91fcf3 100644 --- a/app/src/keyboards/java/be/scri/services/GeneralKeyboardIME.kt +++ b/app/src/keyboards/java/be/scri/services/GeneralKeyboardIME.kt @@ -1129,12 +1129,13 @@ abstract class GeneralKeyboardIME( */ fun getAutocompletions( prefix: String, + previousWord: String? = null, limit: Int = 3, ): List { if (this::nativeSuggestionEngine.isInitialized) { - val nativeCompletions = nativeSuggestionEngine.getAutocompletions(language, prefix, limit) + val nativeCompletions = nativeSuggestionEngine.getAutocompletions(language, prefix, previousWord, limit) if (nativeCompletions.isNotEmpty()) { - return nativeCompletions + return nativeCompletions.map { it.substringBefore("-") } } } return dataHandler.getAutocompletions(prefix, limit) @@ -1165,6 +1166,18 @@ abstract class GeneralKeyboardIME( */ fun getLastWordBeforeCursor(): String? = getText()?.trim()?.split("\\s+".toRegex())?.lastOrNull() + /** + * Extracts the word immediately before the one currently being composed, i.e. the last + * completed word preceding the in-progress word at the cursor. Used to give the autocomplete + * engine sentence context so it can bias completions instead of scoring the prefix in isolation. + * + * @return The previous completed word as a [String], or null if there isn't one. + */ + fun getPreviousWordBeforeCursor(): String? { + val words = getText()?.trim()?.split("\\s+".toRegex()) ?: return null + return words.getOrNull(words.size - 2) + } + /** * Retrieves the text immediately preceding the cursor. * @@ -1400,10 +1413,10 @@ abstract class GeneralKeyboardIME( if (this::nativeSuggestionEngine.isInitialized) { val nativeSuggestions = nativeSuggestionEngine.getNextWordSuggestions(language, lastWord) if (nativeSuggestions.isNotEmpty()) { - return nativeSuggestions + return nativeSuggestions.map { it.substringBefore("-") } } } - return wordSuggestions[lastWord.lowercase()] + return wordSuggestions[lastWord.lowercase()]?.map { it.substringBefore("-") } } /** @@ -1795,29 +1808,56 @@ abstract class GeneralKeyboardIME( // MARK: Autocomplete /** - * Updates autocomplete UI with a new list of suggestions. - * Clears it if not idle or no completions. + * Pins the word currently being typed into the first (leftmost) suggestion + * slot, quoted like most mobile keyboards do to mark it as "what you typed" + * rather than a dictionary suggestion. Called immediately on every keystroke + * — unlike the completions, it needs no lookup, so it should never lag. */ - fun updateAutocompleteSuggestions(completions: List?) { - if (currentState != ScribeState.IDLE) { - uiManager.disableAutoSuggest(language) - return - } - if (completions.isNullOrEmpty()) { + fun updateTypedWordSuggestion(word: String?) { + if (currentState != ScribeState.IDLE || word.isNullOrEmpty()) { uiManager.disableAutoSuggest(language) return } + setTypedWordButton(uiManager.binding.translateBtn, word) + setAutocompleteButton(uiManager.binding.conjugateBtn, "") + uiManager.pluralBtn?.let { setAutocompleteButton(it, "") } + + uiManager.binding.separator1.visibility = View.VISIBLE + uiManager.binding.separator2.visibility = View.VISIBLE + } + + /** + * Fills the remaining suggestion slots with dictionary/engine completions. + * Clears them (leaving the typed word alone) if not idle. + */ + fun updateAutocompleteCompletions(completions: List) { + if (currentState != ScribeState.IDLE) return + val completion1 = completions.getOrNull(0) ?: "" val completion2 = completions.getOrNull(1) ?: "" - val completion3 = completions.getOrNull(2) ?: "" setAutocompleteButton(uiManager.binding.conjugateBtn, completion1) - setAutocompleteButton(uiManager.binding.translateBtn, completion2) - setAutocompleteButton(uiManager.pluralBtn!!, completion3) + uiManager.pluralBtn?.let { setAutocompleteButton(it, completion2) } + } - uiManager.binding.separator1.visibility = View.VISIBLE - uiManager.binding.separator2.visibility = View.VISIBLE + /** + * Sets up the "what you typed" button: displayed quoted, but tapping it + * doesn't re-insert the word (it's already in the text field) — it just + * confirms the word with a space, the same as pressing the space bar + * would, and moves on to next-word suggestions based on it. + */ + private fun setTypedWordButton( + button: Button, + word: String, + ) { + setSuggestionButton(button, "\"$word\"") + button.setOnClickListener { + currentInputConnection?.commitText(" ", 1) + suggestionHandler.processLinguisticSuggestions(word) + suggestionHandler.processWordSuggestions(word) + moveToIdleState() + } } /** diff --git a/app/src/main/assets/dicts/main_bg.dict b/app/src/main/assets/dicts/main_bg.dict deleted file mode 100644 index b39d7e3f..00000000 Binary files a/app/src/main/assets/dicts/main_bg.dict and /dev/null differ diff --git a/app/src/main/assets/dicts/main_bn.dict b/app/src/main/assets/dicts/main_bn.dict deleted file mode 100644 index c0329fff..00000000 Binary files a/app/src/main/assets/dicts/main_bn.dict and /dev/null differ diff --git a/app/src/main/assets/dicts/main_de.dict b/app/src/main/assets/dicts/main_de.dict index 58aecf9e..b3c8c8fb 100644 Binary files a/app/src/main/assets/dicts/main_de.dict and b/app/src/main/assets/dicts/main_de.dict differ diff --git a/app/src/main/assets/dicts/main_el.dict b/app/src/main/assets/dicts/main_el.dict deleted file mode 100644 index fb8bbcee..00000000 Binary files a/app/src/main/assets/dicts/main_el.dict and /dev/null differ diff --git a/app/src/main/assets/dicts/main_en-GB.dict b/app/src/main/assets/dicts/main_en-GB.dict deleted file mode 100644 index 77145c7d..00000000 Binary files a/app/src/main/assets/dicts/main_en-GB.dict and /dev/null differ diff --git a/app/src/main/assets/dicts/main_en-US.dict b/app/src/main/assets/dicts/main_en-US.dict index 081a8c8c..ba56d826 100644 Binary files a/app/src/main/assets/dicts/main_en-US.dict and b/app/src/main/assets/dicts/main_en-US.dict differ diff --git a/app/src/main/assets/dicts/main_es.dict b/app/src/main/assets/dicts/main_es.dict index 076d5aa8..3e4a10ee 100644 Binary files a/app/src/main/assets/dicts/main_es.dict and b/app/src/main/assets/dicts/main_es.dict differ diff --git a/app/src/main/assets/dicts/main_fr.dict b/app/src/main/assets/dicts/main_fr.dict index 0e868609..25744c28 100644 Binary files a/app/src/main/assets/dicts/main_fr.dict and b/app/src/main/assets/dicts/main_fr.dict differ diff --git a/app/src/main/assets/dicts/main_hu.dict b/app/src/main/assets/dicts/main_hu.dict deleted file mode 100644 index 0b05b265..00000000 Binary files a/app/src/main/assets/dicts/main_hu.dict and /dev/null differ diff --git a/app/src/main/assets/dicts/main_it.dict b/app/src/main/assets/dicts/main_it.dict index 609ef13b..65edbed5 100644 Binary files a/app/src/main/assets/dicts/main_it.dict and b/app/src/main/assets/dicts/main_it.dict differ diff --git a/app/src/main/assets/dicts/main_nl.dict b/app/src/main/assets/dicts/main_nl.dict deleted file mode 100644 index 4d031d0c..00000000 Binary files a/app/src/main/assets/dicts/main_nl.dict and /dev/null differ diff --git a/app/src/main/assets/dicts/main_pl.dict b/app/src/main/assets/dicts/main_pl.dict deleted file mode 100644 index f55af662..00000000 Binary files a/app/src/main/assets/dicts/main_pl.dict and /dev/null differ diff --git a/app/src/main/assets/dicts/main_pt-BR.dict b/app/src/main/assets/dicts/main_pt-BR.dict index c3386518..091a1195 100644 Binary files a/app/src/main/assets/dicts/main_pt-BR.dict and b/app/src/main/assets/dicts/main_pt-BR.dict differ diff --git a/app/src/main/assets/dicts/main_pt-PT.dict b/app/src/main/assets/dicts/main_pt-PT.dict deleted file mode 100644 index a685e35d..00000000 Binary files a/app/src/main/assets/dicts/main_pt-PT.dict and /dev/null differ diff --git a/app/src/main/assets/dicts/main_ro.dict b/app/src/main/assets/dicts/main_ro.dict deleted file mode 100644 index 1f69a653..00000000 Binary files a/app/src/main/assets/dicts/main_ro.dict and /dev/null differ diff --git a/app/src/main/assets/dicts/main_ru.dict b/app/src/main/assets/dicts/main_ru.dict index f24552dd..f022ca16 100644 Binary files a/app/src/main/assets/dicts/main_ru.dict and b/app/src/main/assets/dicts/main_ru.dict differ diff --git a/app/src/main/assets/dicts/main_sv.dict b/app/src/main/assets/dicts/main_sv.dict index 0e7fdda6..dc74757d 100644 Binary files a/app/src/main/assets/dicts/main_sv.dict and b/app/src/main/assets/dicts/main_sv.dict differ diff --git a/app/src/main/assets/dicts/main_tr.dict b/app/src/main/assets/dicts/main_tr.dict deleted file mode 100644 index 3951fa23..00000000 Binary files a/app/src/main/assets/dicts/main_tr.dict and /dev/null differ diff --git a/app/src/main/assets/i18n b/app/src/main/assets/i18n index 8e9ea67d..88ffe39c 160000 --- a/app/src/main/assets/i18n +++ b/app/src/main/assets/i18n @@ -1 +1 @@ -Subproject commit 8e9ea67d9da425db38dc62cc280866b1115bdc27 +Subproject commit 88ffe39cb72c192ea8f987f4ccb18d486d04f403 diff --git a/app/src/main/java/be/scri/helpers/NativeSuggestionEngine.kt b/app/src/main/java/be/scri/helpers/NativeSuggestionEngine.kt index cfb3778c..0059f8e2 100644 --- a/app/src/main/java/be/scri/helpers/NativeSuggestionEngine.kt +++ b/app/src/main/java/be/scri/helpers/NativeSuggestionEngine.kt @@ -116,6 +116,7 @@ class NativeSuggestionEngine(private val context: Context) { fun getAutocompletions( language: String, prefix: String, + previousWord: String? = null, limit: Int = 3 ): List { val dict = getDictionary(language) ?: return emptyList() @@ -123,18 +124,30 @@ class NativeSuggestionEngine(private val context: Context) { return try { val composedData = ComposedData.createForWord(prefix) + val ngramContext = + if (previousWord.isNullOrBlank()) { + NgramContext.EMPTY_PREV_WORDS_INFO + } else { + NgramContext(NgramContext.WordInfo(previousWord)) + } val suggestions = dict.getSuggestions( composedData, - NgramContext.EMPTY_PREV_WORDS_INFO, + ngramContext, dummyProximityInfo.nativeProximityInfo, // proximityInfoHandle - SettingsValuesForSuggestion(false, false), + SettingsValuesForSuggestion(true, false), // blockPotentiallyOffensive, spaceAwareGesture 1, // sessionId 1.0f, // weightForLocale null // inOutWeightOfLangModelVsSpatialModel ) + val isCapitalized = StringUtils.isWordCapitalized(prefix) suggestions?.map { it.mWord } - ?.filter { it.isNotBlank() && it.lowercase(Locale.ROOT) != prefix.lowercase(Locale.ROOT) } + ?.filter { + it.isNotBlank() && + it.startsWith(prefix, ignoreCase = true) && + it.lowercase(Locale.ROOT) != prefix.lowercase(Locale.ROOT) + } + ?.map { if (isCapitalized) it.replaceFirstChar { c -> c.uppercaseChar() } else it } ?.take(limit) ?: emptyList() } catch (e: Exception) { @@ -162,14 +175,14 @@ class NativeSuggestionEngine(private val context: Context) { composedData, ngramContext, dummyProximityInfo.nativeProximityInfo, // proximityInfoHandle - SettingsValuesForSuggestion(false, false), + SettingsValuesForSuggestion(true, false), // blockPotentiallyOffensive, spaceAwareGesture 1, // sessionId 1.0f, // weightForLocale null // inOutWeightOfLangModelVsSpatialModel ) suggestions?.map { it.mWord } - ?.filter { it.isNotBlank() } + ?.filter { it.isNotBlank() && it.lowercase(Locale.ROOT) != lastWord.lowercase(Locale.ROOT) } ?.take(limit) ?: emptyList() } catch (e: Exception) { diff --git a/app/src/main/java/be/scri/latin/common/ComposedData.kt b/app/src/main/java/be/scri/latin/common/ComposedData.kt index d0d1e416..3a8f9d77 100644 --- a/app/src/main/java/be/scri/latin/common/ComposedData.kt +++ b/app/src/main/java/be/scri/latin/common/ComposedData.kt @@ -8,8 +8,6 @@ */ package be.scri.latin.common -import kotlin.random.Random - /** An immutable class that encapsulates a snapshot of word composition data. */ class ComposedData( @JvmField val mInputPointers: InputPointers, @@ -48,10 +46,12 @@ class ComposedData( companion object { fun createForWord(word: String): ComposedData { val codePoints = StringUtils.toCodePointArray(word) - val coordinates = CoordinateUtils.newCoordinateArray(codePoints.size) - for (i in codePoints.indices) { - CoordinateUtils.setXYInArray(coordinates, i, Random.nextBits(2), Random.nextBits(2)) - } + val coordinates = + CoordinateUtils.newCoordinateArray( + codePoints.size, + Constants.NOT_A_COORDINATE, + Constants.NOT_A_COORDINATE, + ) val pointers = InputPointers(codePoints.size).apply { for (i in codePoints.indices) { addPointer(CoordinateUtils.xFromArray(coordinates, i), CoordinateUtils.yFromArray(coordinates, i), 0, 0) diff --git a/app/src/main/java/be/scri/ui/screens/ThirdPartyScreen.kt b/app/src/main/java/be/scri/ui/screens/ThirdPartyScreen.kt index b7d2017d..1e095824 100644 --- a/app/src/main/java/be/scri/ui/screens/ThirdPartyScreen.kt +++ b/app/src/main/java/be/scri/ui/screens/ThirdPartyScreen.kt @@ -47,9 +47,20 @@ fun ThirdPartyScreen( ) { Column(modifier = Modifier.padding(16.dp)) { Text( - text = stringResource(id = R.string.i18n_app_about_legal_third_party_text), + text = stringResource(id = R.string.i18n_app_about_legal_third_party_text_1), style = MaterialTheme.typography.bodyMedium, ) + Spacer(modifier = Modifier.height(12.dp)) + Text( + text = stringResource(id = R.string.i18n_app_about_legal_third_party_text_2), + style = MaterialTheme.typography.bodyMedium, + ) + Spacer(modifier = Modifier.height(12.dp)) + Text( + text = stringResource(id = R.string.i18n_app_about_legal_third_party_text_3), + style = MaterialTheme.typography.bodyMedium, + ) + Spacer(modifier = Modifier.height(12.dp)) Text( text = stringResource(id = R.string.i18n_app_about_legal_third_party_entry_simple_keyboard), style = MaterialTheme.typography.bodyMedium, diff --git a/app/src/main/jni/Android.bp b/app/src/main/jni/Android.bp deleted file mode 100644 index 5649fc1e..00000000 --- a/app/src/main/jni/Android.bp +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright (C) 2013 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -filegroup { - name: "LATIN_IME_CORE_SRC_FILES", - srcs: [ - "src/dictionary/header/header_policy.cpp", - "src/dictionary/header/header_read_write_utils.cpp", - "src/dictionary/property/ngram_context.cpp", - "src/dictionary/structure/dictionary_structure_with_buffer_policy_factory.cpp", - "src/dictionary/structure/pt_common/bigram/bigram_list_read_write_utils.cpp", - "src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.cpp", - "src/dictionary/structure/pt_common/dynamic_pt_reading_helper.cpp", - "src/dictionary/structure/pt_common/dynamic_pt_reading_utils.cpp", - "src/dictionary/structure/pt_common/dynamic_pt_updating_helper.cpp", - "src/dictionary/structure/pt_common/dynamic_pt_writing_utils.cpp", - "src/dictionary/structure/pt_common/patricia_trie_reading_utils.cpp", - "src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.cpp", - "src/dictionary/structure/v2/patricia_trie_policy.cpp", - "src/dictionary/structure/v2/ver2_patricia_trie_node_reader.cpp", - "src/dictionary/structure/v2/ver2_pt_node_array_reader.cpp", - "src/dictionary/structure/v4/ver4_dict_buffers.cpp", - "src/dictionary/structure/v4/ver4_dict_constants.cpp", - "src/dictionary/structure/v4/ver4_patricia_trie_node_reader.cpp", - "src/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp", - "src/dictionary/structure/v4/ver4_patricia_trie_policy.cpp", - "src/dictionary/structure/v4/ver4_patricia_trie_reading_utils.cpp", - "src/dictionary/structure/v4/ver4_patricia_trie_writing_helper.cpp", - "src/dictionary/structure/v4/ver4_pt_node_array_reader.cpp", - "src/dictionary/structure/v4/content/dynamic_language_model_probability_utils.cpp", - "src/dictionary/structure/v4/content/language_model_dict_content.cpp", - "src/dictionary/structure/v4/content/language_model_dict_content_global_counters.cpp", - "src/dictionary/structure/v4/content/shortcut_dict_content.cpp", - "src/dictionary/structure/v4/content/sparse_table_dict_content.cpp", - "src/dictionary/structure/v4/content/terminal_position_lookup_table.cpp", - "src/dictionary/utils/buffer_with_extendable_buffer.cpp", - "src/dictionary/utils/byte_array_utils.cpp", - "src/dictionary/utils/dict_file_writing_utils.cpp", - "src/dictionary/utils/file_utils.cpp", - "src/dictionary/utils/forgetting_curve_utils.cpp", - "src/dictionary/utils/format_utils.cpp", - "src/dictionary/utils/mmapped_buffer.cpp", - "src/dictionary/utils/multi_bigram_map.cpp", - "src/dictionary/utils/probability_utils.cpp", - "src/dictionary/utils/sparse_table.cpp", - "src/dictionary/utils/trie_map.cpp", - "src/suggest/core/suggest.cpp", - "src/suggest/core/dicnode/dic_node.cpp", - "src/suggest/core/dicnode/dic_node_utils.cpp", - "src/suggest/core/dicnode/dic_nodes_cache.cpp", - "src/suggest/core/dictionary/dictionary.cpp", - "src/suggest/core/dictionary/dictionary_utils.cpp", - "src/suggest/core/dictionary/digraph_utils.cpp", - "src/suggest/core/dictionary/error_type_utils.cpp", - "src/suggest/core/layout/additional_proximity_chars.cpp", - "src/suggest/core/layout/proximity_info.cpp", - "src/suggest/core/layout/proximity_info_params.cpp", - "src/suggest/core/layout/proximity_info_state.cpp", - "src/suggest/core/layout/proximity_info_state_utils.cpp", - "src/suggest/core/policy/weighting.cpp", - "src/suggest/core/session/dic_traverse_session.cpp", - "src/suggest/core/result/suggestion_results.cpp", - "src/suggest/core/result/suggestions_output_utils.cpp", - "src/suggest/policyimpl/gesture/gesture_suggest_policy_factory.cpp", - "src/suggest/policyimpl/typing/scoring_params.cpp", - "src/suggest/policyimpl/typing/typing_scoring.cpp", - "src/suggest/policyimpl/typing/typing_suggest_policy.cpp", - "src/suggest/policyimpl/typing/typing_traversal.cpp", - "src/suggest/policyimpl/typing/typing_weighting.cpp", - "src/utils/autocorrection_threshold_utils.cpp", - "src/utils/char_utils.cpp", - "src/utils/jni_data_utils.cpp", - "src/utils/log_utils.cpp", - "src/utils/time_keeper.cpp", - - // BACKWARD_V402 - "src/dictionary/structure/backward/v402/ver4_dict_buffers.cpp", - "src/dictionary/structure/backward/v402/ver4_dict_constants.cpp", - "src/dictionary/structure/backward/v402/ver4_patricia_trie_node_reader.cpp", - "src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.cpp", - "src/dictionary/structure/backward/v402/ver4_patricia_trie_policy.cpp", - "src/dictionary/structure/backward/v402/ver4_patricia_trie_reading_utils.cpp", - "src/dictionary/structure/backward/v402/ver4_patricia_trie_writing_helper.cpp", - "src/dictionary/structure/backward/v402/ver4_pt_node_array_reader.cpp", - "src/dictionary/structure/backward/v402/content/bigram_dict_content.cpp", - "src/dictionary/structure/backward/v402/content/probability_dict_content.cpp", - "src/dictionary/structure/backward/v402/content/shortcut_dict_content.cpp", - "src/dictionary/structure/backward/v402/content/sparse_table_dict_content.cpp", - "src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.cpp", - "src/dictionary/structure/backward/v402/bigram/ver4_bigram_list_policy.cpp", - ], -} - -cc_library { - name: "libjni_latinime", - host_supported: true, - product_specific: true, - - sdk_version: "14", - cflags: [ - "-Werror", - "-Wall", - "-Wextra", - "-Weffc++", - "-Wformat=2", - "-Wcast-qual", - "-Wcast-align", - "-Wwrite-strings", - "-Wfloat-equal", - "-Wpointer-arith", - "-Winit-self", - "-Wredundant-decls", - "-Woverloaded-virtual", - "-Wsign-promo", - "-Wno-system-headers", - "-Wno-format-nonliteral", - - // To suppress compiler warnings for unused variables/functions used for debug features etc. - "-Wno-unused-parameter", - "-Wno-unused-function", - ], - local_include_dirs: ["src"], - - srcs: [ - "com_android_inputmethod_keyboard_ProximityInfo.cpp", - "com_android_inputmethod_latin_BinaryDictionary.cpp", - "com_android_inputmethod_latin_BinaryDictionaryUtils.cpp", - "com_android_inputmethod_latin_DicTraverseSession.cpp", - "jni_common.cpp", - - ":LATIN_IME_CORE_SRC_FILES", - ], - - target: { - android_x86: { - // HACK: -mstackrealign is required for x86 builds running on pre-KitKat devices to avoid crashes - // with SSE instructions. - cflags: ["-mstackrealign"], - }, - android: { - stl: "libc++_static", - }, - host: { - cflags: ["-DHOST_TOOL"], - }, - }, -} - -cc_library_static { - name: "liblatinime_static_for_unittests", - host_supported: true, - - cflags: [ - "-Wno-unused-parameter", - "-Wno-unused-function", - "-Wall", - "-Werror", - ], - local_include_dirs: ["src"], - sdk_version: "14", - stl: "libc++_static", - - srcs: [":LATIN_IME_CORE_SRC_FILES"], -} - -cc_test { - name: "liblatinime_unittests", - host_supported: true, - - cflags: [ - "-Wno-unused-parameter", - "-Wno-unused-function", - "-Wall", - "-Werror", - ], - local_include_dirs: ["src"], - sdk_version: "14", - stl: "libc++_static", - - srcs: [ - "tests/defines_test.cpp", - "tests/dictionary/header/header_read_write_utils_test.cpp", - "tests/dictionary/structure/v4/content/language_model_dict_content_test.cpp", - "tests/dictionary/structure/v4/content/language_model_dict_content_global_counters_test.cpp", - "tests/dictionary/structure/v4/content/probability_entry_test.cpp", - "tests/dictionary/structure/v4/content/terminal_position_lookup_table_test.cpp", - "tests/dictionary/utils/bloom_filter_test.cpp", - "tests/dictionary/utils/buffer_with_extendable_buffer_test.cpp", - "tests/dictionary/utils/byte_array_utils_test.cpp", - "tests/dictionary/utils/format_utils_test.cpp", - "tests/dictionary/utils/probability_utils_test.cpp", - "tests/dictionary/utils/sparse_table_test.cpp", - "tests/dictionary/utils/trie_map_test.cpp", - "tests/suggest/core/dicnode/dic_node_pool_test.cpp", - "tests/suggest/core/layout/geometry_utils_test.cpp", - "tests/suggest/core/layout/normal_distribution_2d_test.cpp", - "tests/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy_test.cpp", - "tests/utils/autocorrection_threshold_utils_test.cpp", - "tests/utils/char_utils_test.cpp", - "tests/utils/int_array_view_test.cpp", - "tests/utils/time_keeper_test.cpp", - ], - static_libs: ["liblatinime_static_for_unittests"], -} diff --git a/app/src/main/jni/Android.mk b/app/src/main/jni/Android.mk deleted file mode 100755 index 0099cafb..00000000 --- a/app/src/main/jni/Android.mk +++ /dev/null @@ -1,106 +0,0 @@ -# Copyright (C) 2011 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH := $(call my-dir) - -############ some local flags -# If you change any of those flags, you need to rebuild both libjni_latinime_common_static -# and the shared library that uses libjni_latinime_common_static. -FLAG_DBG ?= false -FLAG_DO_PROFILE ?= false - -###################################### -include $(CLEAR_VARS) - -LATIN_IME_SRC_DIR := src - -LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR) - -LOCAL_CFLAGS += -Wall -Wextra -Weffc++ -Wformat=2 -Wcast-qual -Wcast-align \ - -Wwrite-strings -Wfloat-equal -Wpointer-arith -Winit-self -Wredundant-decls \ - -Woverloaded-virtual -Wsign-promo -Wno-system-headers - -# To suppress compiler warnings for unused variables/functions used for debug features etc. -LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function - -# HACK: -mstackrealign is required for x86 builds running on pre-KitKat devices to avoid crashes -# with SSE instructions. -ifeq ($(TARGET_ARCH), x86) - LOCAL_CFLAGS += -mstackrealign -endif # x86 - -include $(LOCAL_PATH)/NativeFileList.mk - -LOCAL_SRC_FILES := \ - $(LATIN_IME_JNI_SRC_FILES) \ - $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES)) - -ifeq ($(FLAG_DO_PROFILE), true) - $(warning Making profiling version of native library) - LOCAL_CFLAGS += -DFLAG_DO_PROFILE -funwind-tables -else # FLAG_DO_PROFILE -ifeq ($(FLAG_DBG), true) - $(warning Making debug version of native library) - LOCAL_CFLAGS += -DFLAG_DBG -funwind-tables -fno-inline -ifeq ($(FLAG_FULL_DBG), true) - $(warning Making full debug version of native library) - LOCAL_CFLAGS += -DFLAG_FULL_DBG -endif # FLAG_FULL_DBG -endif # FLAG_DBG -endif # FLAG_DO_PROFILE - -LOCAL_MODULE := libjni_latinime_common_static -LOCAL_MODULE_TAGS := optional - -LOCAL_CLANG := true -LOCAL_SDK_VERSION := 14 -LOCAL_NDK_STL_VARIANT := c++_static - -include $(BUILD_STATIC_LIBRARY) -###################################### -include $(CLEAR_VARS) - -# All code in LOCAL_WHOLE_STATIC_LIBRARIES will be built into this shared library. -LOCAL_WHOLE_STATIC_LIBRARIES := libjni_latinime_common_static - -ifeq ($(FLAG_DO_PROFILE), true) - $(warning Making profiling version of native library) - LOCAL_LDFLAGS += -llog -else # FLAG_DO_PROFILE -ifeq ($(FLAG_DBG), true) - $(warning Making debug version of native library) - LOCAL_LDFLAGS += -llog -endif # FLAG_DBG -endif # FLAG_DO_PROFILE - -LOCAL_MODULE := libjni_latinime -LOCAL_MODULE_TAGS := optional - -LOCAL_CLANG := true -LOCAL_SDK_VERSION := 14 -LOCAL_NDK_STL_VARIANT := c++_static -LOCAL_LDFLAGS += -ldl - -# Avoid issues with reproducible builds, see https://gitlab.com/fdroid/rfp/-/issues/2662 -LOCAL_LDFLAGS += -Wl,--build-id=none -Wl,--hash-style=both -Wl,-z,max-page-size=16384 - -include $(BUILD_SHARED_LIBRARY) -#################### Clean up the tmp vars -include $(LOCAL_PATH)/CleanupNativeFileList.mk - -#################### Unit test on host environment -#include $(LOCAL_PATH)/HostUnitTests.mk - -#################### Unit test on target environment -#include $(LOCAL_PATH)/TargetUnitTests.mk diff --git a/app/src/main/jni/Application.mk b/app/src/main/jni/Application.mk deleted file mode 100755 index a169e740..00000000 --- a/app/src/main/jni/Application.mk +++ /dev/null @@ -1,2 +0,0 @@ -APP_STL := c++_static -APP_ABI := all diff --git a/app/src/main/jni/CleanupNativeFileList.mk b/app/src/main/jni/CleanupNativeFileList.mk deleted file mode 100755 index eed6f1e6..00000000 --- a/app/src/main/jni/CleanupNativeFileList.mk +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LATIN_IME_CORE_SRC_FILES := -LATIN_IME_CORE_SRC_FILES_BACKWARD_V401 := -LATIN_IME_CORE_TEST_FILES := -LATIN_IME_JNI_SRC_FILES := -LATIN_IME_SRC_DIR := diff --git a/app/src/main/jni/HostUnitTests.mk b/app/src/main/jni/HostUnitTests.mk deleted file mode 100755 index 6a8bcec2..00000000 --- a/app/src/main/jni/HostUnitTests.mk +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (C) 2014 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# Host build is never supported in unbundled (NDK/tapas) build -ifeq (,$(TARGET_BUILD_APPS)) - -# HACK: Temporarily disable host tool build on Mac until the build system is ready for C++11. -LATINIME_HOST_OSNAME := $(shell uname -s) -ifneq ($(LATINIME_HOST_OSNAME), Darwin) # TODO: Remove this - -LOCAL_PATH := $(call my-dir) - -###################################### -include $(CLEAR_VARS) - -include $(LOCAL_PATH)/NativeFileList.mk - -#################### Host library for unit test -LATIN_IME_SRC_DIR := src -LOCAL_ADDRESS_SANITIZER := true -LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function -LOCAL_CLANG := true -LOCAL_CXX_STL := libc++ -LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR) -LOCAL_MODULE := liblatinime_host_static_for_unittests -LOCAL_MODULE_TAGS := optional -LOCAL_SRC_FILES := $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES)) -include $(BUILD_HOST_STATIC_LIBRARY) - -#################### Host native tests -include $(CLEAR_VARS) -LATIN_IME_TEST_SRC_DIR := tests -LOCAL_ADDRESS_SANITIZER := true -LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function -LOCAL_CLANG := true -LOCAL_CXX_STL := libc++ -LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR) -LOCAL_MODULE := liblatinime_host_unittests -LOCAL_MODULE_TAGS := tests -LOCAL_SRC_FILES := $(addprefix $(LATIN_IME_TEST_SRC_DIR)/, $(LATIN_IME_CORE_TEST_FILES)) -LOCAL_STATIC_LIBRARIES += liblatinime_host_static_for_unittests -include $(BUILD_HOST_NATIVE_TEST) - -include $(LOCAL_PATH)/CleanupNativeFileList.mk - -endif # Darwin - TODO: Remove this - -endif # TARGET_BUILD_APPS - -#################### Clean up the tmp vars -LATINIME_HOST_OSNAME := -LATIN_IME_SRC_DIR := -LATIN_IME_TEST_SRC_DIR := diff --git a/app/src/main/jni/NativeFileList.mk b/app/src/main/jni/NativeFileList.mk deleted file mode 100755 index d8b69bfd..00000000 --- a/app/src/main/jni/NativeFileList.mk +++ /dev/null @@ -1,146 +0,0 @@ -# Copyright (C) 2013 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LATIN_IME_JNI_SRC_FILES := \ - com_android_inputmethod_keyboard_ProximityInfo.cpp \ - com_android_inputmethod_latin_BinaryDictionary.cpp \ - com_android_inputmethod_latin_BinaryDictionaryUtils.cpp \ - com_android_inputmethod_latin_DicTraverseSession.cpp \ - jni_common.cpp - -LATIN_IME_CORE_SRC_FILES := \ - $(addprefix dictionary/header/, \ - header_policy.cpp \ - header_read_write_utils.cpp) \ - dictionary/property/ngram_context.cpp \ - dictionary/structure/dictionary_structure_with_buffer_policy_factory.cpp \ - $(addprefix dictionary/structure/pt_common/, \ - bigram/bigram_list_read_write_utils.cpp \ - dynamic_pt_gc_event_listeners.cpp \ - dynamic_pt_reading_helper.cpp \ - dynamic_pt_reading_utils.cpp \ - dynamic_pt_updating_helper.cpp \ - dynamic_pt_writing_utils.cpp \ - patricia_trie_reading_utils.cpp \ - shortcut/shortcut_list_reading_utils.cpp) \ - $(addprefix dictionary/structure/v2/, \ - patricia_trie_policy.cpp \ - ver2_patricia_trie_node_reader.cpp \ - ver2_pt_node_array_reader.cpp) \ - $(addprefix dictionary/structure/v4/, \ - ver4_dict_buffers.cpp \ - ver4_dict_constants.cpp \ - ver4_patricia_trie_node_reader.cpp \ - ver4_patricia_trie_node_writer.cpp \ - ver4_patricia_trie_policy.cpp \ - ver4_patricia_trie_reading_utils.cpp \ - ver4_patricia_trie_writing_helper.cpp \ - ver4_pt_node_array_reader.cpp) \ - $(addprefix dictionary/structure/v4/content/, \ - dynamic_language_model_probability_utils.cpp \ - language_model_dict_content.cpp \ - language_model_dict_content_global_counters.cpp \ - shortcut_dict_content.cpp \ - sparse_table_dict_content.cpp \ - terminal_position_lookup_table.cpp) \ - $(addprefix dictionary/utils/, \ - buffer_with_extendable_buffer.cpp \ - byte_array_utils.cpp \ - dict_file_writing_utils.cpp \ - file_utils.cpp \ - forgetting_curve_utils.cpp \ - format_utils.cpp \ - mmapped_buffer.cpp \ - multi_bigram_map.cpp \ - probability_utils.cpp \ - sparse_table.cpp \ - trie_map.cpp ) \ - suggest/core/suggest.cpp \ - $(addprefix suggest/core/dicnode/, \ - dic_node.cpp \ - dic_node_utils.cpp \ - dic_nodes_cache.cpp) \ - $(addprefix suggest/core/dictionary/, \ - dictionary.cpp \ - dictionary_utils.cpp \ - digraph_utils.cpp \ - error_type_utils.cpp ) \ - $(addprefix suggest/core/layout/, \ - additional_proximity_chars.cpp \ - proximity_info.cpp \ - proximity_info_params.cpp \ - proximity_info_state.cpp \ - proximity_info_state_utils.cpp) \ - suggest/core/policy/weighting.cpp \ - suggest/core/session/dic_traverse_session.cpp \ - $(addprefix suggest/core/result/, \ - suggestion_results.cpp \ - suggestions_output_utils.cpp) \ - suggest/policyimpl/gesture/gesture_suggest_policy_factory.cpp \ - $(addprefix suggest/policyimpl/typing/, \ - scoring_params.cpp \ - typing_scoring.cpp \ - typing_suggest_policy.cpp \ - typing_traversal.cpp \ - typing_weighting.cpp) \ - $(addprefix utils/, \ - autocorrection_threshold_utils.cpp \ - char_utils.cpp \ - jni_data_utils.cpp \ - log_utils.cpp \ - time_keeper.cpp) - -LATIN_IME_CORE_SRC_FILES_BACKWARD_V402 := \ - $(addprefix dictionary/structure/backward/v402/, \ - ver4_dict_buffers.cpp \ - ver4_dict_constants.cpp \ - ver4_patricia_trie_node_reader.cpp \ - ver4_patricia_trie_node_writer.cpp \ - ver4_patricia_trie_policy.cpp \ - ver4_patricia_trie_reading_utils.cpp \ - ver4_patricia_trie_writing_helper.cpp \ - ver4_pt_node_array_reader.cpp) \ - $(addprefix dictionary/structure/backward/v402/content/, \ - bigram_dict_content.cpp \ - probability_dict_content.cpp \ - shortcut_dict_content.cpp \ - sparse_table_dict_content.cpp \ - terminal_position_lookup_table.cpp) \ - $(addprefix dictionary/structure/backward/v402/bigram/, \ - ver4_bigram_list_policy.cpp) - -LATIN_IME_CORE_SRC_FILES += $(LATIN_IME_CORE_SRC_FILES_BACKWARD_V402) - -LATIN_IME_CORE_TEST_FILES := \ - defines_test.cpp \ - dictionary/header/header_read_write_utils_test.cpp \ - dictionary/structure/v4/content/language_model_dict_content_test.cpp \ - dictionary/structure/v4/content/language_model_dict_content_global_counters_test.cpp \ - dictionary/structure/v4/content/probability_entry_test.cpp \ - dictionary/structure/v4/content/terminal_position_lookup_table_test.cpp \ - dictionary/utils/bloom_filter_test.cpp \ - dictionary/utils/buffer_with_extendable_buffer_test.cpp \ - dictionary/utils/byte_array_utils_test.cpp \ - dictionary/utils/format_utils_test.cpp \ - dictionary/utils/probability_utils_test.cpp \ - dictionary/utils/sparse_table_test.cpp \ - dictionary/utils/trie_map_test.cpp \ - suggest/core/dicnode/dic_node_pool_test.cpp \ - suggest/core/layout/geometry_utils_test.cpp \ - suggest/core/layout/normal_distribution_2d_test.cpp \ - suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy_test.cpp \ - utils/autocorrection_threshold_utils_test.cpp \ - utils/char_utils_test.cpp \ - utils/int_array_view_test.cpp \ - utils/time_keeper_test.cpp diff --git a/app/src/main/jni/TargetUnitTests.mk b/app/src/main/jni/TargetUnitTests.mk deleted file mode 100755 index 69a32edb..00000000 --- a/app/src/main/jni/TargetUnitTests.mk +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2014 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH := $(call my-dir) - -###################################### -include $(CLEAR_VARS) - -include $(LOCAL_PATH)/NativeFileList.mk - -#################### Target library for unit test -LATIN_IME_SRC_DIR := src -LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function -LOCAL_CLANG := true -LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR) -LOCAL_MODULE := liblatinime_target_static_for_unittests -LOCAL_MODULE_TAGS := optional -LOCAL_SRC_FILES := $(addprefix $(LATIN_IME_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES)) -LOCAL_SDK_VERSION := 14 -LOCAL_NDK_STL_VARIANT := c++_static -include $(BUILD_STATIC_LIBRARY) - -#################### Target native tests -include $(CLEAR_VARS) -LATIN_IME_TEST_SRC_DIR := tests -LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function -LOCAL_CLANG := true -LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_SRC_DIR) -LOCAL_MODULE := liblatinime_target_unittests -LOCAL_MODULE_TAGS := tests -LOCAL_SRC_FILES := \ - $(addprefix $(LATIN_IME_TEST_SRC_DIR)/, $(LATIN_IME_CORE_TEST_FILES)) -LOCAL_STATIC_LIBRARIES += liblatinime_target_static_for_unittests -LOCAL_SDK_VERSION := 14 -LOCAL_NDK_STL_VARIANT := c++_static -include $(BUILD_NATIVE_TEST) - -#################### Clean up the tmp vars -LATIN_IME_SRC_DIR := -LATIN_IME_TEST_SRC_DIR := -include $(LOCAL_PATH)/CleanupNativeFileList.mk diff --git a/app/src/main/jni/run-tests.sh b/app/src/main/jni/run-tests.sh deleted file mode 100755 index a7fa82d9..00000000 --- a/app/src/main/jni/run-tests.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -# Copyright 2014, The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -function usage() { - echo "usage: source run-tests.sh [--host] [--target] [-h] [--help]" 1>&2 - echo " --host: run test on the host environment" 1>&2 - echo " --no-host: skip host test" 1>&2 - echo " --target: run test on the target environment" 1>&2 - echo " --no-target: skip target device test" 1>&2 -} - -# check script arguments -if [[ $(type -t mmm) != function ]]; then -usage -if [[ ${BASH_SOURCE[0]} != $0 ]]; then return; else exit 1; fi -fi - -show_usage=no -enable_host_test=yes -enable_target_device_test=no -while [ "$1" != "" ] - do - case "$1" in - "-h") show_usage=yes;; - "--help") show_usage=yes;; - "--target") enable_target_device_test=yes;; - "--no-target") enable_target_device_test=no;; - "--host") enable_host_test=yes;; - "--no-host") enable_host_test=no;; - esac - shift -done - -if [[ $show_usage == yes ]]; then - usage - if [[ ${BASH_SOURCE[0]} != $0 ]]; then return; else exit 1; fi -fi - -# Host build is never supported in unbundled (NDK/tapas) build -if [[ $enable_host_test == yes && -n $TARGET_BUILD_APPS ]]; then - echo "Host build is never supported in tapas build." 1>&2 - echo "Use lunch command instead." 1>&2 - if [[ ${BASH_SOURCE[0]} != $0 ]]; then return; else exit 1; fi -fi - -target_test_name=liblatinime_target_unittests -host_test_name=liblatinime_host_unittests - -pushd $PWD > /dev/null -cd $(gettop) -mmm -j16 packages/inputmethods/LatinIME/native/jni || \ - make -j16 adb $target_test_name $host_test_name -if [[ $enable_host_test == yes ]]; then - $ANDROID_HOST_OUT/bin/$host_test_name -fi -if [[ $enable_target_device_test == yes ]]; then - target_test_local=$ANDROID_PRODUCT_OUT/data/nativetest/$target_test_name/$target_test_name - target_test_device=/data/nativetest/$target_test_name/$target_test_name - adb push $target_test_local $target_test_device - adb shell $target_test_device - adb shell rm -rf $target_test_device -fi -popd > /dev/null diff --git a/app/src/main/jni/tests/defines_test.cpp b/app/src/main/jni/tests/defines_test.cpp deleted file mode 100644 index f7b80b2b..00000000 --- a/app/src/main/jni/tests/defines_test.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "defines.h" - -#include - -namespace latinime { -namespace { - -TEST(DefinesTest, NELEMSForFixedLengthArray) { - const size_t SMALL_ARRAY_SIZE = 1; - const size_t LARGE_ARRAY_SIZE = 100; - int smallArray[SMALL_ARRAY_SIZE]; - int largeArray[LARGE_ARRAY_SIZE]; - EXPECT_EQ(SMALL_ARRAY_SIZE, NELEMS(smallArray)); - EXPECT_EQ(LARGE_ARRAY_SIZE, NELEMS(largeArray)); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/dictionary/header/header_read_write_utils_test.cpp b/app/src/main/jni/tests/dictionary/header/header_read_write_utils_test.cpp deleted file mode 100644 index eab5d657..00000000 --- a/app/src/main/jni/tests/dictionary/header/header_read_write_utils_test.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "dictionary/header/header_read_write_utils.h" - -#include - -#include -#include - -#include "dictionary/interface/dictionary_header_structure_policy.h" - -namespace latinime { -namespace { - -TEST(HeaderReadWriteUtilsTest, TestInsertCharactersIntoVector) { - DictionaryHeaderStructurePolicy::AttributeMap::key_type vector; - - HeaderReadWriteUtils::insertCharactersIntoVector("", &vector); - EXPECT_TRUE(vector.empty()); - - static const char *str = "abc-xyz!?"; - HeaderReadWriteUtils::insertCharactersIntoVector(str, &vector); - EXPECT_EQ(strlen(str) , vector.size()); - for (size_t i = 0; i < vector.size(); ++i) { - EXPECT_EQ(str[i], vector[i]); - } -} - -TEST(HeaderReadWriteUtilsTest, TestAttributeMapForInt) { - DictionaryHeaderStructurePolicy::AttributeMap attributeMap; - - // Returns default value if not exists. - EXPECT_EQ(-1, HeaderReadWriteUtils::readIntAttributeValue(&attributeMap, "", -1)); - EXPECT_EQ(100, HeaderReadWriteUtils::readIntAttributeValue(&attributeMap, "abc", 100)); - - HeaderReadWriteUtils::setIntAttribute(&attributeMap, "abc", 10); - EXPECT_EQ(10, HeaderReadWriteUtils::readIntAttributeValue(&attributeMap, "abc", 100)); - HeaderReadWriteUtils::setIntAttribute(&attributeMap, "abc", 20); - EXPECT_EQ(20, HeaderReadWriteUtils::readIntAttributeValue(&attributeMap, "abc", 100)); - HeaderReadWriteUtils::setIntAttribute(&attributeMap, "abcd", 30); - EXPECT_EQ(30, HeaderReadWriteUtils::readIntAttributeValue(&attributeMap, "abcd", 100)); - EXPECT_EQ(20, HeaderReadWriteUtils::readIntAttributeValue(&attributeMap, "abc", 100)); -} - -TEST(HeaderReadWriteUtilsTest, TestAttributeMapCodeForPoints) { - DictionaryHeaderStructurePolicy::AttributeMap attributeMap; - - // Returns empty vector if not exists. - EXPECT_TRUE(HeaderReadWriteUtils::readCodePointVectorAttributeValue(&attributeMap, "").empty()); - EXPECT_TRUE(HeaderReadWriteUtils::readCodePointVectorAttributeValue( - &attributeMap, "abc").empty()); - - HeaderReadWriteUtils::setCodePointVectorAttribute(&attributeMap, "abc", {}); - EXPECT_TRUE(HeaderReadWriteUtils::readCodePointVectorAttributeValue( - &attributeMap, "abc").empty()); - - const std::vector codePoints = { 0x0, 0x20, 0x1F, 0x100000 }; - HeaderReadWriteUtils::setCodePointVectorAttribute(&attributeMap, "abc", codePoints); - EXPECT_EQ(codePoints, HeaderReadWriteUtils::readCodePointVectorAttributeValue( - &attributeMap, "abc")); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/dictionary/structure/v4/content/language_model_dict_content_global_counters_test.cpp b/app/src/main/jni/tests/dictionary/structure/v4/content/language_model_dict_content_global_counters_test.cpp deleted file mode 100644 index 2e3047ed..00000000 --- a/app/src/main/jni/tests/dictionary/structure/v4/content/language_model_dict_content_global_counters_test.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "dictionary/structure/v4/content/language_model_dict_content_global_counters.h" - -#include - -#include "dictionary/structure/v4/ver4_dict_constants.h" - -namespace latinime { -namespace { - -TEST(LanguageModelDictContentGlobalCountersTest, TestUpdateMaxValueOfCounters) { - LanguageModelDictContentGlobalCounters globalCounters; - - EXPECT_FALSE(globalCounters.needsToHalveCounters()); - globalCounters.updateMaxValueOfCounters(10); - EXPECT_FALSE(globalCounters.needsToHalveCounters()); - const int count = (1 << (Ver4DictConstants::WORD_COUNT_FIELD_SIZE * CHAR_BIT)) - 1; - globalCounters.updateMaxValueOfCounters(count); - EXPECT_TRUE(globalCounters.needsToHalveCounters()); - globalCounters.halveCounters(); - EXPECT_FALSE(globalCounters.needsToHalveCounters()); -} - -TEST(LanguageModelDictContentGlobalCountersTest, TestIncrementTotalCount) { - LanguageModelDictContentGlobalCounters globalCounters; - - EXPECT_EQ(0, globalCounters.getTotalCount()); - globalCounters.incrementTotalCount(); - EXPECT_EQ(1, globalCounters.getTotalCount()); - for (int i = 1; i < 50; ++i) { - globalCounters.incrementTotalCount(); - } - EXPECT_EQ(50, globalCounters.getTotalCount()); - globalCounters.halveCounters(); - EXPECT_EQ(25, globalCounters.getTotalCount()); - globalCounters.halveCounters(); - EXPECT_EQ(12, globalCounters.getTotalCount()); - for (int i = 0; i < 4; ++i) { - globalCounters.halveCounters(); - } - EXPECT_EQ(0, globalCounters.getTotalCount()); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/dictionary/structure/v4/content/language_model_dict_content_test.cpp b/app/src/main/jni/tests/dictionary/structure/v4/content/language_model_dict_content_test.cpp deleted file mode 100644 index ab11975c..00000000 --- a/app/src/main/jni/tests/dictionary/structure/v4/content/language_model_dict_content_test.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "dictionary/structure/v4/content/language_model_dict_content.h" - -#include - -#include -#include - -#include "utils/int_array_view.h" - -namespace latinime { -namespace { - -TEST(LanguageModelDictContentTest, TestUnigramProbability) { - LanguageModelDictContent languageModelDictContent(false /* useHistoricalInfo */); - - const int flag = 0xF0; - const int probability = 10; - const int wordId = 100; - const ProbabilityEntry probabilityEntry(flag, probability); - languageModelDictContent.setProbabilityEntry(wordId, &probabilityEntry); - const ProbabilityEntry entry = - languageModelDictContent.getProbabilityEntry(wordId); - EXPECT_EQ(flag, entry.getFlags()); - EXPECT_EQ(probability, entry.getProbability()); - - // Remove - EXPECT_TRUE(languageModelDictContent.removeProbabilityEntry(wordId)); - EXPECT_FALSE(languageModelDictContent.getProbabilityEntry(wordId).isValid()); - EXPECT_FALSE(languageModelDictContent.removeProbabilityEntry(wordId)); - EXPECT_TRUE(languageModelDictContent.setProbabilityEntry(wordId, &probabilityEntry)); - EXPECT_TRUE(languageModelDictContent.getProbabilityEntry(wordId).isValid()); -} - -TEST(LanguageModelDictContentTest, TestUnigramProbabilityWithHistoricalInfo) { - LanguageModelDictContent languageModelDictContent(true /* useHistoricalInfo */); - - const int flag = 0xF0; - const int timestamp = 0x3FFFFFFF; - const int count = 10; - const int wordId = 100; - const HistoricalInfo historicalInfo(timestamp, 0 /* level */, count); - const ProbabilityEntry probabilityEntry(flag, &historicalInfo); - languageModelDictContent.setProbabilityEntry(wordId, &probabilityEntry); - const ProbabilityEntry entry = languageModelDictContent.getProbabilityEntry(wordId); - EXPECT_EQ(flag, entry.getFlags()); - EXPECT_EQ(timestamp, entry.getHistoricalInfo()->getTimestamp()); - EXPECT_EQ(count, entry.getHistoricalInfo()->getCount()); - - // Remove - EXPECT_TRUE(languageModelDictContent.removeProbabilityEntry(wordId)); - EXPECT_FALSE(languageModelDictContent.getProbabilityEntry(wordId).isValid()); - EXPECT_FALSE(languageModelDictContent.removeProbabilityEntry(wordId)); - EXPECT_TRUE(languageModelDictContent.setProbabilityEntry(wordId, &probabilityEntry)); - EXPECT_TRUE(languageModelDictContent.removeProbabilityEntry(wordId)); -} - -TEST(LanguageModelDictContentTest, TestIterateProbabilityEntry) { - LanguageModelDictContent languageModelDictContent(false /* useHistoricalInfo */); - - const ProbabilityEntry originalEntry(0xFC, 100); - - const int wordIds[] = { 1, 2, 3, 4, 5 }; - for (const int wordId : wordIds) { - languageModelDictContent.setProbabilityEntry(wordId, &originalEntry); - } - std::unordered_set wordIdSet(std::begin(wordIds), std::end(wordIds)); - for (const auto& entry : languageModelDictContent.getProbabilityEntries(WordIdArrayView())) { - EXPECT_EQ(originalEntry.getFlags(), entry.getProbabilityEntry().getFlags()); - EXPECT_EQ(originalEntry.getProbability(), entry.getProbabilityEntry().getProbability()); - wordIdSet.erase(entry.getWordId()); - } - EXPECT_TRUE(wordIdSet.empty()); -} - -TEST(LanguageModelDictContentTest, TestGetWordProbability) { - LanguageModelDictContent languageModelDictContent(false /* useHistoricalInfo */); - - const int flag = 0xFF; - const int probability = 10; - const int bigramProbability = 20; - const int trigramProbability = 30; - const int wordId = 100; - const std::array prevWordIdArray = {{ 1, 2 }}; - const WordIdArrayView prevWordIds = WordIdArrayView::fromArray(prevWordIdArray); - - const ProbabilityEntry probabilityEntry(flag, probability); - languageModelDictContent.setProbabilityEntry(wordId, &probabilityEntry); - const ProbabilityEntry bigramProbabilityEntry(flag, bigramProbability); - languageModelDictContent.setProbabilityEntry(prevWordIds[0], &probabilityEntry); - languageModelDictContent.setNgramProbabilityEntry(prevWordIds.limit(1), wordId, - &bigramProbabilityEntry); - EXPECT_EQ(bigramProbability, languageModelDictContent.getWordAttributes(prevWordIds, wordId, - false /* mustMatchAllPrevWords */, nullptr /* headerPolicy */).getProbability()); - const ProbabilityEntry trigramProbabilityEntry(flag, trigramProbability); - languageModelDictContent.setNgramProbabilityEntry(prevWordIds.limit(1), - prevWordIds[1], &probabilityEntry); - languageModelDictContent.setNgramProbabilityEntry(prevWordIds.limit(2), wordId, - &trigramProbabilityEntry); - EXPECT_EQ(trigramProbability, languageModelDictContent.getWordAttributes(prevWordIds, wordId, - false /* mustMatchAllPrevWords */, nullptr /* headerPolicy */).getProbability()); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/dictionary/structure/v4/content/probability_entry_test.cpp b/app/src/main/jni/tests/dictionary/structure/v4/content/probability_entry_test.cpp deleted file mode 100644 index ba81671b..00000000 --- a/app/src/main/jni/tests/dictionary/structure/v4/content/probability_entry_test.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "dictionary/structure/v4/content/probability_entry.h" - -#include - -#include "defines.h" - -namespace latinime { -namespace { - -TEST(ProbabilityEntryTest, TestEncodeDecode) { - const int flag = 0xFF; - const int probability = 10; - - const ProbabilityEntry entry(flag, probability); - const uint64_t encodedEntry = entry.encode(false /* hasHistoricalInfo */); - const ProbabilityEntry decodedEntry = - ProbabilityEntry::decode(encodedEntry, false /* hasHistoricalInfo */); - EXPECT_EQ(0xFF0Aull, encodedEntry); - EXPECT_EQ(flag, decodedEntry.getFlags()); - EXPECT_EQ(probability, decodedEntry.getProbability()); -} - -TEST(ProbabilityEntryTest, TestEncodeDecodeWithHistoricalInfo) { - const int flag = 0xF0; - const int timestamp = 0x3FFFFFFF; - const int count = 0xABCD; - - const HistoricalInfo historicalInfo(timestamp, 0 /* level */, count); - const ProbabilityEntry entry(flag, &historicalInfo); - - const uint64_t encodedEntry = entry.encode(true /* hasHistoricalInfo */); - EXPECT_EQ(0xF03FFFFFFFABCDull, encodedEntry); - const ProbabilityEntry decodedEntry = - ProbabilityEntry::decode(encodedEntry, true /* hasHistoricalInfo */); - - EXPECT_EQ(flag, decodedEntry.getFlags()); - EXPECT_EQ(timestamp, decodedEntry.getHistoricalInfo()->getTimestamp()); - EXPECT_EQ(count, decodedEntry.getHistoricalInfo()->getCount()); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/dictionary/structure/v4/content/terminal_position_lookup_table_test.cpp b/app/src/main/jni/tests/dictionary/structure/v4/content/terminal_position_lookup_table_test.cpp deleted file mode 100644 index 4f23889c..00000000 --- a/app/src/main/jni/tests/dictionary/structure/v4/content/terminal_position_lookup_table_test.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "dictionary/structure/v4/content/terminal_position_lookup_table.h" - -#include - -#include - -#include "defines.h" -#include "dictionary/structure/v4/ver4_dict_constants.h" - -namespace latinime { -namespace { - -TEST(TerminalPositionLookupTableTest, TestGetFromEmptyTable) { - TerminalPositionLookupTable lookupTable; - - EXPECT_EQ(NOT_A_DICT_POS, lookupTable.getTerminalPtNodePosition(0)); - EXPECT_EQ(NOT_A_DICT_POS, lookupTable.getTerminalPtNodePosition(-1)); - EXPECT_EQ(NOT_A_DICT_POS, lookupTable.getTerminalPtNodePosition( - Ver4DictConstants::NOT_A_TERMINAL_ID)); -} - -TEST(TerminalPositionLookupTableTest, TestSetAndGet) { - TerminalPositionLookupTable lookupTable; - - EXPECT_TRUE(lookupTable.setTerminalPtNodePosition(10, 100)); - EXPECT_EQ(100, lookupTable.getTerminalPtNodePosition(10)); - EXPECT_EQ(NOT_A_DICT_POS, lookupTable.getTerminalPtNodePosition(9)); - EXPECT_TRUE(lookupTable.setTerminalPtNodePosition(9, 200)); - EXPECT_EQ(200, lookupTable.getTerminalPtNodePosition(9)); - EXPECT_TRUE(lookupTable.setTerminalPtNodePosition(10, 300)); - EXPECT_EQ(300, lookupTable.getTerminalPtNodePosition(10)); - EXPECT_FALSE(lookupTable.setTerminalPtNodePosition(-1, 400)); - EXPECT_EQ(NOT_A_DICT_POS, lookupTable.getTerminalPtNodePosition(-1)); - EXPECT_FALSE(lookupTable.setTerminalPtNodePosition(Ver4DictConstants::NOT_A_TERMINAL_ID, 500)); - EXPECT_EQ(NOT_A_DICT_POS, lookupTable.getTerminalPtNodePosition( - Ver4DictConstants::NOT_A_TERMINAL_ID)); -} - -TEST(TerminalPositionLookupTableTest, TestGC) { - TerminalPositionLookupTable lookupTable; - - const std::vector terminalIds = { 10, 20, 30 }; - const std::vector terminalPositions = { 100, 200, 300 }; - - for (size_t i = 0; i < terminalIds.size(); ++i) { - EXPECT_TRUE(lookupTable.setTerminalPtNodePosition(terminalIds[i], terminalPositions[i])); - } - - TerminalPositionLookupTable::TerminalIdMap terminalIdMap; - EXPECT_TRUE(lookupTable.runGCTerminalIds(&terminalIdMap)); - - for (size_t i = 0; i < terminalIds.size(); ++i) { - EXPECT_EQ(static_cast(i), terminalIdMap[terminalIds[i]]) - << "Terminal id (" << terminalIds[i] << ") should be changed to " << i; - EXPECT_EQ(terminalPositions[i], lookupTable.getTerminalPtNodePosition(i)); - } -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/dictionary/utils/bloom_filter_test.cpp b/app/src/main/jni/tests/dictionary/utils/bloom_filter_test.cpp deleted file mode 100644 index bcc88438..00000000 --- a/app/src/main/jni/tests/dictionary/utils/bloom_filter_test.cpp +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "dictionary/utils/bloom_filter.h" - -#include - -#include -#include -#include -#include -#include -#include - -namespace latinime { -namespace { - -TEST(BloomFilterTest, TestFilter) { - static const int TEST_RANDOM_DATA_MAX = 65536; - static const int ELEMENT_COUNT = 1000; - std::vector elements; - - // Initialize data set with random integers. - { - // Use the uniform integer distribution [0, TEST_RANDOM_DATA_MAX]. - std::uniform_int_distribution distribution(0, TEST_RANDOM_DATA_MAX); - auto randomNumberGenerator = std::bind(distribution, std::mt19937()); - for (int i = 0; i < ELEMENT_COUNT; ++i) { - elements.push_back(randomNumberGenerator()); - } - } - - // Make sure BloomFilter contains nothing by default. - BloomFilter bloomFilter; - for (const int elem : elements) { - ASSERT_FALSE(bloomFilter.isInFilter(elem)); - } - - // Copy some of the test vector into bloom filter. - std::unordered_set elementsThatHaveBeenSetInFilter; - { - // Use the uniform integer distribution [0, 1]. - std::uniform_int_distribution distribution(0, 1); - auto randomBitGenerator = std::bind(distribution, std::mt19937()); - for (const int elem : elements) { - if (randomBitGenerator() == 0) { - bloomFilter.setInFilter(elem); - elementsThatHaveBeenSetInFilter.insert(elem); - } - } - } - - for (const int elem : elements) { - const bool existsInFilter = bloomFilter.isInFilter(elem); - const bool hasBeenSetInFilter = - elementsThatHaveBeenSetInFilter.find(elem) != elementsThatHaveBeenSetInFilter.end(); - if (hasBeenSetInFilter) { - EXPECT_TRUE(existsInFilter) << "elem: " << elem; - } - if (!existsInFilter) { - EXPECT_FALSE(hasBeenSetInFilter) << "elem: " << elem; - } - } -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/dictionary/utils/buffer_with_extendable_buffer_test.cpp b/app/src/main/jni/tests/dictionary/utils/buffer_with_extendable_buffer_test.cpp deleted file mode 100644 index 25878910..00000000 --- a/app/src/main/jni/tests/dictionary/utils/buffer_with_extendable_buffer_test.cpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "dictionary/utils/buffer_with_extendable_buffer.h" - -#include - -namespace latinime { -namespace { - -const int DEFAULT_MAX_BUFFER_SIZE = 1024; - -TEST(BufferWithExtendablebufferTest, TestWriteAndRead) { - BufferWithExtendableBuffer buffer(DEFAULT_MAX_BUFFER_SIZE); - int pos = 0; - // 1 byte - const uint32_t data_1 = 0xFF; - EXPECT_TRUE(buffer.writeUint(data_1, 1 /* size */, pos)); - EXPECT_EQ(data_1, buffer.readUint(1, pos)); - pos += 1; - // 2 byte - const uint32_t data_2 = 0xFFFF; - EXPECT_TRUE(buffer.writeUint(data_2, 2 /* size */, pos)); - EXPECT_EQ(data_2, buffer.readUint(2, pos)); - pos += 2; - // 3 byte - const uint32_t data_3 = 0xFFFFFF; - EXPECT_TRUE(buffer.writeUint(data_3, 3 /* size */, pos)); - EXPECT_EQ(data_3, buffer.readUint(3, pos)); - pos += 3; - // 4 byte - const uint32_t data_4 = 0xFFFFFFFF; - EXPECT_TRUE(buffer.writeUint(data_4, 4 /* size */, pos)); - EXPECT_EQ(data_4, buffer.readUint(4, pos)); -} - -TEST(BufferWithExtendablebufferTest, TestExtend) { - BufferWithExtendableBuffer buffer(DEFAULT_MAX_BUFFER_SIZE); - EXPECT_EQ(0, buffer.getTailPosition()); - EXPECT_TRUE(buffer.writeUint(0xFF /* data */, 4 /* size */, 0 /* pos */)); - EXPECT_EQ(4, buffer.getTailPosition()); - EXPECT_TRUE(buffer.extend(8 /* size */)); - EXPECT_EQ(12, buffer.getTailPosition()); - EXPECT_TRUE(buffer.writeUint(0xFFFF /* data */, 4 /* size */, 8 /* pos */)); - EXPECT_TRUE(buffer.writeUint(0xFF /* data */, 4 /* size */, 0 /* pos */)); -} - -TEST(BufferWithExtendablebufferTest, TestCopy) { - BufferWithExtendableBuffer buffer(DEFAULT_MAX_BUFFER_SIZE); - EXPECT_TRUE(buffer.writeUint(0xFF /* data */, 4 /* size */, 0 /* pos */)); - EXPECT_TRUE(buffer.writeUint(0xFFFF /* data */, 4 /* size */, 4 /* pos */)); - BufferWithExtendableBuffer targetBuffer(DEFAULT_MAX_BUFFER_SIZE); - EXPECT_TRUE(targetBuffer.copy(&buffer)); - EXPECT_EQ(0xFFu, targetBuffer.readUint(4 /* size */, 0 /* pos */)); - EXPECT_EQ(0xFFFFu, targetBuffer.readUint(4 /* size */, 4 /* pos */)); -} - -TEST(BufferWithExtendablebufferTest, TestSizeLimit) { - BufferWithExtendableBuffer emptyBuffer(0 /* maxAdditionalBufferSize */); - EXPECT_FALSE(emptyBuffer.writeUint(0 /* data */, 1 /* size */, 0 /* pos */)); - EXPECT_FALSE(emptyBuffer.extend(1 /* size */)); - - BufferWithExtendableBuffer smallBuffer(4 /* maxAdditionalBufferSize */); - EXPECT_TRUE(smallBuffer.writeUint(0 /* data */, 4 /* size */, 0 /* pos */)); - EXPECT_FALSE(smallBuffer.writeUint(0 /* data */, 1 /* size */, 4 /* pos */)); - - EXPECT_TRUE(smallBuffer.copy(&emptyBuffer)); - EXPECT_FALSE(emptyBuffer.copy(&smallBuffer)); - - BufferWithExtendableBuffer buffer(DEFAULT_MAX_BUFFER_SIZE); - EXPECT_FALSE(buffer.isNearSizeLimit()); - int pos = 0; - while (!buffer.isNearSizeLimit()) { - EXPECT_TRUE(buffer.writeUintAndAdvancePosition(0 /* data */, 4 /* size */, &pos)); - } - EXPECT_GT(pos, 0); - EXPECT_LE(pos, DEFAULT_MAX_BUFFER_SIZE); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/dictionary/utils/byte_array_utils_test.cpp b/app/src/main/jni/tests/dictionary/utils/byte_array_utils_test.cpp deleted file mode 100644 index 07257530..00000000 --- a/app/src/main/jni/tests/dictionary/utils/byte_array_utils_test.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "dictionary/utils/byte_array_utils.h" - -#include - -#include - -namespace latinime { -namespace { - -TEST(ByteArrayUtilsTest, TestReadCodePointTable) { - const int codePointTable[] = { 0x6f, 0x6b }; - const uint8_t buffer[] = { 0x20u, 0x21u, 0x00u, 0x01u, 0x00u }; - int pos = 0; - // Expect the first entry of codePointTable - EXPECT_EQ(0x6f, ByteArrayUtils::readCodePointAndAdvancePosition(buffer, codePointTable, &pos)); - // Expect the second entry of codePointTable - EXPECT_EQ(0x6b, ByteArrayUtils::readCodePointAndAdvancePosition(buffer, codePointTable, &pos)); - // Expect the original code point from buffer[2] to buffer[4], 0x100 - // It isn't picked from the codePointTable, since it exceeds the range of the codePointTable. - EXPECT_EQ(0x100, ByteArrayUtils::readCodePointAndAdvancePosition(buffer, codePointTable, &pos)); -} - -TEST(ByteArrayUtilsTest, TestReadInt) { - const uint8_t buffer[] = { 0x1u, 0x8Au, 0x0u, 0xAAu }; - - EXPECT_EQ(0x01u, ByteArrayUtils::readUint8(buffer, 0)); - EXPECT_EQ(0x8Au, ByteArrayUtils::readUint8(buffer, 1)); - EXPECT_EQ(0x0u, ByteArrayUtils::readUint8(buffer, 2)); - EXPECT_EQ(0xAAu, ByteArrayUtils::readUint8(buffer, 3)); - - EXPECT_EQ(0x018Au, ByteArrayUtils::readUint16(buffer, 0)); - EXPECT_EQ(0x8A00u, ByteArrayUtils::readUint16(buffer, 1)); - EXPECT_EQ(0xAAu, ByteArrayUtils::readUint16(buffer, 2)); - - EXPECT_EQ(0x18A00AAu, ByteArrayUtils::readUint32(buffer, 0)); - - int pos = 0; - EXPECT_EQ(0x18A00, ByteArrayUtils::readSint24AndAdvancePosition(buffer, &pos)); - pos = 1; - EXPECT_EQ(-0xA00AA, ByteArrayUtils::readSint24AndAdvancePosition(buffer, &pos)); -} - -TEST(ByteArrayUtilsTest, TestWriteAndReadInt) { - uint8_t buffer[4]; - - int pos = 0; - const uint8_t data_1B = 0xC8; - ByteArrayUtils::writeUintAndAdvancePosition(buffer, data_1B, 1, &pos); - EXPECT_EQ(data_1B, ByteArrayUtils::readUint(buffer, 1, 0)); - - pos = 0; - const uint32_t data_4B = 0xABCD1234; - ByteArrayUtils::writeUintAndAdvancePosition(buffer, data_4B, 4, &pos); - EXPECT_EQ(data_4B, ByteArrayUtils::readUint(buffer, 4, 0)); -} - -TEST(ByteArrayUtilsTest, TestReadCodePoint) { - const uint8_t buffer[] = { 0x10, 0xFF, 0x00u, 0x20u, 0x41u, 0x1Fu, 0x60 }; - - EXPECT_EQ(0x10FF00, ByteArrayUtils::readCodePoint(buffer, 0)); - EXPECT_EQ(0x20, ByteArrayUtils::readCodePoint(buffer, 3)); - EXPECT_EQ(0x41, ByteArrayUtils::readCodePoint(buffer, 4)); - EXPECT_EQ(NOT_A_CODE_POINT, ByteArrayUtils::readCodePoint(buffer, 5)); - - int pos = 0; - int codePointArray[3]; - EXPECT_EQ(3, ByteArrayUtils::readStringAndAdvancePosition(buffer, MAX_WORD_LENGTH, nullptr, - codePointArray, &pos)); - EXPECT_EQ(0x10FF00, codePointArray[0]); - EXPECT_EQ(0x20, codePointArray[1]); - EXPECT_EQ(0x41, codePointArray[2]); - EXPECT_EQ(0x60, ByteArrayUtils::readCodePoint(buffer, pos)); -} - -TEST(ByteArrayUtilsTest, TestWriteAndReadCodePoint) { - uint8_t buffer[10]; - - const int codePointArray[] = { 0x10FF00, 0x20, 0x41 }; - int pos = 0; - ByteArrayUtils::writeCodePointsAndAdvancePosition(buffer, codePointArray, 3, - true /* writesTerminator */, &pos); - EXPECT_EQ(0x10FF00, ByteArrayUtils::readCodePoint(buffer, 0)); - EXPECT_EQ(0x20, ByteArrayUtils::readCodePoint(buffer, 3)); - EXPECT_EQ(0x41, ByteArrayUtils::readCodePoint(buffer, 4)); - EXPECT_EQ(NOT_A_CODE_POINT, ByteArrayUtils::readCodePoint(buffer, 5)); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/dictionary/utils/format_utils_test.cpp b/app/src/main/jni/tests/dictionary/utils/format_utils_test.cpp deleted file mode 100644 index 3561bda3..00000000 --- a/app/src/main/jni/tests/dictionary/utils/format_utils_test.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "dictionary/utils/format_utils.h" - -#include - -#include - -#include "utils/byte_array_view.h" - -namespace latinime { -namespace { - -TEST(FormatUtilsTest, TestMagicNumber) { - EXPECT_EQ(0x9BC13AFE, FormatUtils::MAGIC_NUMBER) << "Magic number must not be changed."; -} - -const std::vector getBuffer(const int magicNumber, const int version, const uint16_t flags, - const size_t headerSize) { - std::vector buffer; - buffer.push_back(magicNumber >> 24); - buffer.push_back(magicNumber >> 16); - buffer.push_back(magicNumber >> 8); - buffer.push_back(magicNumber); - - buffer.push_back(version >> 8); - buffer.push_back(version); - - buffer.push_back(flags >> 8); - buffer.push_back(flags); - - buffer.push_back(headerSize >> 24); - buffer.push_back(headerSize >> 16); - buffer.push_back(headerSize >> 8); - buffer.push_back(headerSize); - return buffer; -} - -TEST(FormatUtilsTest, TestDetectFormatVersion) { - EXPECT_EQ(FormatUtils::UNKNOWN_VERSION, - FormatUtils::detectFormatVersion(ReadOnlyByteArrayView())); - - { - const std::vector buffer = - getBuffer(FormatUtils::MAGIC_NUMBER, FormatUtils::VERSION_2, 0, 0); - EXPECT_EQ(FormatUtils::VERSION_2, FormatUtils::detectFormatVersion( - ReadOnlyByteArrayView(buffer.data(), buffer.size()))); - } - { - const std::vector buffer = - getBuffer(FormatUtils::MAGIC_NUMBER, FormatUtils::VERSION_402, 0, 0); - EXPECT_EQ(FormatUtils::VERSION_402, FormatUtils::detectFormatVersion( - ReadOnlyByteArrayView(buffer.data(), buffer.size()))); - } - { - const std::vector buffer = - getBuffer(FormatUtils::MAGIC_NUMBER, FormatUtils::VERSION_403, 0, 0); - EXPECT_EQ(FormatUtils::VERSION_403, FormatUtils::detectFormatVersion( - ReadOnlyByteArrayView(buffer.data(), buffer.size()))); - } - - { - const std::vector buffer = - getBuffer(FormatUtils::MAGIC_NUMBER - 1, FormatUtils::VERSION_2, 0, 0); - EXPECT_EQ(FormatUtils::UNKNOWN_VERSION, FormatUtils::detectFormatVersion( - ReadOnlyByteArrayView(buffer.data(), buffer.size()))); - } - { - const std::vector buffer = - getBuffer(FormatUtils::MAGIC_NUMBER, 100, 0, 0); - EXPECT_EQ(FormatUtils::UNKNOWN_VERSION, FormatUtils::detectFormatVersion( - ReadOnlyByteArrayView(buffer.data(), buffer.size()))); - } - { - const std::vector buffer = - getBuffer(FormatUtils::MAGIC_NUMBER, FormatUtils::VERSION_2, 0, 0); - EXPECT_EQ(FormatUtils::UNKNOWN_VERSION, FormatUtils::detectFormatVersion( - ReadOnlyByteArrayView(buffer.data(), buffer.size() - 1))); - } -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/dictionary/utils/probability_utils_test.cpp b/app/src/main/jni/tests/dictionary/utils/probability_utils_test.cpp deleted file mode 100644 index 4020ea44..00000000 --- a/app/src/main/jni/tests/dictionary/utils/probability_utils_test.cpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "dictionary/utils/probability_utils.h" - -#include - -#include "defines.h" - -namespace latinime { -namespace { - -TEST(ProbabilityUtilsTest, TestEncodeRawProbability) { - EXPECT_EQ(MAX_PROBABILITY, ProbabilityUtils::encodeRawProbability(1.0f)); - EXPECT_EQ(MAX_PROBABILITY - 9, ProbabilityUtils::encodeRawProbability(0.5f)); - EXPECT_EQ(0, ProbabilityUtils::encodeRawProbability(0.0f)); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/dictionary/utils/sparse_table_test.cpp b/app/src/main/jni/tests/dictionary/utils/sparse_table_test.cpp deleted file mode 100644 index 237c9631..00000000 --- a/app/src/main/jni/tests/dictionary/utils/sparse_table_test.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "dictionary/utils/sparse_table.h" - -#include - -#include "dictionary/utils/buffer_with_extendable_buffer.h" - -namespace latinime { -namespace { - -TEST(SparseTableTest, TestSetAndGet) { - static const int BLOCK_SIZE = 64; - static const int DATA_SIZE = 4; - BufferWithExtendableBuffer indexTableBuffer( - BufferWithExtendableBuffer::DEFAULT_MAX_ADDITIONAL_BUFFER_SIZE); - BufferWithExtendableBuffer contentTableBuffer( - BufferWithExtendableBuffer::DEFAULT_MAX_ADDITIONAL_BUFFER_SIZE); - SparseTable sparseTable(&indexTableBuffer, &contentTableBuffer, BLOCK_SIZE, DATA_SIZE); - - EXPECT_FALSE(sparseTable.contains(10)); - EXPECT_TRUE(sparseTable.set(10, 100u)); - EXPECT_EQ(100u, sparseTable.get(10)); - EXPECT_TRUE(sparseTable.contains(10)); - EXPECT_TRUE(sparseTable.contains(BLOCK_SIZE - 1)); - EXPECT_FALSE(sparseTable.contains(BLOCK_SIZE)); - EXPECT_TRUE(sparseTable.set(11, 101u)); - EXPECT_EQ(100u, sparseTable.get(10)); - EXPECT_EQ(101u, sparseTable.get(11)); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/dictionary/utils/trie_map_test.cpp b/app/src/main/jni/tests/dictionary/utils/trie_map_test.cpp deleted file mode 100644 index 8f3ec9d2..00000000 --- a/app/src/main/jni/tests/dictionary/utils/trie_map_test.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "dictionary/utils/trie_map.h" - -#include - -#include -#include -#include -#include -#include -#include - -namespace latinime { -namespace { - -TEST(TrieMapTest, TestSetAndGet) { - TrieMap trieMap; - trieMap.putRoot(10, 10); - EXPECT_EQ(10ull, trieMap.getRoot(10).mValue); - trieMap.putRoot(0x10A, 10); - EXPECT_EQ(10ull, trieMap.getRoot(10).mValue); - EXPECT_EQ(10ull, trieMap.getRoot(0x10A).mValue); - trieMap.putRoot(10, 1000); - EXPECT_EQ(1000ull, trieMap.getRoot(10).mValue); - trieMap.putRoot(11, 1000); - EXPECT_EQ(1000ull, trieMap.getRoot(11).mValue); - const int next = trieMap.getNextLevelBitmapEntryIndex(10); - EXPECT_EQ(1000ull, trieMap.getRoot(10).mValue); - trieMap.put(9, 9, next); - EXPECT_EQ(9ull, trieMap.get(9, next).mValue); - EXPECT_FALSE(trieMap.get(11, next).mIsValid); - trieMap.putRoot(0, 0xFFFFFFFFFull); - EXPECT_EQ(0xFFFFFFFFFull, trieMap.getRoot(0).mValue); -} - -TEST(TrieMapTest, TestRemove) { - TrieMap trieMap; - trieMap.putRoot(10, 10); - EXPECT_EQ(10ull, trieMap.getRoot(10).mValue); - EXPECT_TRUE(trieMap.remove(10, trieMap.getRootBitmapEntryIndex())); - EXPECT_FALSE(trieMap.getRoot(10).mIsValid); - for (const auto &element : trieMap.getEntriesInRootLevel()) { - (void)element; // not used - EXPECT_TRUE(false); - } - EXPECT_TRUE(trieMap.putRoot(10, 0x3FFFFF)); - EXPECT_FALSE(trieMap.remove(11, trieMap.getRootBitmapEntryIndex())) - << "Should fail if the key does not exist."; - EXPECT_EQ(0x3FFFFFull, trieMap.getRoot(10).mValue); - trieMap.putRoot(12, 11); - const int nextLevel = trieMap.getNextLevelBitmapEntryIndex(10); - trieMap.put(10, 10, nextLevel); - EXPECT_EQ(0x3FFFFFull, trieMap.getRoot(10).mValue); - EXPECT_EQ(10ull, trieMap.get(10, nextLevel).mValue); - EXPECT_TRUE(trieMap.remove(10, trieMap.getRootBitmapEntryIndex())); - const TrieMap::Result result = trieMap.getRoot(10); - EXPECT_FALSE(result.mIsValid); - EXPECT_EQ(TrieMap::INVALID_INDEX, result.mNextLevelBitmapEntryIndex); - EXPECT_EQ(11ull, trieMap.getRoot(12).mValue); - EXPECT_TRUE(trieMap.putRoot(S_INT_MAX, 0xFFFFFFFFFull)); - EXPECT_TRUE(trieMap.remove(S_INT_MAX, trieMap.getRootBitmapEntryIndex())); -} - -TEST(TrieMapTest, TestSetAndGetLarge) { - static const int ELEMENT_COUNT = 200000; - TrieMap trieMap; - for (int i = 0; i < ELEMENT_COUNT; ++i) { - EXPECT_TRUE(trieMap.putRoot(i, i)); - } - for (int i = 0; i < ELEMENT_COUNT; ++i) { - EXPECT_EQ(static_cast(i), trieMap.getRoot(i).mValue); - } -} - -TEST(TrieMapTest, TestRandSetAndGetLarge) { - static const int ELEMENT_COUNT = 100000; - TrieMap trieMap; - std::unordered_map testKeyValuePairs; - - // Use the uniform integer distribution [S_INT_MIN, S_INT_MAX]. - std::uniform_int_distribution keyDistribution(S_INT_MIN, S_INT_MAX); - auto keyRandomNumberGenerator = std::bind(keyDistribution, std::mt19937()); - - // Use the uniform distribution [0, TrieMap::MAX_VALUE]. - std::uniform_int_distribution valueDistribution(0, TrieMap::MAX_VALUE); - auto valueRandomNumberGenerator = std::bind(valueDistribution, std::mt19937()); - - for (int i = 0; i < ELEMENT_COUNT; ++i) { - const int key = keyRandomNumberGenerator(); - const uint64_t value = valueRandomNumberGenerator(); - EXPECT_TRUE(trieMap.putRoot(key, value)) << key << " " << value; - testKeyValuePairs[key] = value; - } - for (const auto &v : testKeyValuePairs) { - EXPECT_EQ(v.second, trieMap.getRoot(v.first).mValue); - } -} - -TEST(TrieMapTest, TestMultiLevel) { - static const int FIRST_LEVEL_ENTRY_COUNT = 10000; - static const int SECOND_LEVEL_ENTRY_COUNT = 20000; - static const int THIRD_LEVEL_ENTRY_COUNT = 40000; - - TrieMap trieMap; - std::vector firstLevelKeys; - std::map firstLevelEntries; - std::vector> secondLevelKeys; - std::map> twoLevelMap; - std::map>> threeLevelMap; - - // Use the uniform integer distribution [0, S_INT_MAX]. - std::uniform_int_distribution distribution(0, S_INT_MAX); - auto keyRandomNumberGenerator = std::bind(distribution, std::mt19937()); - auto randomNumberGeneratorForKeySelection = std::bind(distribution, std::mt19937()); - - // Use the uniform distribution [0, TrieMap::MAX_VALUE]. - std::uniform_int_distribution valueDistribution(0, TrieMap::MAX_VALUE); - auto valueRandomNumberGenerator = std::bind(valueDistribution, std::mt19937()); - - for (int i = 0; i < FIRST_LEVEL_ENTRY_COUNT; ++i) { - const int key = keyRandomNumberGenerator(); - const uint64_t value = valueRandomNumberGenerator(); - EXPECT_TRUE(trieMap.putRoot(key, value)); - firstLevelKeys.push_back(key); - firstLevelEntries[key] = value; - } - - for (int i = 0; i < SECOND_LEVEL_ENTRY_COUNT; ++i) { - const int key = keyRandomNumberGenerator(); - const uint64_t value = valueRandomNumberGenerator(); - const int firstLevelKey = - firstLevelKeys[randomNumberGeneratorForKeySelection() % FIRST_LEVEL_ENTRY_COUNT]; - const int nextLevelBitmapEntryIndex = trieMap.getNextLevelBitmapEntryIndex(firstLevelKey); - EXPECT_NE(TrieMap::INVALID_INDEX, nextLevelBitmapEntryIndex); - EXPECT_TRUE(trieMap.put(key, value, nextLevelBitmapEntryIndex)); - secondLevelKeys.push_back(std::make_pair(firstLevelKey, key)); - twoLevelMap[firstLevelKey][key] = value; - } - - for (int i = 0; i < THIRD_LEVEL_ENTRY_COUNT; ++i) { - const int key = keyRandomNumberGenerator(); - const uint64_t value = valueRandomNumberGenerator(); - const std::pair secondLevelKey = - secondLevelKeys[randomNumberGeneratorForKeySelection() % SECOND_LEVEL_ENTRY_COUNT]; - const int secondLevel = trieMap.getNextLevelBitmapEntryIndex(secondLevelKey.first); - EXPECT_NE(TrieMap::INVALID_INDEX, secondLevel); - const int thirdLevel = trieMap.getNextLevelBitmapEntryIndex( - secondLevelKey.second, secondLevel); - EXPECT_NE(TrieMap::INVALID_INDEX, thirdLevel); - EXPECT_TRUE(trieMap.put(key, value, thirdLevel)); - threeLevelMap[secondLevelKey.first][secondLevelKey.second][key] = value; - } - - for (const auto &firstLevelEntry : firstLevelEntries) { - EXPECT_EQ(firstLevelEntry.second, trieMap.getRoot(firstLevelEntry.first).mValue); - } - - for (const auto &firstLevelEntry : twoLevelMap) { - const int secondLevel = trieMap.getNextLevelBitmapEntryIndex(firstLevelEntry.first); - EXPECT_NE(TrieMap::INVALID_INDEX, secondLevel); - for (const auto &secondLevelEntry : firstLevelEntry.second) { - EXPECT_EQ(secondLevelEntry.second, - trieMap.get(secondLevelEntry.first, secondLevel).mValue); - } - } - - for (const auto &firstLevelEntry : threeLevelMap) { - const int secondLevel = trieMap.getNextLevelBitmapEntryIndex(firstLevelEntry.first); - EXPECT_NE(TrieMap::INVALID_INDEX, secondLevel); - for (const auto &secondLevelEntry : firstLevelEntry.second) { - const int thirdLevel = - trieMap.getNextLevelBitmapEntryIndex(secondLevelEntry.first, secondLevel); - EXPECT_NE(TrieMap::INVALID_INDEX, thirdLevel); - for (const auto &thirdLevelEntry : secondLevelEntry.second) { - EXPECT_EQ(thirdLevelEntry.second, - trieMap.get(thirdLevelEntry.first, thirdLevel).mValue); - } - } - } - - // Iteration - for (const auto &firstLevelEntry : trieMap.getEntriesInRootLevel()) { - EXPECT_EQ(trieMap.getRoot(firstLevelEntry.key()).mValue, firstLevelEntry.value()); - EXPECT_EQ(firstLevelEntries[firstLevelEntry.key()], firstLevelEntry.value()); - firstLevelEntries.erase(firstLevelEntry.key()); - for (const auto &secondLevelEntry : firstLevelEntry.getEntriesInNextLevel()) { - EXPECT_EQ(twoLevelMap[firstLevelEntry.key()][secondLevelEntry.key()], - secondLevelEntry.value()); - twoLevelMap[firstLevelEntry.key()].erase(secondLevelEntry.key()); - for (const auto &thirdLevelEntry : secondLevelEntry.getEntriesInNextLevel()) { - EXPECT_EQ(threeLevelMap[firstLevelEntry.key()][secondLevelEntry.key()] - [thirdLevelEntry.key()], thirdLevelEntry.value()); - threeLevelMap[firstLevelEntry.key()][secondLevelEntry.key()].erase( - thirdLevelEntry.key()); - } - } - } - - // Ensure all entries have been traversed. - EXPECT_TRUE(firstLevelEntries.empty()); - for (const auto &secondLevelEntry : twoLevelMap) { - EXPECT_TRUE(secondLevelEntry.second.empty()); - } - for (const auto &secondLevelEntry : threeLevelMap) { - for (const auto &thirdLevelEntry : secondLevelEntry.second) { - EXPECT_TRUE(thirdLevelEntry.second.empty()); - } - } -} - -TEST(TrieMapTest, TestIteration) { - static const int ELEMENT_COUNT = 200000; - TrieMap trieMap; - std::unordered_map testKeyValuePairs; - - // Use the uniform integer distribution [S_INT_MIN, S_INT_MAX]. - std::uniform_int_distribution keyDistribution(S_INT_MIN, S_INT_MAX); - auto keyRandomNumberGenerator = std::bind(keyDistribution, std::mt19937()); - - // Use the uniform distribution [0, TrieMap::MAX_VALUE]. - std::uniform_int_distribution valueDistribution(0, TrieMap::MAX_VALUE); - auto valueRandomNumberGenerator = std::bind(valueDistribution, std::mt19937()); - for (int i = 0; i < ELEMENT_COUNT; ++i) { - const int key = keyRandomNumberGenerator(); - const uint64_t value = valueRandomNumberGenerator(); - EXPECT_TRUE(trieMap.putRoot(key, value)); - testKeyValuePairs[key] = value; - } - for (const auto &entry : trieMap.getEntriesInRootLevel()) { - EXPECT_EQ(trieMap.getRoot(entry.key()).mValue, entry.value()); - EXPECT_EQ(testKeyValuePairs[entry.key()], entry.value()); - testKeyValuePairs.erase(entry.key()); - } - EXPECT_TRUE(testKeyValuePairs.empty()); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/suggest/core/dicnode/dic_node_pool_test.cpp b/app/src/main/jni/tests/suggest/core/dicnode/dic_node_pool_test.cpp deleted file mode 100644 index 854efdfe..00000000 --- a/app/src/main/jni/tests/suggest/core/dicnode/dic_node_pool_test.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "suggest/core/dicnode/dic_node_pool.h" - -#include - -namespace latinime { -namespace { - -TEST(DicNodePoolTest, TestGet) { - static const int CAPACITY = 10; - DicNodePool dicNodePool(CAPACITY); - - for (int i = 0; i < CAPACITY; ++i) { - EXPECT_NE(nullptr, dicNodePool.getInstance()); - } - EXPECT_EQ(nullptr, dicNodePool.getInstance()); -} - -TEST(DicNodePoolTest, TestPlaceBack) { - static const int CAPACITY = 1; - DicNodePool dicNodePool(CAPACITY); - - DicNode *const dicNode = dicNodePool.getInstance(); - EXPECT_NE(nullptr, dicNode); - EXPECT_EQ(nullptr, dicNodePool.getInstance()); - dicNodePool.placeBackInstance(dicNode); - EXPECT_EQ(dicNode, dicNodePool.getInstance()); -} - -TEST(DicNodePoolTest, TestReset) { - static const int CAPACITY_SMALL = 2; - static const int CAPACITY_LARGE = 10; - DicNodePool dicNodePool(CAPACITY_SMALL); - - for (int i = 0; i < CAPACITY_SMALL; ++i) { - EXPECT_NE(nullptr, dicNodePool.getInstance()); - } - EXPECT_EQ(nullptr, dicNodePool.getInstance()); - - dicNodePool.reset(CAPACITY_LARGE); - for (int i = 0; i < CAPACITY_LARGE; ++i) { - EXPECT_NE(nullptr, dicNodePool.getInstance()); - } - EXPECT_EQ(nullptr, dicNodePool.getInstance()); - - dicNodePool.reset(CAPACITY_SMALL); - for (int i = 0; i < CAPACITY_SMALL; ++i) { - EXPECT_NE(nullptr, dicNodePool.getInstance()); - } - EXPECT_EQ(nullptr, dicNodePool.getInstance()); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/suggest/core/layout/geometry_utils_test.cpp b/app/src/main/jni/tests/suggest/core/layout/geometry_utils_test.cpp deleted file mode 100644 index f5f89ede..00000000 --- a/app/src/main/jni/tests/suggest/core/layout/geometry_utils_test.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "suggest/core/layout/geometry_utils.h" - -#include - -namespace latinime { -namespace { - -::testing::AssertionResult ExpectAngleDiffEq(const char* expectedExpression, - const char* actualExpression, float expected, float actual) { - if (actual < 0.0f || M_PI_F < actual) { - return ::testing::AssertionFailure() - << "Must be in the range of [0.0f, M_PI_F]." - << " expected: " << expected - << " actual: " << actual; - } - return ::testing::internal::CmpHelperFloatingPointEQ( - expectedExpression, actualExpression, expected, actual); -} - -#define EXPECT_ANGLE_DIFF_EQ(expected, actual) \ - EXPECT_PRED_FORMAT2(ExpectAngleDiffEq, expected, actual); - -TEST(GeometryUtilsTest, testSquareFloat) { - const float test_data[] = { 0.0f, 1.0f, 123.456f, -1.0f, -9876.54321f }; - for (const float value : test_data) { - EXPECT_FLOAT_EQ(value * value, GeometryUtils::SQUARE_FLOAT(value)); - } -} - -TEST(GeometryUtilsTest, testGetAngle) { - EXPECT_FLOAT_EQ(0.0f, GeometryUtils::getAngle(0, 0, 0, 0)); - EXPECT_FLOAT_EQ(0.0f, GeometryUtils::getAngle(100, -10, 100, -10)); - - EXPECT_FLOAT_EQ(M_PI_F / 4.0f, GeometryUtils::getAngle(1, 1, 0, 0)); - EXPECT_FLOAT_EQ(M_PI_F, GeometryUtils::getAngle(-1, 0, 0, 0)); - - EXPECT_FLOAT_EQ(GeometryUtils::getAngle(0, 0, -1, 0), GeometryUtils::getAngle(1, 0, 0, 0)); - EXPECT_FLOAT_EQ(GeometryUtils::getAngle(1, 2, 3, 4), - GeometryUtils::getAngle(100, 200, 300, 400)); -} - -TEST(GeometryUtilsTest, testGetAngleDiff) { - EXPECT_ANGLE_DIFF_EQ(0.0f, GeometryUtils::getAngleDiff(0.0f, 0.0f)); - EXPECT_ANGLE_DIFF_EQ(0.0f, GeometryUtils::getAngleDiff(10000.0f, 10000.0f)); - EXPECT_ANGLE_DIFF_EQ(ROUND_FLOAT_10000(M_PI_F), - GeometryUtils::getAngleDiff(0.0f, M_PI_F)); - EXPECT_ANGLE_DIFF_EQ(ROUND_FLOAT_10000(M_PI_F / 6.0f), - GeometryUtils::getAngleDiff(M_PI_F / 3.0f, M_PI_F / 2.0f)); - EXPECT_ANGLE_DIFF_EQ(ROUND_FLOAT_10000(M_PI_F / 2.0f), - GeometryUtils::getAngleDiff(0.0f, M_PI_F * 1.5f)); - EXPECT_ANGLE_DIFF_EQ(0.0f, GeometryUtils::getAngleDiff(0.0f, M_PI_F * 1024.0f)); - EXPECT_ANGLE_DIFF_EQ(0.0f, GeometryUtils::getAngleDiff(-M_PI_F, M_PI_F)); -} - -TEST(GeometryUtilsTest, testGetDistanceInt) { - EXPECT_EQ(0, GeometryUtils::getDistanceInt(0, 0, 0, 0)); - EXPECT_EQ(0, GeometryUtils::getAngle(100, -10, 100, -10)); - - EXPECT_EQ(5, GeometryUtils::getDistanceInt(0, 0, 5, 0)); - EXPECT_EQ(5, GeometryUtils::getDistanceInt(0, 0, 3, 4)); - EXPECT_EQ(5, GeometryUtils::getDistanceInt(0, -4, 3, 0)); - EXPECT_EQ(5, GeometryUtils::getDistanceInt(0, 0, -3, -4)); - EXPECT_EQ(500, GeometryUtils::getDistanceInt(0, 0, 300, -400)); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/suggest/core/layout/normal_distribution_2d_test.cpp b/app/src/main/jni/tests/suggest/core/layout/normal_distribution_2d_test.cpp deleted file mode 100644 index 1d6a27c4..00000000 --- a/app/src/main/jni/tests/suggest/core/layout/normal_distribution_2d_test.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "suggest/core/layout/normal_distribution_2d.h" - -#include - -#include - -namespace latinime { -namespace { - -static const float ORIGIN_X = 0.0f; -static const float ORIGIN_Y = 0.0f; -static const float LARGE_STANDARD_DEVIATION = 100.0f; -static const float SMALL_STANDARD_DEVIATION = 10.0f; -static const float ZERO_RADIAN = 0.0f; - -TEST(NormalDistribution2DTest, ProbabilityDensity) { - const NormalDistribution2D distribution(ORIGIN_X, LARGE_STANDARD_DEVIATION, ORIGIN_Y, - SMALL_STANDARD_DEVIATION, ZERO_RADIAN); - - static const float SMALL_COORDINATE = 10.0f; - static const float LARGE_COORDINATE = 20.0f; - // The probability density of the point near the distribution center is larger than the - // probability density of the point that is far from distribution center. - EXPECT_GE(distribution.getProbabilityDensity(SMALL_COORDINATE, SMALL_COORDINATE), - distribution.getProbabilityDensity(LARGE_COORDINATE, LARGE_COORDINATE)); - // The probability density of the point shifted toward the direction that has larger standard - // deviation is larger than the probability density of the point shifted towards another - // direction. - EXPECT_GE(distribution.getProbabilityDensity(LARGE_COORDINATE, SMALL_COORDINATE), - distribution.getProbabilityDensity(SMALL_COORDINATE, LARGE_COORDINATE)); -} - -TEST(NormalDistribution2DTest, Rotate) { - static const float COORDINATES[] = {0.0f, 10.0f, 100.0f, -20.0f}; - static const float EPSILON = 0.01f; - const NormalDistribution2D distribution(ORIGIN_X, LARGE_STANDARD_DEVIATION, ORIGIN_Y, - SMALL_STANDARD_DEVIATION, ZERO_RADIAN); - const NormalDistribution2D rotatedDistribution(ORIGIN_X, LARGE_STANDARD_DEVIATION, ORIGIN_Y, - SMALL_STANDARD_DEVIATION, M_PI_4); - for (const float x : COORDINATES) { - for (const float y : COORDINATES) { - // The probability density of the rotated distribution at the point and the probability - // density of the original distribution at the rotated point are the same. - const float probabilityDensity0 = distribution.getProbabilityDensity(x, y); - const float probabilityDensity1 = rotatedDistribution.getProbabilityDensity(-y, x); - EXPECT_NEAR(probabilityDensity0, probabilityDensity1, EPSILON); - } - } -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy_test.cpp b/app/src/main/jni/tests/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy_test.cpp deleted file mode 100644 index d1341796..00000000 --- a/app/src/main/jni/tests/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy_test.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy.h" - -#include - -#include - -#include "suggest/policyimpl/utils/edit_distance.h" -#include "utils/int_array_view.h" - -namespace latinime { -namespace { - -TEST(DamerauLevenshteinEditDistancePolicyTest, TestConstructPolicy) { - const std::vector codePoints0 = { 0x20, 0x40, 0x60 }; - const std::vector codePoints1 = { 0x10, 0x20, 0x30, 0x40, 0x50, 0x60 }; - DamerauLevenshteinEditDistancePolicy policy(codePoints0.data(), codePoints0.size(), - codePoints1.data(), codePoints1.size()); - - EXPECT_EQ(static_cast(codePoints0.size()), policy.getString0Length()); - EXPECT_EQ(static_cast(codePoints1.size()), policy.getString1Length()); -} - -float getEditDistance(const std::vector &codePoints0, const std::vector &codePoints1) { - DamerauLevenshteinEditDistancePolicy policy(codePoints0.data(), codePoints0.size(), - codePoints1.data(), codePoints1.size()); - return EditDistance::getEditDistance(&policy); -} - -TEST(DamerauLevenshteinEditDistancePolicyTest, TestEditDistance) { - EXPECT_FLOAT_EQ(0.0f, getEditDistance({}, {})); - EXPECT_FLOAT_EQ(0.0f, getEditDistance({ 1 }, { 1 })); - EXPECT_FLOAT_EQ(0.0f, getEditDistance({ 1, 2, 3 }, { 1, 2, 3 })); - - EXPECT_FLOAT_EQ(1.0f, getEditDistance({ 1 }, { })); - EXPECT_FLOAT_EQ(1.0f, getEditDistance({}, { 100 })); - EXPECT_FLOAT_EQ(5.0f, getEditDistance({}, { 1, 2, 3, 4, 5 })); - - EXPECT_FLOAT_EQ(1.0f, getEditDistance({ 0 }, { 100 })); - EXPECT_FLOAT_EQ(5.0f, getEditDistance({ 1, 2, 3, 4, 5 }, { 11, 12, 13, 14, 15 })); - - EXPECT_FLOAT_EQ(1.0f, getEditDistance({ 1 }, { 1, 2 })); - EXPECT_FLOAT_EQ(2.0f, getEditDistance({ 1, 2 }, { 0, 1, 2, 3 })); - EXPECT_FLOAT_EQ(2.0f, getEditDistance({ 0, 1, 2, 3 }, { 1, 2 })); - - EXPECT_FLOAT_EQ(1.0f, getEditDistance({ 1, 2 }, { 2, 1 })); - EXPECT_FLOAT_EQ(2.0f, getEditDistance({ 1, 2, 3, 4 }, { 2, 1, 4, 3 })); -} -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/utils/autocorrection_threshold_utils_test.cpp b/app/src/main/jni/tests/utils/autocorrection_threshold_utils_test.cpp deleted file mode 100644 index cc8db700..00000000 --- a/app/src/main/jni/tests/utils/autocorrection_threshold_utils_test.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "utils/autocorrection_threshold_utils.h" - -#include - -#include - -namespace latinime { -namespace { - -int CalcEditDistance(const std::vector &before, - const std::vector &after) { - return AutocorrectionThresholdUtils::editDistance( - &before[0], before.size(), &after[0], after.size()); -} - -TEST(AutocorrectionThresholdUtilsTest, SameData) { - EXPECT_EQ(0, CalcEditDistance({1}, {1})); - EXPECT_EQ(0, CalcEditDistance({2, 2}, {2, 2})); - EXPECT_EQ(0, CalcEditDistance({3, 3, 3}, {3, 3, 3})); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/utils/char_utils_test.cpp b/app/src/main/jni/tests/utils/char_utils_test.cpp deleted file mode 100644 index 01d53404..00000000 --- a/app/src/main/jni/tests/utils/char_utils_test.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "utils/char_utils.h" - -#include - -#include "defines.h" - -namespace latinime { -namespace { - -TEST(CharUtilsTest, TestIsAsciiUpper) { - EXPECT_TRUE(CharUtils::isAsciiUpper('A')); - EXPECT_TRUE(CharUtils::isAsciiUpper('Z')); - EXPECT_FALSE(CharUtils::isAsciiUpper('a')); - EXPECT_FALSE(CharUtils::isAsciiUpper('z')); - EXPECT_FALSE(CharUtils::isAsciiUpper('@')); - EXPECT_FALSE(CharUtils::isAsciiUpper(' ')); - EXPECT_FALSE(CharUtils::isAsciiUpper(0x00C0 /* LATIN CAPITAL LETTER A WITH GRAVE */)); - EXPECT_FALSE(CharUtils::isAsciiUpper(0x00E0 /* LATIN SMALL LETTER A WITH GRAVE */)); - EXPECT_FALSE(CharUtils::isAsciiUpper(0x03C2 /* GREEK SMALL LETTER FINAL SIGMA */)); - EXPECT_FALSE(CharUtils::isAsciiUpper(0x0410 /* CYRILLIC CAPITAL LETTER A */)); - EXPECT_FALSE(CharUtils::isAsciiUpper(0x0430 /* CYRILLIC SMALL LETTER A */)); - EXPECT_FALSE(CharUtils::isAsciiUpper(0x3042 /* HIRAGANA LETTER A */)); - EXPECT_FALSE(CharUtils::isAsciiUpper(0x1F36A /* COOKIE */)); -} - -TEST(CharUtilsTest, TestToLowerCase) { - EXPECT_EQ('a', CharUtils::toLowerCase('A')); - EXPECT_EQ('z', CharUtils::toLowerCase('Z')); - EXPECT_EQ('a', CharUtils::toLowerCase('a')); - EXPECT_EQ('z', CharUtils::toLowerCase('z')); - EXPECT_EQ('@', CharUtils::toLowerCase('@')); - EXPECT_EQ(' ', CharUtils::toLowerCase(' ')); - EXPECT_EQ(0x00E0 /* LATIN SMALL LETTER A WITH GRAVE */, - CharUtils::toLowerCase(0x00C0 /* LATIN CAPITAL LETTER A WITH GRAVE */)); - EXPECT_EQ(0x00E0 /* LATIN SMALL LETTER A WITH GRAVE */, - CharUtils::toLowerCase(0x00E0 /* LATIN SMALL LETTER A WITH GRAVE */)); - EXPECT_EQ(0x03C2 /* GREEK SMALL LETTER FINAL SIGMA */, - CharUtils::toLowerCase(0x03C2 /* GREEK SMALL LETTER FINAL SIGMA */)); - EXPECT_EQ(0x0430 /* CYRILLIC SMALL LETTER A */, - CharUtils::toLowerCase(0x0410 /* CYRILLIC CAPITAL LETTER A */)); - EXPECT_EQ(0x0430 /* CYRILLIC SMALL LETTER A */, - CharUtils::toLowerCase(0x0430 /* CYRILLIC SMALL LETTER A */)); - EXPECT_EQ(0x3042 /* HIRAGANA LETTER A */, - CharUtils::toLowerCase(0x3042 /* HIRAGANA LETTER A */)); - EXPECT_EQ(0x1F36A /* COOKIE */, CharUtils::toLowerCase(0x1F36A /* COOKIE */)); -} - -TEST(CharUtilsTest, TestToBaseLowerCase) { - EXPECT_EQ('a', CharUtils::toBaseLowerCase('A')); - EXPECT_EQ('z', CharUtils::toBaseLowerCase('Z')); - EXPECT_EQ('a', CharUtils::toBaseLowerCase('a')); - EXPECT_EQ('z', CharUtils::toBaseLowerCase('z')); - EXPECT_EQ('@', CharUtils::toBaseLowerCase('@')); - EXPECT_EQ(' ', CharUtils::toBaseLowerCase(' ')); - EXPECT_EQ('a', CharUtils::toBaseLowerCase(0x00C0 /* LATIN CAPITAL LETTER A WITH GRAVE */)); - EXPECT_EQ('a', CharUtils::toBaseLowerCase(0x00E0 /* LATIN SMALL LETTER A WITH GRAVE */)); - EXPECT_EQ(0x03C2 /* GREEK SMALL LETTER FINAL SIGMA */, - CharUtils::toBaseLowerCase(0x03C2 /* GREEK SMALL LETTER FINAL SIGMA */)); - EXPECT_EQ(0x0430 /* CYRILLIC SMALL LETTER A */, - CharUtils::toBaseLowerCase(0x0410 /* CYRILLIC CAPITAL LETTER A */)); - EXPECT_EQ(0x0430 /* CYRILLIC SMALL LETTER A */, - CharUtils::toBaseLowerCase(0x0430 /* CYRILLIC SMALL LETTER A */)); - EXPECT_EQ(0x3042 /* HIRAGANA LETTER A */, - CharUtils::toBaseLowerCase(0x3042 /* HIRAGANA LETTER A */)); - EXPECT_EQ(0x1F36A /* COOKIE */, CharUtils::toBaseLowerCase(0x1F36A /* COOKIE */)); -} - -TEST(CharUtilsTest, TestToBaseCodePoint) { - EXPECT_EQ('A', CharUtils::toBaseCodePoint('A')); - EXPECT_EQ('Z', CharUtils::toBaseCodePoint('Z')); - EXPECT_EQ('a', CharUtils::toBaseCodePoint('a')); - EXPECT_EQ('z', CharUtils::toBaseCodePoint('z')); - EXPECT_EQ('@', CharUtils::toBaseCodePoint('@')); - EXPECT_EQ(' ', CharUtils::toBaseCodePoint(' ')); - EXPECT_EQ('A', CharUtils::toBaseCodePoint(0x00C0 /* LATIN CAPITAL LETTER A WITH GRAVE */)); - EXPECT_EQ('a', CharUtils::toBaseCodePoint(0x00E0 /* LATIN SMALL LETTER A WITH GRAVE */)); - EXPECT_EQ(0x03C2 /* GREEK SMALL LETTER FINAL SIGMA */, - CharUtils::toBaseLowerCase(0x03C2 /* GREEK SMALL LETTER FINAL SIGMA */)); - EXPECT_EQ(0x0410 /* CYRILLIC CAPITAL LETTER A */, - CharUtils::toBaseCodePoint(0x0410 /* CYRILLIC CAPITAL LETTER A */)); - EXPECT_EQ(0x0430 /* CYRILLIC SMALL LETTER A */, - CharUtils::toBaseCodePoint(0x0430 /* CYRILLIC SMALL LETTER A */)); - EXPECT_EQ(0x3042 /* HIRAGANA LETTER A */, - CharUtils::toBaseCodePoint(0x3042 /* HIRAGANA LETTER A */)); - EXPECT_EQ(0x1F36A /* COOKIE */, CharUtils::toBaseCodePoint(0x1F36A /* COOKIE */)); -} - -TEST(CharUtilsTest, TestIsIntentionalOmissionCodePoint) { - EXPECT_TRUE(CharUtils::isIntentionalOmissionCodePoint('\'')); - EXPECT_TRUE(CharUtils::isIntentionalOmissionCodePoint('-')); - EXPECT_FALSE(CharUtils::isIntentionalOmissionCodePoint('a')); - EXPECT_FALSE(CharUtils::isIntentionalOmissionCodePoint('?')); - EXPECT_FALSE(CharUtils::isIntentionalOmissionCodePoint('/')); -} - -TEST(CharUtilsTest, TestIsInUnicodeSpace) { - EXPECT_FALSE(CharUtils::isInUnicodeSpace(NOT_A_CODE_POINT)); - EXPECT_FALSE(CharUtils::isInUnicodeSpace(CODE_POINT_BEGINNING_OF_SENTENCE)); - EXPECT_TRUE(CharUtils::isInUnicodeSpace('a')); - EXPECT_TRUE(CharUtils::isInUnicodeSpace(0x0410 /* CYRILLIC CAPITAL LETTER A */)); - EXPECT_TRUE(CharUtils::isInUnicodeSpace(0x3042 /* HIRAGANA LETTER A */)); - EXPECT_TRUE(CharUtils::isInUnicodeSpace(0x1F36A /* COOKIE */)); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/utils/int_array_view_test.cpp b/app/src/main/jni/tests/utils/int_array_view_test.cpp deleted file mode 100644 index 2fce633f..00000000 --- a/app/src/main/jni/tests/utils/int_array_view_test.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "utils/int_array_view.h" - -#include - -#include -#include - -namespace latinime { -namespace { - -TEST(IntArrayViewTest, TestAccess) { - const std::vector intVector = {3, 2, 1, 0, -1, -2}; - IntArrayView intArrayView(intVector); - EXPECT_EQ(intVector.size(), intArrayView.size()); - for (int i = 0; i < static_cast(intVector.size()); ++i) { - EXPECT_EQ(intVector[i], intArrayView[i]); - } -} - -TEST(IntArrayViewTest, TestIteration) { - const std::vector intVector = {3, 2, 1, 0, -1, -2}; - IntArrayView intArrayView(intVector); - size_t expectedIndex = 0; - for (const int element : intArrayView) { - EXPECT_EQ(intVector[expectedIndex], element); - ++expectedIndex; - } - EXPECT_EQ(expectedIndex, intArrayView.size()); -} - -TEST(IntArrayViewTest, TestConstructFromArray) { - const size_t ARRAY_SIZE = 100; - std::array intArray; - const auto intArrayView = IntArrayView::fromArray(intArray); - EXPECT_EQ(ARRAY_SIZE, intArrayView.size()); -} - -TEST(IntArrayViewTest, TestConstructFromObject) { - const int object = 10; - const auto intArrayView = IntArrayView::singleElementView(&object); - EXPECT_EQ(1u, intArrayView.size()); - EXPECT_EQ(object, intArrayView[0]); -} - -TEST(IntArrayViewTest, TestContains) { - EXPECT_FALSE(IntArrayView().contains(0)); - EXPECT_FALSE(IntArrayView().contains(1)); - - const std::vector intVector = {3, 2, 1, 0, -1, -2}; - IntArrayView intArrayView(intVector); - EXPECT_TRUE(intArrayView.contains(0)); - EXPECT_TRUE(intArrayView.contains(3)); - EXPECT_TRUE(intArrayView.contains(-2)); - EXPECT_FALSE(intArrayView.contains(-3)); - EXPECT_FALSE(intArrayView.limit(0).contains(3)); -} - -TEST(IntArrayViewTest, TestLimit) { - const std::vector intVector = {3, 2, 1, 0, -1, -2}; - IntArrayView intArrayView(intVector); - - EXPECT_TRUE(intArrayView.limit(0).empty()); - EXPECT_EQ(intArrayView.size(), intArrayView.limit(intArrayView.size()).size()); - EXPECT_EQ(intArrayView.size(), intArrayView.limit(1000).size()); - - IntArrayView subView = intArrayView.limit(4); - EXPECT_EQ(4u, subView.size()); - for (size_t i = 0; i < subView.size(); ++i) { - EXPECT_EQ(intVector[i], subView[i]); - } -} - -TEST(IntArrayViewTest, TestSkip) { - const std::vector intVector = {3, 2, 1, 0, -1, -2}; - IntArrayView intArrayView(intVector); - - EXPECT_TRUE(intArrayView.skip(intVector.size()).empty()); - EXPECT_TRUE(intArrayView.skip(intVector.size() + 1).empty()); - EXPECT_EQ(intArrayView.size(), intArrayView.skip(0).size()); - EXPECT_EQ(intArrayView.size(), intArrayView.limit(1000).size()); - - static const size_t SKIP_COUNT = 2; - IntArrayView subView = intArrayView.skip(SKIP_COUNT); - EXPECT_EQ(intVector.size() - SKIP_COUNT, subView.size()); - for (size_t i = 0; i < subView.size(); ++i) { - EXPECT_EQ(intVector[i + SKIP_COUNT], subView[i]); - } -} - -TEST(IntArrayViewTest, TestCopyToArray) { - // "{{" to suppress warning. - std::array buffer = {{10, 20, 30, 40, 50, 60, 70}}; - const std::vector intVector = {3, 2, 1, 0, -1, -2}; - IntArrayView intArrayView(intVector); - intArrayView.limit(0).copyToArray(&buffer, 0); - EXPECT_EQ(10, buffer[0]); - EXPECT_EQ(20, buffer[1]); - intArrayView.limit(1).copyToArray(&buffer, 0); - EXPECT_EQ(intVector[0], buffer[0]); - EXPECT_EQ(20, buffer[1]); - intArrayView.limit(1).copyToArray(&buffer, 1); - EXPECT_EQ(intVector[0], buffer[0]); - EXPECT_EQ(intVector[0], buffer[1]); - intArrayView.copyToArray(&buffer, 0); - for (size_t i = 0; i < intArrayView.size(); ++i) { - EXPECT_EQ(intVector[i], buffer[i]); - } - EXPECT_EQ(70, buffer[6]); -} - -TEST(IntArrayViewTest, TestFirstOrDefault) { - const std::vector intVector = {3, 2, 1, 0, -1, -2}; - IntArrayView intArrayView(intVector); - - EXPECT_EQ(3, intArrayView.firstOrDefault(10)); - EXPECT_EQ(10, intArrayView.limit(0).firstOrDefault(10)); - EXPECT_EQ(-10, intArrayView.limit(0).firstOrDefault(-10)); - EXPECT_EQ(10, intArrayView.skip(6).firstOrDefault(10)); -} - -TEST(IntArrayViewTest, TestLastOrDefault) { - const std::vector intVector = {3, 2, 1, 0, -1, -2}; - IntArrayView intArrayView(intVector); - - EXPECT_EQ(-2, intArrayView.lastOrDefault(10)); - EXPECT_EQ(10, intArrayView.limit(0).lastOrDefault(10)); - EXPECT_EQ(-10, intArrayView.limit(0).lastOrDefault(-10)); - EXPECT_EQ(10, intArrayView.skip(6).lastOrDefault(10)); -} - -TEST(IntArrayViewTest, TestToVector) { - const std::vector intVector = {3, 2, 1, 0, -1, -2}; - IntArrayView intArrayView(intVector); - EXPECT_EQ(intVector, intArrayView.toVector()); - EXPECT_EQ(std::vector(), CodePointArrayView().toVector()); -} - -TEST(IntArrayViewTest, TestSplit) { - EXPECT_TRUE(IntArrayView().split(0, 0).empty()); - { - const auto intArrayViews = IntArrayView().split(0, 1); - EXPECT_EQ(1u, intArrayViews.size()); - EXPECT_TRUE(intArrayViews[0].empty()); - } - { - const auto intArrayViews = IntArrayView().split(0, 100); - EXPECT_EQ(1u, intArrayViews.size()); - EXPECT_TRUE(intArrayViews[0].empty()); - } - - const std::vector intVector = {1, 2, 3, 3, 2, 3}; - const IntArrayView intArrayView(intVector); - { - const auto intArrayViews = intArrayView.split(2); - EXPECT_EQ(3u, intArrayViews.size()); - EXPECT_EQ(std::vector({1}), intArrayViews[0].toVector()); - EXPECT_EQ(std::vector({3, 3}), intArrayViews[1].toVector()); - EXPECT_EQ(std::vector({3}), intArrayViews[2].toVector()); - } - { - const auto intArrayViews = intArrayView.split(2, 2); - EXPECT_EQ(2u, intArrayViews.size()); - EXPECT_EQ(std::vector({1}), intArrayViews[0].toVector()); - EXPECT_EQ(std::vector({3, 3, 2, 3}), intArrayViews[1].toVector()); - } - { - const auto intArrayViews = intArrayView.split(2, 1); - EXPECT_EQ(1u, intArrayViews.size()); - EXPECT_EQ(intVector, intArrayViews[0].toVector()); - } - { - const auto intArrayViews = intArrayView.split(2, 0); - EXPECT_EQ(0u, intArrayViews.size()); - } - { - const auto intArrayViews = intArrayView.split(3); - EXPECT_EQ(4u, intArrayViews.size()); - EXPECT_EQ(std::vector({1, 2}), intArrayViews[0].toVector()); - EXPECT_EQ(std::vector(), intArrayViews[1].toVector()); - EXPECT_EQ(std::vector({2}), intArrayViews[2].toVector()); - EXPECT_EQ(std::vector(), intArrayViews[3].toVector()); - } -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/jni/tests/utils/time_keeper_test.cpp b/app/src/main/jni/tests/utils/time_keeper_test.cpp deleted file mode 100644 index 3f54b91f..00000000 --- a/app/src/main/jni/tests/utils/time_keeper_test.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "utils/time_keeper.h" - -#include - -namespace latinime { -namespace { - -TEST(TimeKeeperTest, TestTestMode) { - TimeKeeper::setCurrentTime(); - const int startTime = TimeKeeper::peekCurrentTime(); - static const int TEST_CURRENT_TIME = 100; - TimeKeeper::startTestModeWithForceCurrentTime(TEST_CURRENT_TIME); - EXPECT_EQ(TEST_CURRENT_TIME, TimeKeeper::peekCurrentTime()); - TimeKeeper::setCurrentTime(); - EXPECT_EQ(TEST_CURRENT_TIME, TimeKeeper::peekCurrentTime()); - TimeKeeper::stopTestMode(); - TimeKeeper::setCurrentTime(); - EXPECT_LE(startTime, TimeKeeper::peekCurrentTime()); -} - -} // namespace -} // namespace latinime diff --git a/app/src/main/res/values-ar/string.xml b/app/src/main/res/values-ar/string.xml index cf303d8b..0cbcb364 100644 --- a/app/src/main/res/values-ar/string.xml +++ b/app/src/main/res/values-ar/string.xml @@ -38,7 +38,7 @@ الكود الذي استخدمناه لوحة المفاتيح المخصصة\n• المؤلف: إيثان إس كيه\n• الرخصة: MIT\n• الرابط: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE لوحة مفاتيح بسيطة\n• المؤلف: أدوات الهواتف البسيطة\n• الرخصة: GPL-3.0\n• الرابط: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - قام مطورو Scribe (SCRIBE) بإنشاء تطبيق iOS "Scribe - Language Keyboards" (SERVICE) باستخدام كود من طرف ثالث. جميع الأكواد المصدرية المستخدمة في إنشاء هذه الخدمة تأتي من مصادر تسمح بالاستخدام الكامل بالطريقة التي تتم بها الخدمة. تسرد هذه القسم الأكواد المصدرية التي استندت إليها الخدمة بالإضافة إلى الرخص المرتبطة بكل منها.\n\nتتضمن القائمة التالية جميع الأكواد المصدرية المستخدمة، المؤلف أو المؤلفين الرئيسيين للكود، الرخصة التي تم إصدارها بموجبها عند وقت الاستخدام، ورابط للرخصة. + قام مطورو Scribe (SCRIBE) بإنشاء تطبيق iOS "Scribe - Language Keyboards" (SERVICE) باستخدام كود من طرف ثالث. جميع الأكواد المصدرية المستخدمة في إنشاء هذه الخدمة تأتي من مصادر تسمح بالاستخدام الكامل بالطريقة التي تتم بها الخدمة. تسرد هذه القسم الأكواد المصدرية التي استندت إليها الخدمة بالإضافة إلى الرخص المرتبطة بكل منها.\n\nتتضمن القائمة التالية جميع الأكواد المصدرية المستخدمة، المؤلف أو المؤلفين الرئيسيين للكود، الرخصة التي تم إصدارها بموجبها عند وقت الاستخدام، ورابط للرخصة. حول اختر الزمن اختر تصريفًا أدناه diff --git a/app/src/main/res/values-bn/string.xml b/app/src/main/res/values-bn/string.xml index 86c1e7a6..23a3b613 100644 --- a/app/src/main/res/values-bn/string.xml +++ b/app/src/main/res/values-bn/string.xml @@ -43,7 +43,7 @@ যাদের কোড আমরা ব্যবহার করেছি কাস্টম কীবোর্ড\n• লেখক: EthanSK\n• লাইসেন্স: MIT\n• লিঙ্ক: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE সিম্পল কীবোর্ড\n• লেখক: Simple Mobile Tools\n• লাইসেন্স: GPL-3.0\n• লিঙ্ক: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - Scribe ডেভেলপাররা (SCRIBE) iOS অ্যাপ্লিকেশন "Scribe - Language Keyboards" (SERVICE) তৃতীয় পক্ষের কোড ব্যবহার করে তৈরি করেছেন। এই SERVICE তৈরিতে ব্যবহৃত সমস্ত সোর্স কোড এমন উৎস থেকে এসেছে যা SERVICE দ্বারা সম্পূর্ণভাবে ব্যবহারের অনুমতি দেয়। এই অংশে SERVICE ভিত্তি করে যে সোর্স কোড ব্যবহার করা হয়েছে এবং প্রতিটি কোডের লাইসেন্স তালিকাভুক্ত করা হয়েছে।\n\nনিম্নলিখিত হল সমস্ত ব্যবহৃত সোর্স কোড, কোডের প্রধান লেখক বা লেখকদের নাম, ব্যবহারকালে কোডটির প্রকাশিত লাইসেন্স এবং লাইসেন্সের লিঙ্ক। + Scribe ডেভেলপাররা (SCRIBE) iOS অ্যাপ্লিকেশন "Scribe - Language Keyboards" (SERVICE) তৃতীয় পক্ষের কোড ব্যবহার করে তৈরি করেছেন। এই SERVICE তৈরিতে ব্যবহৃত সমস্ত সোর্স কোড এমন উৎস থেকে এসেছে যা SERVICE দ্বারা সম্পূর্ণভাবে ব্যবহারের অনুমতি দেয়। এই অংশে SERVICE ভিত্তি করে যে সোর্স কোড ব্যবহার করা হয়েছে এবং প্রতিটি কোডের লাইসেন্স তালিকাভুক্ত করা হয়েছে।\n\nনিম্নলিখিত হল সমস্ত ব্যবহৃত সোর্স কোড, কোডের প্রধান লেখক বা লেখকদের নাম, ব্যবহারকালে কোডটির প্রকাশিত লাইসেন্স এবং লাইসেন্সের লিঙ্ক। সম্পর্কে কাল নির্বাচন করুন নিচের একটি conjugation নির্বাচন করুন diff --git a/app/src/main/res/values-de/string.xml b/app/src/main/res/values-de/string.xml index cbad4116..fe415660 100644 --- a/app/src/main/res/values-de/string.xml +++ b/app/src/main/res/values-de/string.xml @@ -50,7 +50,7 @@ Der von uns verwendete Code Custom Keyboard\n• Autor: EthanSK\n• Lizenz: MIT\n• Link: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE Simple Keyboard\n• Autor: Simple Mobile Tools\n• Lizenz: GPL-3.0\n• Link: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - Die iOS-App „Scribe - Language Keyboards“ (DIENST) wurde von den Scribe-Entwicklern (SCRIBE) unter Verwendung von Code von Dritten erstellt. Der gesamte bei der Erstellung dieses DIENSTES verwendete Quellcode stammt von Quellen, die ihre Nutzung in der vom DIENST durchgeführten Weise gestatten. Dieser Abschnitt enthält den Quellcode, auf dem der DIENST basiert, sowie die zugehörigen Lizenzen.\n\nIm Folgenden ist eine Liste des benutzten Quellcodes, des oder der jeweiligen Autor:innen und der Lizenz zur Zeit der Verwendung durch SCRIBE mit einem Link zu dieser zu finden. + Die iOS-App „Scribe - Language Keyboards“ (DIENST) wurde von den Scribe-Entwicklern (SCRIBE) unter Verwendung von Code von Dritten erstellt. Der gesamte bei der Erstellung dieses DIENSTES verwendete Quellcode stammt von Quellen, die ihre Nutzung in der vom DIENST durchgeführten Weise gestatten. Dieser Abschnitt enthält den Quellcode, auf dem der DIENST basiert, sowie die zugehörigen Lizenzen.\n\nIm Folgenden ist eine Liste des benutzten Quellcodes, des oder der jeweiligen Autor:innen und der Lizenz zur Zeit der Verwendung durch SCRIBE mit einem Link zu dieser zu finden. Über uns Tempus auswählen Wähle unten eine Konjugation diff --git a/app/src/main/res/values-el/string.xml b/app/src/main/res/values-el/string.xml index 9b9dfa76..75c1f51c 100644 --- a/app/src/main/res/values-el/string.xml +++ b/app/src/main/res/values-el/string.xml @@ -56,7 +56,7 @@ Τίνος τον κώδικα χρησιμοποιήσαμε Custom Keyboard\n• Συγγραφέας: EthanSK\n• Άδεια: MIT\n• Σύνδεσμος: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE Simple Keyboard\n• Συγγραφέας: Simple Mobile Tools\n• Άδεια: GPL-3.0\n• Σύνδεσμος: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - Οι προγραμματιστές του Scribe (SCRIBE) δημιούργησαν την εφαρμογή iOS "Scribe - Language Keyboards" (ΥΠΗΡΕΣΙΑ) χρησιμοποιώντας κώδικα τρίτων. Όλος ο πηγαίος κώδικας που χρησιμοποιήθηκε στη δημιουργία αυτής της ΥΠΗΡΕΣΙΑΣ προέρχεται από πηγές που επιτρέπουν την πλήρη χρήση του με τον τρόπο που γίνεται από την ΥΠΗΡΕΣΙΑ. Αυτή η ενότητα παραθέτει τον πηγαίο κώδικα στον οποίο βασίστηκε η ΥΠΗΡΕΣΙΑ καθώς και τις αντίστοιχες άδειες του καθενός.\n\nΑκολουθεί μια λίστα με όλο τον χρησιμοποιούμενο πηγαίο κώδικα, τον κύριο συγγραφέα ή συγγραφείς του κώδικα, την άδεια υπό την οποία κυκλοφόρησε κατά τη χρήση και έναν σύνδεσμο προς την άδεια. + Οι προγραμματιστές του Scribe (SCRIBE) δημιούργησαν την εφαρμογή iOS "Scribe - Language Keyboards" (ΥΠΗΡΕΣΙΑ) χρησιμοποιώντας κώδικα τρίτων. Όλος ο πηγαίος κώδικας που χρησιμοποιήθηκε στη δημιουργία αυτής της ΥΠΗΡΕΣΙΑΣ προέρχεται από πηγές που επιτρέπουν την πλήρη χρήση του με τον τρόπο που γίνεται από την ΥΠΗΡΕΣΙΑ. Αυτή η ενότητα παραθέτει τον πηγαίο κώδικα στον οποίο βασίστηκε η ΥΠΗΡΕΣΙΑ καθώς και τις αντίστοιχες άδειες του καθενός.\n\nΑκολουθεί μια λίστα με όλο τον χρησιμοποιούμενο πηγαίο κώδικα, τον κύριο συγγραφέα ή συγγραφείς του κώδικα, την άδεια υπό την οποία κυκλοφόρησε κατά τη χρήση και έναν σύνδεσμο προς την άδεια. Σχετικά Επιλογή χρόνου Επιλέξτε μια κλίση παρακάτω diff --git a/app/src/main/res/values-es/string.xml b/app/src/main/res/values-es/string.xml index b3ddc558..e270df61 100644 --- a/app/src/main/res/values-es/string.xml +++ b/app/src/main/res/values-es/string.xml @@ -38,7 +38,7 @@ ¿De quién es el código que utilizamos? Custom Keyboard\n• Autor: EthanSK\n• Licencia: MIT\n• Enlace: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE Simple Keyboard\n• Autor: Simple Mobile Tools\n• Licencia: GPL-3.0\n• Enlace: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - Los desarrolladores de Scribe (SCRIBE) han creado la aplicación iOS "Scribe - Teclados de idiomas" (SERVICIO) utilizando código de terceros. Todo el código fuente utilizado en la creación de este SERVICIO procede de fuentes que permiten su plena utilización en la forma en que lo hace el SERVICIO. En esta sección se enumera el código fuente en el que se ha basado el SERVICIO, así como las licencias coincidentes de cada uno de ellos.\n\nA continuación se incluye una lista de todo el código fuente utilizado, el autor o autores principales del código, la licencia bajo la que se publicó en el momento de su uso y un enlace a la licencia. + Los desarrolladores de Scribe (SCRIBE) han creado la aplicación iOS "Scribe - Teclados de idiomas" (SERVICIO) utilizando código de terceros. Todo el código fuente utilizado en la creación de este SERVICIO procede de fuentes que permiten su plena utilización en la forma en que lo hace el SERVICIO. En esta sección se enumera el código fuente en el que se ha basado el SERVICIO, así como las licencias coincidentes de cada uno de ellos.\n\nA continuación se incluye una lista de todo el código fuente utilizado, el autor o autores principales del código, la licencia bajo la que se publicó en el momento de su uso y un enlace a la licencia. Acerca de Seleccionar tiempo A continuación, elige una conjugación diff --git a/app/src/main/res/values-fr/string.xml b/app/src/main/res/values-fr/string.xml index 7545eec2..989e520e 100644 --- a/app/src/main/res/values-fr/string.xml +++ b/app/src/main/res/values-fr/string.xml @@ -38,7 +38,7 @@ Le code que nous avons utilisé Custom Keyboard\n• Auteur : EthanSK\n• Licence : MIT\n• Lien : https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE Simple Keyboard\n• Auteur : Simple Mobile Tools\n• Licence : GPL-3.0\n• Lien : https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - Les développeurs de Scribe (SCRIBE) ont créé l\'application iOS « Scribe - Claviers linguistiques » (SERVICE) en utilisant du code tiers. Tout le code source utilisé dans la création de ce SERVICE provient de sources permettant son utilisation complète de la manière effectuée par le SERVICE. Cette section répertorie le code source sur lequel le SERVICE est basé ainsi que les licences correspondantes de chacun d\'eux.\n\nLa liste suivante inclut tout le code source utilisé, le ou les auteurs principaux du code, la licence sous laquelle il a été publié au moment de son utilisation et un lien vers la licence. + Les développeurs de Scribe (SCRIBE) ont créé l\'application iOS « Scribe - Claviers linguistiques » (SERVICE) en utilisant du code tiers. Tout le code source utilisé dans la création de ce SERVICE provient de sources permettant son utilisation complète de la manière effectuée par le SERVICE. Cette section répertorie le code source sur lequel le SERVICE est basé ainsi que les licences correspondantes de chacun d\'eux.\n\nLa liste suivante inclut tout le code source utilisé, le ou les auteurs principaux du code, la licence sous laquelle il a été publié au moment de son utilisation et un lien vers la licence. À propos Sélectionner un temps Sélectionnez une conjugaison ci-dessous diff --git a/app/src/main/res/values-hi/string.xml b/app/src/main/res/values-hi/string.xml index 085262f7..2bd42f97 100644 --- a/app/src/main/res/values-hi/string.xml +++ b/app/src/main/res/values-hi/string.xml @@ -44,7 +44,7 @@ जिनका कोड हमने उपयोग किया कस्टम कीबोर्ड\n• लेखक: एथें स क\n• लाइसेंस: एमआईटी\n• लिंक: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE सिंपल कीबोर्ड \n• लेखक: सिंपल मोबाइल उपकरण\n• लाइसेंस: जीपीएल-3.0\n• लिंक: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - स्क्राइब डेवलपर्स (स्क्राइब ) ने आईओएस एप्लिकेशन "स्क्राइब - भाषा कीबोर्ड" (सेवा) का निर्माण तृतीय-पक्ष कोड का उपयोग करके किया है। इस सेवा के निर्माण में उपयोग किया गया सभी स्रोत कोड ऐसे स्रोतों से आता है जो इसे इस सेवा द्वारा किए गए उपयोग में अनुमति देते हैं। इस खंड में उन स्रोत कोड की सूची दी गई है, जिन पर सेवा ही प्रत्येक का संबंधित लाइसेंस।\n\nनिम्नलिखित सभी उपयोग किए गए स्रोत कोड की सूची है, कोड के मुख्य लेखक या लेखक, उस समय जारी किए गए लाइसेंस और लाइसेंस के लिंक। + स्क्राइब डेवलपर्स (स्क्राइब ) ने आईओएस एप्लिकेशन "स्क्राइब - भाषा कीबोर्ड" (सेवा) का निर्माण तृतीय-पक्ष कोड का उपयोग करके किया है। इस सेवा के निर्माण में उपयोग किया गया सभी स्रोत कोड ऐसे स्रोतों से आता है जो इसे इस सेवा द्वारा किए गए उपयोग में अनुमति देते हैं। इस खंड में उन स्रोत कोड की सूची दी गई है, जिन पर सेवा ही प्रत्येक का संबंधित लाइसेंस।\n\nनिम्नलिखित सभी उपयोग किए गए स्रोत कोड की सूची है, कोड के मुख्य लेखक या लेखक, उस समय जारी किए गए लाइसेंस और लाइसेंस के लिंक। के बारे में काल चुनें नीचे से एक संयोजन चुनें diff --git a/app/src/main/res/values-id/string.xml b/app/src/main/res/values-id/string.xml index fc7eedf6..5e0291d5 100644 --- a/app/src/main/res/values-id/string.xml +++ b/app/src/main/res/values-id/string.xml @@ -38,7 +38,7 @@ Kode siapa yang kami gunakan Custom Keyboard\n• Penulis: EthanSK\n• License: MIT\n• Link: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE Simple Keyboard\n• Penulis: Simple Mobile Tools\n• License: GPL-3.0\n• Link: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - Pengembang Scribe (SCRIBE) membuat aplikasi iOS application "Scribe - Language Keyboards" (SERVICE) menggunakan kode pihak ketiga. Semua kode sumber yang digunakan dalam pembuatan LAYANAN ini berasal dari sumber yang memperbolehkan penggunaan sepenuhnya sesuai dengan cara yang dilakukan oleh LAYANAN. Bagian ini mencantumkan semua kode sumber yang menjadi dasar LAYANAN serta lisensi yang sesuai dari masing-masing.\n\nBerikut adalah daftar semua kode sumber yang digunakan, penulis-penulis utama kode, lisensi yang digunakan pada saat penggunaan, dan tautan ke lisensi tersebut. + Pengembang Scribe (SCRIBE) membuat aplikasi iOS application "Scribe - Language Keyboards" (SERVICE) menggunakan kode pihak ketiga. Semua kode sumber yang digunakan dalam pembuatan LAYANAN ini berasal dari sumber yang memperbolehkan penggunaan sepenuhnya sesuai dengan cara yang dilakukan oleh LAYANAN. Bagian ini mencantumkan semua kode sumber yang menjadi dasar LAYANAN serta lisensi yang sesuai dari masing-masing.\n\nBerikut adalah daftar semua kode sumber yang digunakan, penulis-penulis utama kode, lisensi yang digunakan pada saat penggunaan, dan tautan ke lisensi tersebut. Tentang Pilih tense Pilih konjugasi di bawah diff --git a/app/src/main/res/values-in/string.xml b/app/src/main/res/values-in/string.xml index fc7eedf6..5e0291d5 100644 --- a/app/src/main/res/values-in/string.xml +++ b/app/src/main/res/values-in/string.xml @@ -38,7 +38,7 @@ Kode siapa yang kami gunakan Custom Keyboard\n• Penulis: EthanSK\n• License: MIT\n• Link: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE Simple Keyboard\n• Penulis: Simple Mobile Tools\n• License: GPL-3.0\n• Link: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - Pengembang Scribe (SCRIBE) membuat aplikasi iOS application "Scribe - Language Keyboards" (SERVICE) menggunakan kode pihak ketiga. Semua kode sumber yang digunakan dalam pembuatan LAYANAN ini berasal dari sumber yang memperbolehkan penggunaan sepenuhnya sesuai dengan cara yang dilakukan oleh LAYANAN. Bagian ini mencantumkan semua kode sumber yang menjadi dasar LAYANAN serta lisensi yang sesuai dari masing-masing.\n\nBerikut adalah daftar semua kode sumber yang digunakan, penulis-penulis utama kode, lisensi yang digunakan pada saat penggunaan, dan tautan ke lisensi tersebut. + Pengembang Scribe (SCRIBE) membuat aplikasi iOS application "Scribe - Language Keyboards" (SERVICE) menggunakan kode pihak ketiga. Semua kode sumber yang digunakan dalam pembuatan LAYANAN ini berasal dari sumber yang memperbolehkan penggunaan sepenuhnya sesuai dengan cara yang dilakukan oleh LAYANAN. Bagian ini mencantumkan semua kode sumber yang menjadi dasar LAYANAN serta lisensi yang sesuai dari masing-masing.\n\nBerikut adalah daftar semua kode sumber yang digunakan, penulis-penulis utama kode, lisensi yang digunakan pada saat penggunaan, dan tautan ke lisensi tersebut. Tentang Pilih tense Pilih konjugasi di bawah diff --git a/app/src/main/res/values-kn/string.xml b/app/src/main/res/values-kn/string.xml index 4aecbbaa..641b5be2 100644 --- a/app/src/main/res/values-kn/string.xml +++ b/app/src/main/res/values-kn/string.xml @@ -38,7 +38,7 @@ ನಾವು ಯಾರ ಕೋಡ್ ಬಳಸಿದ್ದೇವೆ ಕಸ್ಟಮ್ ಕೀಬೋರ್ಡ್\n• ಲೇಖಕರು: EthanSK\n• ಲೈಸೆನ್ಸ್: MIT\n• ಲಿಂಕ್: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE Simple Keyboard\n• ಲೇಖಕರು: Simple Mobile Tools\n• ಲೈಸೆನ್ಸ್: GPL-3.0\n• ಲಿಂಕ್: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - Scribe ಡೆವಲಪರ್‌ಗಳು (SCRIBE) iOS ಅಪ್ಲಿಕೇಶನ್ "Scribe - Language Keyboards" (SERVICE) ಅನ್ನು ಮೂರನೇ ಪಕ್ಷದ ಕೋಡ್ ಬಳಸಿ ನಿರ್ಮಿಸಿದ್ದಾರೆ. ಈ ಸೇವೆಯನ್ನು ರಚಿಸಲು ಬಳಸಲಾದ ಎಲ್ಲಾ ಮೂಲ ಕೋಡ್, ಸೇವೆ ಮಾಡುವ ರೀತಿಯಲ್ಲಿ ಅದರ ಸಂಪೂರ್ಣ ಬಳಕೆಯನ್ನು ಅನುಮತಿಸುವ ಮೂಲಗಳಿಂದ ಬರುತ್ತದೆ. ಈ ವಿಭಾಗವು ಸೇವೆ ಆಧರಿಸಿರುವ ಕೆಲವು ಮೂಲ ಕೋಡ್ ಹಾಗೂ ಪ್ರತಿ ಅದರ ಸಂಬಂಧಿತ ಲೈಸೆನ್ಸ್‌ಗಳನ್ನು ಪಟ್ಟಿ ಮಾಡುತ್ತದೆ.\n\nಕೆಳಗೆ ಬಳಸಲಾದ ಎಲ್ಲಾ ಮೂಲ ಕೋಡ್, ಕೋಡ್‌ನ ಮುಖ್ಯ ಲೇಖಕ ಅಥವಾ ಲೇಖಕರು, ಬಳಕೆಯ ಸಮಯದಲ್ಲಿ ಬಿಡುಗಡೆಯಾದ ಲೈಸೆನ್ಸ್ ಮತ್ತು ಲೈಸೆನ್ಸ್‌ಗೆ ಲಿಂಕ್ ಅನ್ನು ಪಟ್ಟಿ ಮಾಡಲಾಗಿದೆ: + Scribe ಡೆವಲಪರ್‌ಗಳು (SCRIBE) iOS ಅಪ್ಲಿಕೇಶನ್ "Scribe - Language Keyboards" (SERVICE) ಅನ್ನು ಮೂರನೇ ಪಕ್ಷದ ಕೋಡ್ ಬಳಸಿ ನಿರ್ಮಿಸಿದ್ದಾರೆ. ಈ ಸೇವೆಯನ್ನು ರಚಿಸಲು ಬಳಸಲಾದ ಎಲ್ಲಾ ಮೂಲ ಕೋಡ್, ಸೇವೆ ಮಾಡುವ ರೀತಿಯಲ್ಲಿ ಅದರ ಸಂಪೂರ್ಣ ಬಳಕೆಯನ್ನು ಅನುಮತಿಸುವ ಮೂಲಗಳಿಂದ ಬರುತ್ತದೆ. ಈ ವಿಭಾಗವು ಸೇವೆ ಆಧರಿಸಿರುವ ಕೆಲವು ಮೂಲ ಕೋಡ್ ಹಾಗೂ ಪ್ರತಿ ಅದರ ಸಂಬಂಧಿತ ಲೈಸೆನ್ಸ್‌ಗಳನ್ನು ಪಟ್ಟಿ ಮಾಡುತ್ತದೆ.\n\nಕೆಳಗೆ ಬಳಸಲಾದ ಎಲ್ಲಾ ಮೂಲ ಕೋಡ್, ಕೋಡ್‌ನ ಮುಖ್ಯ ಲೇಖಕ ಅಥವಾ ಲೇಖಕರು, ಬಳಕೆಯ ಸಮಯದಲ್ಲಿ ಬಿಡುಗಡೆಯಾದ ಲೈಸೆನ್ಸ್ ಮತ್ತು ಲೈಸೆನ್ಸ್‌ಗೆ ಲಿಂಕ್ ಅನ್ನು ಪಟ್ಟಿ ಮಾಡಲಾಗಿದೆ: ಬಗ್ಗೆ ಕಾಲವನ್ನು ಆಯ್ಕೆಮಾಡಿ ಕೆಳಗೆ ಒಂದು ಸಂಯೋಜನೆಯನ್ನು ಆಯ್ಕೆಮಾಡಿ diff --git a/app/src/main/res/values-ko/string.xml b/app/src/main/res/values-ko/string.xml index 54a4440d..80f212c6 100644 --- a/app/src/main/res/values-ko/string.xml +++ b/app/src/main/res/values-ko/string.xml @@ -38,7 +38,7 @@ 사용된 코드의 소유자 커스텀 키보드\n• 저자: EthanSK\n• 라이선스: MIT\n• 링크: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE 기본 키보드\n• 저자: Simple Mobile Tools\n• 라이선스: GPL-3.0\n• 링크: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - Scribe 개발자(SCRIBE)는 제3자 코드를 사용하여 iOS 애플리케이션 "Scribe - 언어 키보드"(서비스)를 제작했습니다. 이 서비스 제작에 사용된 모든 소스 코드는 서비스에서 사용된 방식으로 완전하게 활용할 수 있는 소스에서 비롯되었습니다. 이 섹션에서는 서비스의 기반이 된 소스 코드와 각 코드에 해당하는 라이선스를 나열합니다.\n\n다음은 사용된 모든 소스 코드 목록, 코드의 주요 저자 또는 저자들, 사용 당시의 라이선스, 그리고 라이선스 링크입니다. + Scribe 개발자(SCRIBE)는 제3자 코드를 사용하여 iOS 애플리케이션 "Scribe - 언어 키보드"(서비스)를 제작했습니다. 이 서비스 제작에 사용된 모든 소스 코드는 서비스에서 사용된 방식으로 완전하게 활용할 수 있는 소스에서 비롯되었습니다. 이 섹션에서는 서비스의 기반이 된 소스 코드와 각 코드에 해당하는 라이선스를 나열합니다.\n\n다음은 사용된 모든 소스 코드 목록, 코드의 주요 저자 또는 저자들, 사용 당시의 라이선스, 그리고 라이선스 링크입니다. 정보 시제 선택 아래에서 활용형을 선택하세요. diff --git a/app/src/main/res/values-mr/string.xml b/app/src/main/res/values-mr/string.xml index ebcc8795..4945b053 100644 --- a/app/src/main/res/values-mr/string.xml +++ b/app/src/main/res/values-mr/string.xml @@ -38,7 +38,7 @@ ज्यांचा कोड आम्ही वापरला आहे कस्टम कीबोर्ड\n• लेखक: एथेन एस के\n• परवाना: एमआयटी\n• लिंक: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE सिंपल कीबोर्ड\n• लेखक: सिंपल मोबाईल टूल्स\n• परवाना: GPL-3.0\n• लिंक: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - स्क्राइब डेव्हलपर्सनी आयओएस अ‍ॅप्लिकेशन \'स्क्राइब - भाषा कीबोर्ड्स\' तृतीय-पक्ष कोडचा वापर करून तयार केले आहे. + स्क्राइब डेव्हलपर्सनी आयओएस अ‍ॅप्लिकेशन \'स्क्राइब - भाषा कीबोर्ड्स\' तृतीय-पक्ष कोडचा वापर करून तयार केले आहे. बद्दल काल निवडा खालीलपैकी एक संयोजन निवडा diff --git a/app/src/main/res/values-ne/string.xml b/app/src/main/res/values-ne/string.xml index 42a7e59f..2a0832c5 100644 --- a/app/src/main/res/values-ne/string.xml +++ b/app/src/main/res/values-ne/string.xml @@ -56,7 +56,7 @@ हामीले कुन कोड प्रयोग गर्यौं Custom Keyboard\n• लेखक: EthanSK\n• लाइसेन्स: MIT\n• लिङ्क: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE Simple Keyboard\n• लेखक: Simple Mobile Tools\n• लाइसेन्स: GPL-3.0\n• लिङ्क: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - स्क्राइब विकासकर्ताहरूले तृतीय-पक्ष कोड प्रयोग गरेर iOS एप्लिकेसन बनाएका छन्। + स्क्राइब विकासकर्ताहरूले तृतीय-पक्ष कोड प्रयोग गरेर iOS एप्लिकेसन बनाएका छन्। बारेमा काल चयन गर्नुहोस् तलको कन्जुगेसन चयन गर्नुहोस् diff --git a/app/src/main/res/values-pt/string.xml b/app/src/main/res/values-pt/string.xml index 5920df8a..7cd82598 100644 --- a/app/src/main/res/values-pt/string.xml +++ b/app/src/main/res/values-pt/string.xml @@ -38,7 +38,7 @@ Fontes dos códigos que utilizamos Teclado Personalizado\n• Autor: EthanSK\n• Licença: MIT\n• Link: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE Teclado Simples\n• Autor: Simple Mobile Tools\n• Licença: GPL-3.0\n• Link: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - Os desenvolvedores do Scribe (SCRIBE) criaram o aplicativo iOS "Scribe - Teclados de Idiomas" (SERVIÇO) usando código de terceiros. Todo o código-fonte usado na criação deste SERVIÇO vem de fontes que permitem o seu uso por completo da forma como é feito pelo SERVIÇO. Esta seção lista o código-fonte no qual o SERVIÇO se baseia, bem como suas respectivas licenças.\n\nA seguir você encontrará uma lista de todos os códigos-fontes utilizados, seus autores, suas licenças de uso no momento em que foram disponibilizados, e links para suas licenças. + Os desenvolvedores do Scribe (SCRIBE) criaram o aplicativo iOS "Scribe - Teclados de Idiomas" (SERVIÇO) usando código de terceiros. Todo o código-fonte usado na criação deste SERVIÇO vem de fontes que permitem o seu uso por completo da forma como é feito pelo SERVIÇO. Esta seção lista o código-fonte no qual o SERVIÇO se baseia, bem como suas respectivas licenças.\n\nA seguir você encontrará uma lista de todos os códigos-fontes utilizados, seus autores, suas licenças de uso no momento em que foram disponibilizados, e links para suas licenças. Sobre Selecionar tempo verbal Escolha uma conjugação abaixo diff --git a/app/src/main/res/values-sv/string.xml b/app/src/main/res/values-sv/string.xml index 1a8cdaae..8332cdd8 100644 --- a/app/src/main/res/values-sv/string.xml +++ b/app/src/main/res/values-sv/string.xml @@ -38,7 +38,7 @@ Vems kod vi använde Custom Keyboard\n• Upphovsman: EthanSK\n• Licens: MIT\n• Länk: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE Simple Keyboard\n• Upphovsman: Simple Mobile Tools\n• Licens: GPL-3.0\n• Länk: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - Utvecklarna på Scribe (SCRIBE) har utvecklat iOS-applikationen "Scribe - Language Keyboards" (TJÄNST) med hjälp av kod från tredje part. All källkod använd i skapelsen av denna TJÄNST kommer ifrån källor som ger oss full tillåtelse att använda koden på det sätt som görs av TJÄNSTEN. Nedan listas källkoden som TJÄNSTEN är baserad på och licenserna som sammanfaller. \n\nFöljande lista listar all källkod, upphovsmän, licensen som gällde vid tillfället av användandet och en länk till licensen. + Utvecklarna på Scribe (SCRIBE) har utvecklat iOS-applikationen "Scribe - Language Keyboards" (TJÄNST) med hjälp av kod från tredje part. All källkod använd i skapelsen av denna TJÄNST kommer ifrån källor som ger oss full tillåtelse att använda koden på det sätt som görs av TJÄNSTEN. Nedan listas källkoden som TJÄNSTEN är baserad på och licenserna som sammanfaller. \n\nFöljande lista listar all källkod, upphovsmän, licensen som gällde vid tillfället av användandet och en länk till licensen. Om Välj tempus Välj en konjugering nedan diff --git a/app/src/main/res/values-ta/string.xml b/app/src/main/res/values-ta/string.xml index 1926d8af..07a7bc1a 100644 --- a/app/src/main/res/values-ta/string.xml +++ b/app/src/main/res/values-ta/string.xml @@ -44,7 +44,7 @@ நாங்கள் யாருடைய குறியீட்டைப் பயன்படுத்தினோம் Custom Keyboard\n• ஆசிரியர்: EthanSK\n• உரிமம்: MIT\n• இணைப்பு: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE Simple Keyboard\n• ஆசிரியர்: Simple Mobile Tools\n• உரிமம்: GPL-3.0\n• இணைப்பு: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - Scribe டெவலப்பர்கள் (SCRIBE) iOS பயன்பாடு "Scribe - Language Keyboards" (SERVICE) ஐ மூன்றாம் தரப்பு குறியீட்டைப் பயன்படுத்தி உருவாக்கியுள்ளனர். இந்த சேவையை உருவாக்க பயன்படுத்தப்படும் அனைத்து மூலக் குறியீடுகளும் சேவையால் செய்யப்படும் முறையில் அதன் முழுப் பயன்பாட்டையும் அனுமதிக்கும் மூலங்களிலிருந்து வருகின்றன. இந்த பகுதி சேவை அடிப்படையாகக் கொண்ட மூலக் குறியீட்டையும் ஒவ்வொன்றின் தொடர்புடைய உரிமங்களையும் பட்டியலிடுகிறது.\n\nபின்வருவது பயன்படுத்தப்பட்ட அனைத்து மூலக் குறியீடுகள், குறியீட்டின் முக்கிய ஆசிரியர் அல்லது ஆசிரியர்கள், பயன்பாட்டின் போது அது வெளியிடப்பட்ட உரிமம் மற்றும் உரிமத்திற்கான இணைப்பு ஆகியவற்றின் பட்டியல். + Scribe டெவலப்பர்கள் (SCRIBE) iOS பயன்பாடு "Scribe - Language Keyboards" (SERVICE) ஐ மூன்றாம் தரப்பு குறியீட்டைப் பயன்படுத்தி உருவாக்கியுள்ளனர். இந்த சேவையை உருவாக்க பயன்படுத்தப்படும் அனைத்து மூலக் குறியீடுகளும் சேவையால் செய்யப்படும் முறையில் அதன் முழுப் பயன்பாட்டையும் அனுமதிக்கும் மூலங்களிலிருந்து வருகின்றன. இந்த பகுதி சேவை அடிப்படையாகக் கொண்ட மூலக் குறியீட்டையும் ஒவ்வொன்றின் தொடர்புடைய உரிமங்களையும் பட்டியலிடுகிறது.\n\nபின்வருவது பயன்படுத்தப்பட்ட அனைத்து மூலக் குறியீடுகள், குறியீட்டின் முக்கிய ஆசிரியர் அல்லது ஆசிரியர்கள், பயன்பாட்டின் போது அது வெளியிடப்பட்ட உரிமம் மற்றும் உரிமத்திற்கான இணைப்பு ஆகியவற்றின் பட்டியல். பற்றி காலத்தைத் தேர்ந்தெடுங்கள் கீழே ஒரு இணைப்பைத் தேர்ந்தெடுங்கள் diff --git a/app/src/main/res/values-tr/string.xml b/app/src/main/res/values-tr/string.xml index 8638ee8e..178cbfe0 100644 --- a/app/src/main/res/values-tr/string.xml +++ b/app/src/main/res/values-tr/string.xml @@ -39,7 +39,7 @@ Kimin kodunu kullandık Custom Keyboard\n• Yazar: EthanSK\n• Lisans: MIT\n• Bağlantı: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE Simple Keyboard\n• Yazar: Simple Mobile Tools\n• Lisans: GPL-3.0\n• Bağlantı: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - Scribe geliştiricileri (SCRIBE), "Scribe - Language Keyboards" adlı iOS uygulamasını (HİZMET) üçüncü taraf kodları kullanarak oluşturdu. Bu HİZMET\'in oluşturulmasında kullanılan tüm kaynak kodları, bu HİZMET tarafından yapılan şekilde tamamen kullanılmasına izin veren kaynaklardan gelmektedir. Bu bölüm, HİZMET\'in temel aldığı kaynak kodları ve her birinin denk gelen lisanslarını listeler.\n\nAşağıda kullanılan tüm kaynak kodlarının, kodun ana yazarı veya yazarlarının, kullanım sırasında yayınlanan lisansının ve lisansın bir bağlantısının bir listesi bulunmaktadır. + Scribe geliştiricileri (SCRIBE), "Scribe - Language Keyboards" adlı iOS uygulamasını (HİZMET) üçüncü taraf kodları kullanarak oluşturdu. Bu HİZMET\'in oluşturulmasında kullanılan tüm kaynak kodları, bu HİZMET tarafından yapılan şekilde tamamen kullanılmasına izin veren kaynaklardan gelmektedir. Bu bölüm, HİZMET\'in temel aldığı kaynak kodları ve her birinin denk gelen lisanslarını listeler.\n\nAşağıda kullanılan tüm kaynak kodlarının, kodun ana yazarı veya yazarlarının, kullanım sırasında yayınlanan lisansının ve lisansın bir bağlantısının bir listesi bulunmaktadır. Hakkında Zaman seç Aşağıdan bir çekim seç diff --git a/app/src/main/res/values/string.xml b/app/src/main/res/values/string.xml index 8b0a331f..7fba4313 100644 --- a/app/src/main/res/values/string.xml +++ b/app/src/main/res/values/string.xml @@ -62,7 +62,9 @@ Whose code we used Custom Keyboard\n• Author: EthanSK\n• License: MIT\n• Link: https://github.com/EthanSK/CustomKeyboard/blob/master/LICENSE Simple Keyboard\n• Author: Simple Mobile Tools\n• License: GPL-3.0\n• Link: https://github.com/SimpleMobileTools/Simple-Keyboard/blob/main/LICENSE - The Scribe developers (SCRIBE) built the iOS application "Scribe - Language Keyboards" (SERVICE) using third party code. All source code used in the creation of this SERVICE comes from sources that allow its full use in the manner done so by the SERVICE. This section lists the source code on which the SERVICE was based as well as the coinciding licenses of each.\n\nThe following is a list of all used source code, the main author or authors of the code, the license under which it was released at time of usage, and a link to the license. + The Scribe developers (SCRIBE) built the iOS application "Scribe - Language Keyboards" (SERVICE) using third party code. All source code used in the creation of this SERVICE comes from sources that allow its full use in the manner done so by the SERVICE. This section lists the source code on which the SERVICE was based as well as the coinciding licenses of each.\n\nThe following is a list of all used source code, the main author or authors of the code, the license under which it was released at time of usage, and a link to the license. + Additionally, this SERVICE bundles word-prediction dictionaries sourced from the Helium314 aosp-dictionaries project, available at https://codeberg.org/Helium314/aosp-dictionaries. These dictionaries are compiled from openly licensed word lists; the specific lists used by this SERVICE are released primarily under the Creative Commons Attribution 4.0 License (CC BY 4.0), with full per-language source and license details listed in that project\'s README. The compiled dictionary files themselves are distributed under the GNU General Public License v3.0 (GPL-3.0), available at https://codeberg.org/Helium314/aosp-dictionaries/src/branch/main/LICENSE. + The word-prediction and autocomplete engine used by this SERVICE is based on the dictionary engine from HeliBoard by Helium314, which is itself derived from the Android Open Source Project (AOSP) LatinIME keyboard. HeliBoard is released under a GPL-3.0 license, with this license being available at https://github.com/Helium314/HeliBoard/blob/main/LICENSE. About Navigate to the About tab. Back