diff --git a/app/build.gradle b/app/build.gradle index 82c38dfbb..c9fe1afa3 100755 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,7 +10,7 @@ android { minSdkVersion 19 targetSdkVersion 30 versionCode 10 - versionName "1.3" + versionName '1.4' } buildTypes { @@ -26,7 +26,7 @@ android { externalNativeBuild { ndkBuild { - path 'src/main/native/jni/Android.mk' + path 'src/main/jni/Android.mk' } } diff --git a/app/src/main/native/jni/Android.bp b/app/src/main/jni/Android.bp similarity index 100% rename from app/src/main/native/jni/Android.bp rename to app/src/main/jni/Android.bp diff --git a/app/src/main/native/jni/Android.mk b/app/src/main/jni/Android.mk similarity index 100% rename from app/src/main/native/jni/Android.mk rename to app/src/main/jni/Android.mk diff --git a/app/src/main/native/jni/Application.mk b/app/src/main/jni/Application.mk similarity index 100% rename from app/src/main/native/jni/Application.mk rename to app/src/main/jni/Application.mk diff --git a/app/src/main/native/jni/CleanupNativeFileList.mk b/app/src/main/jni/CleanupNativeFileList.mk similarity index 100% rename from app/src/main/native/jni/CleanupNativeFileList.mk rename to app/src/main/jni/CleanupNativeFileList.mk diff --git a/app/src/main/native/jni/HostUnitTests.mk b/app/src/main/jni/HostUnitTests.mk similarity index 100% rename from app/src/main/native/jni/HostUnitTests.mk rename to app/src/main/jni/HostUnitTests.mk diff --git a/app/src/main/native/jni/NativeFileList.mk b/app/src/main/jni/NativeFileList.mk similarity index 100% rename from app/src/main/native/jni/NativeFileList.mk rename to app/src/main/jni/NativeFileList.mk diff --git a/app/src/main/native/jni/TargetUnitTests.mk b/app/src/main/jni/TargetUnitTests.mk similarity index 100% rename from app/src/main/native/jni/TargetUnitTests.mk rename to app/src/main/jni/TargetUnitTests.mk diff --git a/app/src/main/native/jni/jni_common.cpp b/app/src/main/jni/jni_common.cpp similarity index 100% rename from app/src/main/native/jni/jni_common.cpp rename to app/src/main/jni/jni_common.cpp diff --git a/app/src/main/native/jni/jni_common.h b/app/src/main/jni/jni_common.h similarity index 100% rename from app/src/main/native/jni/jni_common.h rename to app/src/main/jni/jni_common.h diff --git a/app/src/main/native/jni/org_dslul_openboard_inputmethod_keyboard_ProximityInfo.cpp b/app/src/main/jni/org_dslul_openboard_inputmethod_keyboard_ProximityInfo.cpp similarity index 100% rename from app/src/main/native/jni/org_dslul_openboard_inputmethod_keyboard_ProximityInfo.cpp rename to app/src/main/jni/org_dslul_openboard_inputmethod_keyboard_ProximityInfo.cpp diff --git a/app/src/main/native/jni/org_dslul_openboard_inputmethod_keyboard_ProximityInfo.h b/app/src/main/jni/org_dslul_openboard_inputmethod_keyboard_ProximityInfo.h similarity index 100% rename from app/src/main/native/jni/org_dslul_openboard_inputmethod_keyboard_ProximityInfo.h rename to app/src/main/jni/org_dslul_openboard_inputmethod_keyboard_ProximityInfo.h diff --git a/app/src/main/native/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionary.cpp b/app/src/main/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionary.cpp similarity index 100% rename from app/src/main/native/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionary.cpp rename to app/src/main/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionary.cpp diff --git a/app/src/main/native/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionary.h b/app/src/main/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionary.h similarity index 100% rename from app/src/main/native/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionary.h rename to app/src/main/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionary.h diff --git a/app/src/main/native/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionaryUtils.cpp b/app/src/main/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionaryUtils.cpp similarity index 100% rename from app/src/main/native/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionaryUtils.cpp rename to app/src/main/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionaryUtils.cpp diff --git a/app/src/main/native/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionaryUtils.h b/app/src/main/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionaryUtils.h similarity index 100% rename from app/src/main/native/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionaryUtils.h rename to app/src/main/jni/org_dslul_openboard_inputmethod_latin_BinaryDictionaryUtils.h diff --git a/app/src/main/native/jni/org_dslul_openboard_inputmethod_latin_DicTraverseSession.cpp b/app/src/main/jni/org_dslul_openboard_inputmethod_latin_DicTraverseSession.cpp similarity index 100% rename from app/src/main/native/jni/org_dslul_openboard_inputmethod_latin_DicTraverseSession.cpp rename to app/src/main/jni/org_dslul_openboard_inputmethod_latin_DicTraverseSession.cpp diff --git a/app/src/main/native/jni/org_dslul_openboard_inputmethod_latin_DicTraverseSession.h b/app/src/main/jni/org_dslul_openboard_inputmethod_latin_DicTraverseSession.h similarity index 100% rename from app/src/main/native/jni/org_dslul_openboard_inputmethod_latin_DicTraverseSession.h rename to app/src/main/jni/org_dslul_openboard_inputmethod_latin_DicTraverseSession.h diff --git a/app/src/main/native/jni/run-tests.sh b/app/src/main/jni/run-tests.sh similarity index 100% rename from app/src/main/native/jni/run-tests.sh rename to app/src/main/jni/run-tests.sh diff --git a/app/src/main/native/jni/src/defines.h b/app/src/main/jni/src/defines.h similarity index 100% rename from app/src/main/native/jni/src/defines.h rename to app/src/main/jni/src/defines.h diff --git a/app/src/main/native/jni/src/dictionary/header/header_policy.cpp b/app/src/main/jni/src/dictionary/header/header_policy.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/header/header_policy.cpp rename to app/src/main/jni/src/dictionary/header/header_policy.cpp diff --git a/app/src/main/native/jni/src/dictionary/header/header_policy.h b/app/src/main/jni/src/dictionary/header/header_policy.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/header/header_policy.h rename to app/src/main/jni/src/dictionary/header/header_policy.h diff --git a/app/src/main/native/jni/src/dictionary/header/header_read_write_utils.cpp b/app/src/main/jni/src/dictionary/header/header_read_write_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/header/header_read_write_utils.cpp rename to app/src/main/jni/src/dictionary/header/header_read_write_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/header/header_read_write_utils.h b/app/src/main/jni/src/dictionary/header/header_read_write_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/header/header_read_write_utils.h rename to app/src/main/jni/src/dictionary/header/header_read_write_utils.h diff --git a/app/src/main/native/jni/src/dictionary/interface/dictionary_bigrams_structure_policy.h b/app/src/main/jni/src/dictionary/interface/dictionary_bigrams_structure_policy.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/interface/dictionary_bigrams_structure_policy.h rename to app/src/main/jni/src/dictionary/interface/dictionary_bigrams_structure_policy.h diff --git a/app/src/main/native/jni/src/dictionary/interface/dictionary_header_structure_policy.h b/app/src/main/jni/src/dictionary/interface/dictionary_header_structure_policy.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/interface/dictionary_header_structure_policy.h rename to app/src/main/jni/src/dictionary/interface/dictionary_header_structure_policy.h diff --git a/app/src/main/native/jni/src/dictionary/interface/dictionary_shortcuts_structure_policy.h b/app/src/main/jni/src/dictionary/interface/dictionary_shortcuts_structure_policy.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/interface/dictionary_shortcuts_structure_policy.h rename to app/src/main/jni/src/dictionary/interface/dictionary_shortcuts_structure_policy.h diff --git a/app/src/main/native/jni/src/dictionary/interface/dictionary_structure_with_buffer_policy.h b/app/src/main/jni/src/dictionary/interface/dictionary_structure_with_buffer_policy.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/interface/dictionary_structure_with_buffer_policy.h rename to app/src/main/jni/src/dictionary/interface/dictionary_structure_with_buffer_policy.h diff --git a/app/src/main/native/jni/src/dictionary/interface/ngram_listener.h b/app/src/main/jni/src/dictionary/interface/ngram_listener.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/interface/ngram_listener.h rename to app/src/main/jni/src/dictionary/interface/ngram_listener.h diff --git a/app/src/main/native/jni/src/dictionary/property/historical_info.h b/app/src/main/jni/src/dictionary/property/historical_info.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/property/historical_info.h rename to app/src/main/jni/src/dictionary/property/historical_info.h diff --git a/app/src/main/native/jni/src/dictionary/property/ngram_context.cpp b/app/src/main/jni/src/dictionary/property/ngram_context.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/property/ngram_context.cpp rename to app/src/main/jni/src/dictionary/property/ngram_context.cpp diff --git a/app/src/main/native/jni/src/dictionary/property/ngram_context.h b/app/src/main/jni/src/dictionary/property/ngram_context.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/property/ngram_context.h rename to app/src/main/jni/src/dictionary/property/ngram_context.h diff --git a/app/src/main/native/jni/src/dictionary/property/ngram_property.h b/app/src/main/jni/src/dictionary/property/ngram_property.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/property/ngram_property.h rename to app/src/main/jni/src/dictionary/property/ngram_property.h diff --git a/app/src/main/native/jni/src/dictionary/property/unigram_property.h b/app/src/main/jni/src/dictionary/property/unigram_property.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/property/unigram_property.h rename to app/src/main/jni/src/dictionary/property/unigram_property.h diff --git a/app/src/main/native/jni/src/dictionary/property/word_attributes.h b/app/src/main/jni/src/dictionary/property/word_attributes.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/property/word_attributes.h rename to app/src/main/jni/src/dictionary/property/word_attributes.h diff --git a/app/src/main/native/jni/src/dictionary/property/word_property.h b/app/src/main/jni/src/dictionary/property/word_property.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/property/word_property.h rename to app/src/main/jni/src/dictionary/property/word_property.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/Readme.txt b/app/src/main/jni/src/dictionary/structure/backward/v402/Readme.txt similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/Readme.txt rename to app/src/main/jni/src/dictionary/structure/backward/v402/Readme.txt diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/bigram/ver4_bigram_list_policy.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/bigram/ver4_bigram_list_policy.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/bigram/ver4_bigram_list_policy.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/bigram/ver4_bigram_list_policy.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/bigram/ver4_bigram_list_policy.h b/app/src/main/jni/src/dictionary/structure/backward/v402/bigram/ver4_bigram_list_policy.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/bigram/ver4_bigram_list_policy.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/bigram/ver4_bigram_list_policy.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/bigram_dict_content.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/content/bigram_dict_content.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/bigram_dict_content.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/bigram_dict_content.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/bigram_dict_content.h b/app/src/main/jni/src/dictionary/structure/backward/v402/content/bigram_dict_content.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/bigram_dict_content.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/bigram_dict_content.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/bigram_entry.h b/app/src/main/jni/src/dictionary/structure/backward/v402/content/bigram_entry.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/bigram_entry.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/bigram_entry.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/dict_content.h b/app/src/main/jni/src/dictionary/structure/backward/v402/content/dict_content.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/dict_content.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/dict_content.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/probability_dict_content.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/content/probability_dict_content.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/probability_dict_content.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/probability_dict_content.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/probability_dict_content.h b/app/src/main/jni/src/dictionary/structure/backward/v402/content/probability_dict_content.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/probability_dict_content.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/probability_dict_content.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/probability_entry.h b/app/src/main/jni/src/dictionary/structure/backward/v402/content/probability_entry.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/probability_entry.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/probability_entry.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/shortcut_dict_content.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/content/shortcut_dict_content.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/shortcut_dict_content.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/shortcut_dict_content.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/shortcut_dict_content.h b/app/src/main/jni/src/dictionary/structure/backward/v402/content/shortcut_dict_content.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/shortcut_dict_content.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/shortcut_dict_content.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/single_dict_content.h b/app/src/main/jni/src/dictionary/structure/backward/v402/content/single_dict_content.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/single_dict_content.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/single_dict_content.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/sparse_table_dict_content.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/content/sparse_table_dict_content.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/sparse_table_dict_content.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/sparse_table_dict_content.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/sparse_table_dict_content.h b/app/src/main/jni/src/dictionary/structure/backward/v402/content/sparse_table_dict_content.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/sparse_table_dict_content.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/sparse_table_dict_content.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.h b/app/src/main/jni/src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/content/terminal_position_lookup_table.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/shortcut/ver4_shortcut_list_policy.h b/app/src/main/jni/src/dictionary/structure/backward/v402/shortcut/ver4_shortcut_list_policy.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/shortcut/ver4_shortcut_list_policy.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/shortcut/ver4_shortcut_list_policy.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_dict_buffers.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_dict_buffers.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_dict_buffers.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_dict_buffers.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_dict_buffers.h b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_dict_buffers.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_dict_buffers.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_dict_buffers.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_dict_constants.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_dict_constants.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_dict_constants.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_dict_constants.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_dict_constants.h b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_dict_constants.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_dict_constants.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_dict_constants.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_reader.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_reader.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_reader.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_reader.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_reader.h b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_reader.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_reader.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_reader.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.h b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_node_writer.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_policy.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_policy.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_policy.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_policy.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_policy.h b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_policy.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_policy.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_policy.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_reading_utils.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_reading_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_reading_utils.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_reading_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_reading_utils.h b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_reading_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_reading_utils.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_reading_utils.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_writing_helper.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_writing_helper.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_writing_helper.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_writing_helper.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_writing_helper.h b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_writing_helper.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_writing_helper.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_patricia_trie_writing_helper.h diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_pt_node_array_reader.cpp b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_pt_node_array_reader.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_pt_node_array_reader.cpp rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_pt_node_array_reader.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_pt_node_array_reader.h b/app/src/main/jni/src/dictionary/structure/backward/v402/ver4_pt_node_array_reader.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/backward/v402/ver4_pt_node_array_reader.h rename to app/src/main/jni/src/dictionary/structure/backward/v402/ver4_pt_node_array_reader.h diff --git a/app/src/main/native/jni/src/dictionary/structure/dictionary_structure_with_buffer_policy_factory.cpp b/app/src/main/jni/src/dictionary/structure/dictionary_structure_with_buffer_policy_factory.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/dictionary_structure_with_buffer_policy_factory.cpp rename to app/src/main/jni/src/dictionary/structure/dictionary_structure_with_buffer_policy_factory.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/dictionary_structure_with_buffer_policy_factory.h b/app/src/main/jni/src/dictionary/structure/dictionary_structure_with_buffer_policy_factory.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/dictionary_structure_with_buffer_policy_factory.h rename to app/src/main/jni/src/dictionary/structure/dictionary_structure_with_buffer_policy_factory.h diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/bigram/bigram_list_read_write_utils.cpp b/app/src/main/jni/src/dictionary/structure/pt_common/bigram/bigram_list_read_write_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/bigram/bigram_list_read_write_utils.cpp rename to app/src/main/jni/src/dictionary/structure/pt_common/bigram/bigram_list_read_write_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/bigram/bigram_list_read_write_utils.h b/app/src/main/jni/src/dictionary/structure/pt_common/bigram/bigram_list_read_write_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/bigram/bigram_list_read_write_utils.h rename to app/src/main/jni/src/dictionary/structure/pt_common/bigram/bigram_list_read_write_utils.h diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.cpp b/app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.cpp rename to app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.h b/app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.h rename to app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_gc_event_listeners.h diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_helper.cpp b/app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_helper.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_helper.cpp rename to app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_helper.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_helper.h b/app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_helper.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_helper.h rename to app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_helper.h diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_utils.cpp b/app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_utils.cpp rename to app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_utils.h b/app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_utils.h rename to app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_reading_utils.h diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_updating_helper.cpp b/app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_updating_helper.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_updating_helper.cpp rename to app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_updating_helper.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_updating_helper.h b/app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_updating_helper.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_updating_helper.h rename to app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_updating_helper.h diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_writing_utils.cpp b/app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_writing_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_writing_utils.cpp rename to app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_writing_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_writing_utils.h b/app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_writing_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/dynamic_pt_writing_utils.h rename to app/src/main/jni/src/dictionary/structure/pt_common/dynamic_pt_writing_utils.h diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/patricia_trie_reading_utils.cpp b/app/src/main/jni/src/dictionary/structure/pt_common/patricia_trie_reading_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/patricia_trie_reading_utils.cpp rename to app/src/main/jni/src/dictionary/structure/pt_common/patricia_trie_reading_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/patricia_trie_reading_utils.h b/app/src/main/jni/src/dictionary/structure/pt_common/patricia_trie_reading_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/patricia_trie_reading_utils.h rename to app/src/main/jni/src/dictionary/structure/pt_common/patricia_trie_reading_utils.h diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/pt_node_array_reader.h b/app/src/main/jni/src/dictionary/structure/pt_common/pt_node_array_reader.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/pt_node_array_reader.h rename to app/src/main/jni/src/dictionary/structure/pt_common/pt_node_array_reader.h diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/pt_node_params.h b/app/src/main/jni/src/dictionary/structure/pt_common/pt_node_params.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/pt_node_params.h rename to app/src/main/jni/src/dictionary/structure/pt_common/pt_node_params.h diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/pt_node_reader.h b/app/src/main/jni/src/dictionary/structure/pt_common/pt_node_reader.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/pt_node_reader.h rename to app/src/main/jni/src/dictionary/structure/pt_common/pt_node_reader.h diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/pt_node_writer.h b/app/src/main/jni/src/dictionary/structure/pt_common/pt_node_writer.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/pt_node_writer.h rename to app/src/main/jni/src/dictionary/structure/pt_common/pt_node_writer.h diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.cpp b/app/src/main/jni/src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.cpp rename to app/src/main/jni/src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.h b/app/src/main/jni/src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.h rename to app/src/main/jni/src/dictionary/structure/pt_common/shortcut/shortcut_list_reading_utils.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v2/bigram/bigram_list_policy.h b/app/src/main/jni/src/dictionary/structure/v2/bigram/bigram_list_policy.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v2/bigram/bigram_list_policy.h rename to app/src/main/jni/src/dictionary/structure/v2/bigram/bigram_list_policy.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v2/patricia_trie_policy.cpp b/app/src/main/jni/src/dictionary/structure/v2/patricia_trie_policy.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v2/patricia_trie_policy.cpp rename to app/src/main/jni/src/dictionary/structure/v2/patricia_trie_policy.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v2/patricia_trie_policy.h b/app/src/main/jni/src/dictionary/structure/v2/patricia_trie_policy.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v2/patricia_trie_policy.h rename to app/src/main/jni/src/dictionary/structure/v2/patricia_trie_policy.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v2/shortcut/shortcut_list_policy.h b/app/src/main/jni/src/dictionary/structure/v2/shortcut/shortcut_list_policy.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v2/shortcut/shortcut_list_policy.h rename to app/src/main/jni/src/dictionary/structure/v2/shortcut/shortcut_list_policy.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v2/ver2_patricia_trie_node_reader.cpp b/app/src/main/jni/src/dictionary/structure/v2/ver2_patricia_trie_node_reader.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v2/ver2_patricia_trie_node_reader.cpp rename to app/src/main/jni/src/dictionary/structure/v2/ver2_patricia_trie_node_reader.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v2/ver2_patricia_trie_node_reader.h b/app/src/main/jni/src/dictionary/structure/v2/ver2_patricia_trie_node_reader.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v2/ver2_patricia_trie_node_reader.h rename to app/src/main/jni/src/dictionary/structure/v2/ver2_patricia_trie_node_reader.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v2/ver2_pt_node_array_reader.cpp b/app/src/main/jni/src/dictionary/structure/v2/ver2_pt_node_array_reader.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v2/ver2_pt_node_array_reader.cpp rename to app/src/main/jni/src/dictionary/structure/v2/ver2_pt_node_array_reader.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v2/ver2_pt_node_array_reader.h b/app/src/main/jni/src/dictionary/structure/v2/ver2_pt_node_array_reader.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v2/ver2_pt_node_array_reader.h rename to app/src/main/jni/src/dictionary/structure/v2/ver2_pt_node_array_reader.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/dynamic_language_model_probability_utils.cpp b/app/src/main/jni/src/dictionary/structure/v4/content/dynamic_language_model_probability_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/dynamic_language_model_probability_utils.cpp rename to app/src/main/jni/src/dictionary/structure/v4/content/dynamic_language_model_probability_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/dynamic_language_model_probability_utils.h b/app/src/main/jni/src/dictionary/structure/v4/content/dynamic_language_model_probability_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/dynamic_language_model_probability_utils.h rename to app/src/main/jni/src/dictionary/structure/v4/content/dynamic_language_model_probability_utils.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/language_model_dict_content.cpp b/app/src/main/jni/src/dictionary/structure/v4/content/language_model_dict_content.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/language_model_dict_content.cpp rename to app/src/main/jni/src/dictionary/structure/v4/content/language_model_dict_content.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/language_model_dict_content.h b/app/src/main/jni/src/dictionary/structure/v4/content/language_model_dict_content.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/language_model_dict_content.h rename to app/src/main/jni/src/dictionary/structure/v4/content/language_model_dict_content.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/language_model_dict_content_global_counters.cpp b/app/src/main/jni/src/dictionary/structure/v4/content/language_model_dict_content_global_counters.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/language_model_dict_content_global_counters.cpp rename to app/src/main/jni/src/dictionary/structure/v4/content/language_model_dict_content_global_counters.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/language_model_dict_content_global_counters.h b/app/src/main/jni/src/dictionary/structure/v4/content/language_model_dict_content_global_counters.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/language_model_dict_content_global_counters.h rename to app/src/main/jni/src/dictionary/structure/v4/content/language_model_dict_content_global_counters.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/probability_entry.h b/app/src/main/jni/src/dictionary/structure/v4/content/probability_entry.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/probability_entry.h rename to app/src/main/jni/src/dictionary/structure/v4/content/probability_entry.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/shortcut_dict_content.cpp b/app/src/main/jni/src/dictionary/structure/v4/content/shortcut_dict_content.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/shortcut_dict_content.cpp rename to app/src/main/jni/src/dictionary/structure/v4/content/shortcut_dict_content.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/shortcut_dict_content.h b/app/src/main/jni/src/dictionary/structure/v4/content/shortcut_dict_content.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/shortcut_dict_content.h rename to app/src/main/jni/src/dictionary/structure/v4/content/shortcut_dict_content.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/single_dict_content.h b/app/src/main/jni/src/dictionary/structure/v4/content/single_dict_content.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/single_dict_content.h rename to app/src/main/jni/src/dictionary/structure/v4/content/single_dict_content.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/sparse_table_dict_content.cpp b/app/src/main/jni/src/dictionary/structure/v4/content/sparse_table_dict_content.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/sparse_table_dict_content.cpp rename to app/src/main/jni/src/dictionary/structure/v4/content/sparse_table_dict_content.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/sparse_table_dict_content.h b/app/src/main/jni/src/dictionary/structure/v4/content/sparse_table_dict_content.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/sparse_table_dict_content.h rename to app/src/main/jni/src/dictionary/structure/v4/content/sparse_table_dict_content.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/terminal_position_lookup_table.cpp b/app/src/main/jni/src/dictionary/structure/v4/content/terminal_position_lookup_table.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/terminal_position_lookup_table.cpp rename to app/src/main/jni/src/dictionary/structure/v4/content/terminal_position_lookup_table.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/content/terminal_position_lookup_table.h b/app/src/main/jni/src/dictionary/structure/v4/content/terminal_position_lookup_table.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/content/terminal_position_lookup_table.h rename to app/src/main/jni/src/dictionary/structure/v4/content/terminal_position_lookup_table.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/shortcut/ver4_shortcut_list_policy.h b/app/src/main/jni/src/dictionary/structure/v4/shortcut/ver4_shortcut_list_policy.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/shortcut/ver4_shortcut_list_policy.h rename to app/src/main/jni/src/dictionary/structure/v4/shortcut/ver4_shortcut_list_policy.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_dict_buffers.cpp b/app/src/main/jni/src/dictionary/structure/v4/ver4_dict_buffers.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_dict_buffers.cpp rename to app/src/main/jni/src/dictionary/structure/v4/ver4_dict_buffers.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_dict_buffers.h b/app/src/main/jni/src/dictionary/structure/v4/ver4_dict_buffers.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_dict_buffers.h rename to app/src/main/jni/src/dictionary/structure/v4/ver4_dict_buffers.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_dict_constants.cpp b/app/src/main/jni/src/dictionary/structure/v4/ver4_dict_constants.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_dict_constants.cpp rename to app/src/main/jni/src/dictionary/structure/v4/ver4_dict_constants.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_dict_constants.h b/app/src/main/jni/src/dictionary/structure/v4/ver4_dict_constants.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_dict_constants.h rename to app/src/main/jni/src/dictionary/structure/v4/ver4_dict_constants.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_reader.cpp b/app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_reader.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_reader.cpp rename to app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_reader.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_reader.h b/app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_reader.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_reader.h rename to app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_reader.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp b/app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp rename to app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_writer.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_writer.h b/app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_writer.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_writer.h rename to app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_node_writer.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.cpp b/app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.cpp rename to app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.h b/app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.h rename to app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_policy.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_reading_utils.cpp b/app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_reading_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_reading_utils.cpp rename to app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_reading_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_reading_utils.h b/app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_reading_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_reading_utils.h rename to app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_reading_utils.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_writing_helper.cpp b/app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_writing_helper.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_writing_helper.cpp rename to app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_writing_helper.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_writing_helper.h b/app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_writing_helper.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_patricia_trie_writing_helper.h rename to app/src/main/jni/src/dictionary/structure/v4/ver4_patricia_trie_writing_helper.h diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_pt_node_array_reader.cpp b/app/src/main/jni/src/dictionary/structure/v4/ver4_pt_node_array_reader.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_pt_node_array_reader.cpp rename to app/src/main/jni/src/dictionary/structure/v4/ver4_pt_node_array_reader.cpp diff --git a/app/src/main/native/jni/src/dictionary/structure/v4/ver4_pt_node_array_reader.h b/app/src/main/jni/src/dictionary/structure/v4/ver4_pt_node_array_reader.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/structure/v4/ver4_pt_node_array_reader.h rename to app/src/main/jni/src/dictionary/structure/v4/ver4_pt_node_array_reader.h diff --git a/app/src/main/native/jni/src/dictionary/utils/binary_dictionary_bigrams_iterator.h b/app/src/main/jni/src/dictionary/utils/binary_dictionary_bigrams_iterator.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/binary_dictionary_bigrams_iterator.h rename to app/src/main/jni/src/dictionary/utils/binary_dictionary_bigrams_iterator.h diff --git a/app/src/main/native/jni/src/dictionary/utils/binary_dictionary_shortcut_iterator.h b/app/src/main/jni/src/dictionary/utils/binary_dictionary_shortcut_iterator.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/binary_dictionary_shortcut_iterator.h rename to app/src/main/jni/src/dictionary/utils/binary_dictionary_shortcut_iterator.h diff --git a/app/src/main/native/jni/src/dictionary/utils/bloom_filter.h b/app/src/main/jni/src/dictionary/utils/bloom_filter.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/bloom_filter.h rename to app/src/main/jni/src/dictionary/utils/bloom_filter.h diff --git a/app/src/main/native/jni/src/dictionary/utils/buffer_with_extendable_buffer.cpp b/app/src/main/jni/src/dictionary/utils/buffer_with_extendable_buffer.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/buffer_with_extendable_buffer.cpp rename to app/src/main/jni/src/dictionary/utils/buffer_with_extendable_buffer.cpp diff --git a/app/src/main/native/jni/src/dictionary/utils/buffer_with_extendable_buffer.h b/app/src/main/jni/src/dictionary/utils/buffer_with_extendable_buffer.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/buffer_with_extendable_buffer.h rename to app/src/main/jni/src/dictionary/utils/buffer_with_extendable_buffer.h diff --git a/app/src/main/native/jni/src/dictionary/utils/byte_array_utils.cpp b/app/src/main/jni/src/dictionary/utils/byte_array_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/byte_array_utils.cpp rename to app/src/main/jni/src/dictionary/utils/byte_array_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/utils/byte_array_utils.h b/app/src/main/jni/src/dictionary/utils/byte_array_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/byte_array_utils.h rename to app/src/main/jni/src/dictionary/utils/byte_array_utils.h diff --git a/app/src/main/native/jni/src/dictionary/utils/dict_file_writing_utils.cpp b/app/src/main/jni/src/dictionary/utils/dict_file_writing_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/dict_file_writing_utils.cpp rename to app/src/main/jni/src/dictionary/utils/dict_file_writing_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/utils/dict_file_writing_utils.h b/app/src/main/jni/src/dictionary/utils/dict_file_writing_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/dict_file_writing_utils.h rename to app/src/main/jni/src/dictionary/utils/dict_file_writing_utils.h diff --git a/app/src/main/native/jni/src/dictionary/utils/entry_counters.h b/app/src/main/jni/src/dictionary/utils/entry_counters.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/entry_counters.h rename to app/src/main/jni/src/dictionary/utils/entry_counters.h diff --git a/app/src/main/native/jni/src/dictionary/utils/file_utils.cpp b/app/src/main/jni/src/dictionary/utils/file_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/file_utils.cpp rename to app/src/main/jni/src/dictionary/utils/file_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/utils/file_utils.h b/app/src/main/jni/src/dictionary/utils/file_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/file_utils.h rename to app/src/main/jni/src/dictionary/utils/file_utils.h diff --git a/app/src/main/native/jni/src/dictionary/utils/forgetting_curve_utils.cpp b/app/src/main/jni/src/dictionary/utils/forgetting_curve_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/forgetting_curve_utils.cpp rename to app/src/main/jni/src/dictionary/utils/forgetting_curve_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/utils/forgetting_curve_utils.h b/app/src/main/jni/src/dictionary/utils/forgetting_curve_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/forgetting_curve_utils.h rename to app/src/main/jni/src/dictionary/utils/forgetting_curve_utils.h diff --git a/app/src/main/native/jni/src/dictionary/utils/format_utils.cpp b/app/src/main/jni/src/dictionary/utils/format_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/format_utils.cpp rename to app/src/main/jni/src/dictionary/utils/format_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/utils/format_utils.h b/app/src/main/jni/src/dictionary/utils/format_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/format_utils.h rename to app/src/main/jni/src/dictionary/utils/format_utils.h diff --git a/app/src/main/native/jni/src/dictionary/utils/mmapped_buffer.cpp b/app/src/main/jni/src/dictionary/utils/mmapped_buffer.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/mmapped_buffer.cpp rename to app/src/main/jni/src/dictionary/utils/mmapped_buffer.cpp diff --git a/app/src/main/native/jni/src/dictionary/utils/mmapped_buffer.h b/app/src/main/jni/src/dictionary/utils/mmapped_buffer.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/mmapped_buffer.h rename to app/src/main/jni/src/dictionary/utils/mmapped_buffer.h diff --git a/app/src/main/native/jni/src/dictionary/utils/multi_bigram_map.cpp b/app/src/main/jni/src/dictionary/utils/multi_bigram_map.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/multi_bigram_map.cpp rename to app/src/main/jni/src/dictionary/utils/multi_bigram_map.cpp diff --git a/app/src/main/native/jni/src/dictionary/utils/multi_bigram_map.h b/app/src/main/jni/src/dictionary/utils/multi_bigram_map.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/multi_bigram_map.h rename to app/src/main/jni/src/dictionary/utils/multi_bigram_map.h diff --git a/app/src/main/native/jni/src/dictionary/utils/probability_utils.cpp b/app/src/main/jni/src/dictionary/utils/probability_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/probability_utils.cpp rename to app/src/main/jni/src/dictionary/utils/probability_utils.cpp diff --git a/app/src/main/native/jni/src/dictionary/utils/probability_utils.h b/app/src/main/jni/src/dictionary/utils/probability_utils.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/probability_utils.h rename to app/src/main/jni/src/dictionary/utils/probability_utils.h diff --git a/app/src/main/native/jni/src/dictionary/utils/sparse_table.cpp b/app/src/main/jni/src/dictionary/utils/sparse_table.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/sparse_table.cpp rename to app/src/main/jni/src/dictionary/utils/sparse_table.cpp diff --git a/app/src/main/native/jni/src/dictionary/utils/sparse_table.h b/app/src/main/jni/src/dictionary/utils/sparse_table.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/sparse_table.h rename to app/src/main/jni/src/dictionary/utils/sparse_table.h diff --git a/app/src/main/native/jni/src/dictionary/utils/trie_map.cpp b/app/src/main/jni/src/dictionary/utils/trie_map.cpp similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/trie_map.cpp rename to app/src/main/jni/src/dictionary/utils/trie_map.cpp diff --git a/app/src/main/native/jni/src/dictionary/utils/trie_map.h b/app/src/main/jni/src/dictionary/utils/trie_map.h similarity index 100% rename from app/src/main/native/jni/src/dictionary/utils/trie_map.h rename to app/src/main/jni/src/dictionary/utils/trie_map.h diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/dic_node.cpp b/app/src/main/jni/src/suggest/core/dicnode/dic_node.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/dic_node.cpp rename to app/src/main/jni/src/suggest/core/dicnode/dic_node.cpp diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/dic_node.h b/app/src/main/jni/src/suggest/core/dicnode/dic_node.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/dic_node.h rename to app/src/main/jni/src/suggest/core/dicnode/dic_node.h diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/dic_node_pool.h b/app/src/main/jni/src/suggest/core/dicnode/dic_node_pool.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/dic_node_pool.h rename to app/src/main/jni/src/suggest/core/dicnode/dic_node_pool.h diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/dic_node_priority_queue.h b/app/src/main/jni/src/suggest/core/dicnode/dic_node_priority_queue.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/dic_node_priority_queue.h rename to app/src/main/jni/src/suggest/core/dicnode/dic_node_priority_queue.h diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/dic_node_profiler.h b/app/src/main/jni/src/suggest/core/dicnode/dic_node_profiler.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/dic_node_profiler.h rename to app/src/main/jni/src/suggest/core/dicnode/dic_node_profiler.h diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/dic_node_utils.cpp b/app/src/main/jni/src/suggest/core/dicnode/dic_node_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/dic_node_utils.cpp rename to app/src/main/jni/src/suggest/core/dicnode/dic_node_utils.cpp diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/dic_node_utils.h b/app/src/main/jni/src/suggest/core/dicnode/dic_node_utils.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/dic_node_utils.h rename to app/src/main/jni/src/suggest/core/dicnode/dic_node_utils.h diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/dic_node_vector.h b/app/src/main/jni/src/suggest/core/dicnode/dic_node_vector.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/dic_node_vector.h rename to app/src/main/jni/src/suggest/core/dicnode/dic_node_vector.h diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/dic_nodes_cache.cpp b/app/src/main/jni/src/suggest/core/dicnode/dic_nodes_cache.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/dic_nodes_cache.cpp rename to app/src/main/jni/src/suggest/core/dicnode/dic_nodes_cache.cpp diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/dic_nodes_cache.h b/app/src/main/jni/src/suggest/core/dicnode/dic_nodes_cache.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/dic_nodes_cache.h rename to app/src/main/jni/src/suggest/core/dicnode/dic_nodes_cache.h diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/internal/dic_node_properties.h b/app/src/main/jni/src/suggest/core/dicnode/internal/dic_node_properties.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/internal/dic_node_properties.h rename to app/src/main/jni/src/suggest/core/dicnode/internal/dic_node_properties.h diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/internal/dic_node_state.h b/app/src/main/jni/src/suggest/core/dicnode/internal/dic_node_state.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/internal/dic_node_state.h rename to app/src/main/jni/src/suggest/core/dicnode/internal/dic_node_state.h diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/internal/dic_node_state_input.h b/app/src/main/jni/src/suggest/core/dicnode/internal/dic_node_state_input.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/internal/dic_node_state_input.h rename to app/src/main/jni/src/suggest/core/dicnode/internal/dic_node_state_input.h diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/internal/dic_node_state_output.h b/app/src/main/jni/src/suggest/core/dicnode/internal/dic_node_state_output.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/internal/dic_node_state_output.h rename to app/src/main/jni/src/suggest/core/dicnode/internal/dic_node_state_output.h diff --git a/app/src/main/native/jni/src/suggest/core/dicnode/internal/dic_node_state_scoring.h b/app/src/main/jni/src/suggest/core/dicnode/internal/dic_node_state_scoring.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dicnode/internal/dic_node_state_scoring.h rename to app/src/main/jni/src/suggest/core/dicnode/internal/dic_node_state_scoring.h diff --git a/app/src/main/native/jni/src/suggest/core/dictionary/dictionary.cpp b/app/src/main/jni/src/suggest/core/dictionary/dictionary.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dictionary/dictionary.cpp rename to app/src/main/jni/src/suggest/core/dictionary/dictionary.cpp diff --git a/app/src/main/native/jni/src/suggest/core/dictionary/dictionary.h b/app/src/main/jni/src/suggest/core/dictionary/dictionary.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dictionary/dictionary.h rename to app/src/main/jni/src/suggest/core/dictionary/dictionary.h diff --git a/app/src/main/native/jni/src/suggest/core/dictionary/dictionary_utils.cpp b/app/src/main/jni/src/suggest/core/dictionary/dictionary_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dictionary/dictionary_utils.cpp rename to app/src/main/jni/src/suggest/core/dictionary/dictionary_utils.cpp diff --git a/app/src/main/native/jni/src/suggest/core/dictionary/dictionary_utils.h b/app/src/main/jni/src/suggest/core/dictionary/dictionary_utils.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dictionary/dictionary_utils.h rename to app/src/main/jni/src/suggest/core/dictionary/dictionary_utils.h diff --git a/app/src/main/native/jni/src/suggest/core/dictionary/digraph_utils.cpp b/app/src/main/jni/src/suggest/core/dictionary/digraph_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dictionary/digraph_utils.cpp rename to app/src/main/jni/src/suggest/core/dictionary/digraph_utils.cpp diff --git a/app/src/main/native/jni/src/suggest/core/dictionary/digraph_utils.h b/app/src/main/jni/src/suggest/core/dictionary/digraph_utils.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dictionary/digraph_utils.h rename to app/src/main/jni/src/suggest/core/dictionary/digraph_utils.h diff --git a/app/src/main/native/jni/src/suggest/core/dictionary/error_type_utils.cpp b/app/src/main/jni/src/suggest/core/dictionary/error_type_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dictionary/error_type_utils.cpp rename to app/src/main/jni/src/suggest/core/dictionary/error_type_utils.cpp diff --git a/app/src/main/native/jni/src/suggest/core/dictionary/error_type_utils.h b/app/src/main/jni/src/suggest/core/dictionary/error_type_utils.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/dictionary/error_type_utils.h rename to app/src/main/jni/src/suggest/core/dictionary/error_type_utils.h diff --git a/app/src/main/native/jni/src/suggest/core/layout/additional_proximity_chars.cpp b/app/src/main/jni/src/suggest/core/layout/additional_proximity_chars.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/additional_proximity_chars.cpp rename to app/src/main/jni/src/suggest/core/layout/additional_proximity_chars.cpp diff --git a/app/src/main/native/jni/src/suggest/core/layout/additional_proximity_chars.h b/app/src/main/jni/src/suggest/core/layout/additional_proximity_chars.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/additional_proximity_chars.h rename to app/src/main/jni/src/suggest/core/layout/additional_proximity_chars.h diff --git a/app/src/main/native/jni/src/suggest/core/layout/geometry_utils.h b/app/src/main/jni/src/suggest/core/layout/geometry_utils.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/geometry_utils.h rename to app/src/main/jni/src/suggest/core/layout/geometry_utils.h diff --git a/app/src/main/native/jni/src/suggest/core/layout/normal_distribution.h b/app/src/main/jni/src/suggest/core/layout/normal_distribution.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/normal_distribution.h rename to app/src/main/jni/src/suggest/core/layout/normal_distribution.h diff --git a/app/src/main/native/jni/src/suggest/core/layout/normal_distribution_2d.h b/app/src/main/jni/src/suggest/core/layout/normal_distribution_2d.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/normal_distribution_2d.h rename to app/src/main/jni/src/suggest/core/layout/normal_distribution_2d.h diff --git a/app/src/main/native/jni/src/suggest/core/layout/proximity_info.cpp b/app/src/main/jni/src/suggest/core/layout/proximity_info.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/proximity_info.cpp rename to app/src/main/jni/src/suggest/core/layout/proximity_info.cpp diff --git a/app/src/main/native/jni/src/suggest/core/layout/proximity_info.h b/app/src/main/jni/src/suggest/core/layout/proximity_info.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/proximity_info.h rename to app/src/main/jni/src/suggest/core/layout/proximity_info.h diff --git a/app/src/main/native/jni/src/suggest/core/layout/proximity_info_params.cpp b/app/src/main/jni/src/suggest/core/layout/proximity_info_params.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/proximity_info_params.cpp rename to app/src/main/jni/src/suggest/core/layout/proximity_info_params.cpp diff --git a/app/src/main/native/jni/src/suggest/core/layout/proximity_info_params.h b/app/src/main/jni/src/suggest/core/layout/proximity_info_params.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/proximity_info_params.h rename to app/src/main/jni/src/suggest/core/layout/proximity_info_params.h diff --git a/app/src/main/native/jni/src/suggest/core/layout/proximity_info_state.cpp b/app/src/main/jni/src/suggest/core/layout/proximity_info_state.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/proximity_info_state.cpp rename to app/src/main/jni/src/suggest/core/layout/proximity_info_state.cpp diff --git a/app/src/main/native/jni/src/suggest/core/layout/proximity_info_state.h b/app/src/main/jni/src/suggest/core/layout/proximity_info_state.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/proximity_info_state.h rename to app/src/main/jni/src/suggest/core/layout/proximity_info_state.h diff --git a/app/src/main/native/jni/src/suggest/core/layout/proximity_info_state_utils.cpp b/app/src/main/jni/src/suggest/core/layout/proximity_info_state_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/proximity_info_state_utils.cpp rename to app/src/main/jni/src/suggest/core/layout/proximity_info_state_utils.cpp diff --git a/app/src/main/native/jni/src/suggest/core/layout/proximity_info_state_utils.h b/app/src/main/jni/src/suggest/core/layout/proximity_info_state_utils.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/proximity_info_state_utils.h rename to app/src/main/jni/src/suggest/core/layout/proximity_info_state_utils.h diff --git a/app/src/main/native/jni/src/suggest/core/layout/proximity_info_utils.h b/app/src/main/jni/src/suggest/core/layout/proximity_info_utils.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/proximity_info_utils.h rename to app/src/main/jni/src/suggest/core/layout/proximity_info_utils.h diff --git a/app/src/main/native/jni/src/suggest/core/layout/touch_position_correction_utils.h b/app/src/main/jni/src/suggest/core/layout/touch_position_correction_utils.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/layout/touch_position_correction_utils.h rename to app/src/main/jni/src/suggest/core/layout/touch_position_correction_utils.h diff --git a/app/src/main/native/jni/src/suggest/core/policy/scoring.h b/app/src/main/jni/src/suggest/core/policy/scoring.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/policy/scoring.h rename to app/src/main/jni/src/suggest/core/policy/scoring.h diff --git a/app/src/main/native/jni/src/suggest/core/policy/suggest_policy.h b/app/src/main/jni/src/suggest/core/policy/suggest_policy.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/policy/suggest_policy.h rename to app/src/main/jni/src/suggest/core/policy/suggest_policy.h diff --git a/app/src/main/native/jni/src/suggest/core/policy/traversal.h b/app/src/main/jni/src/suggest/core/policy/traversal.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/policy/traversal.h rename to app/src/main/jni/src/suggest/core/policy/traversal.h diff --git a/app/src/main/native/jni/src/suggest/core/policy/weighting.cpp b/app/src/main/jni/src/suggest/core/policy/weighting.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/policy/weighting.cpp rename to app/src/main/jni/src/suggest/core/policy/weighting.cpp diff --git a/app/src/main/native/jni/src/suggest/core/policy/weighting.h b/app/src/main/jni/src/suggest/core/policy/weighting.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/policy/weighting.h rename to app/src/main/jni/src/suggest/core/policy/weighting.h diff --git a/app/src/main/native/jni/src/suggest/core/result/suggested_word.h b/app/src/main/jni/src/suggest/core/result/suggested_word.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/result/suggested_word.h rename to app/src/main/jni/src/suggest/core/result/suggested_word.h diff --git a/app/src/main/native/jni/src/suggest/core/result/suggestion_results.cpp b/app/src/main/jni/src/suggest/core/result/suggestion_results.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/result/suggestion_results.cpp rename to app/src/main/jni/src/suggest/core/result/suggestion_results.cpp diff --git a/app/src/main/native/jni/src/suggest/core/result/suggestion_results.h b/app/src/main/jni/src/suggest/core/result/suggestion_results.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/result/suggestion_results.h rename to app/src/main/jni/src/suggest/core/result/suggestion_results.h diff --git a/app/src/main/native/jni/src/suggest/core/result/suggestions_output_utils.cpp b/app/src/main/jni/src/suggest/core/result/suggestions_output_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/result/suggestions_output_utils.cpp rename to app/src/main/jni/src/suggest/core/result/suggestions_output_utils.cpp diff --git a/app/src/main/native/jni/src/suggest/core/result/suggestions_output_utils.h b/app/src/main/jni/src/suggest/core/result/suggestions_output_utils.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/result/suggestions_output_utils.h rename to app/src/main/jni/src/suggest/core/result/suggestions_output_utils.h diff --git a/app/src/main/native/jni/src/suggest/core/session/dic_traverse_session.cpp b/app/src/main/jni/src/suggest/core/session/dic_traverse_session.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/session/dic_traverse_session.cpp rename to app/src/main/jni/src/suggest/core/session/dic_traverse_session.cpp diff --git a/app/src/main/native/jni/src/suggest/core/session/dic_traverse_session.h b/app/src/main/jni/src/suggest/core/session/dic_traverse_session.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/session/dic_traverse_session.h rename to app/src/main/jni/src/suggest/core/session/dic_traverse_session.h diff --git a/app/src/main/native/jni/src/suggest/core/suggest.cpp b/app/src/main/jni/src/suggest/core/suggest.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/core/suggest.cpp rename to app/src/main/jni/src/suggest/core/suggest.cpp diff --git a/app/src/main/native/jni/src/suggest/core/suggest.h b/app/src/main/jni/src/suggest/core/suggest.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/suggest.h rename to app/src/main/jni/src/suggest/core/suggest.h diff --git a/app/src/main/native/jni/src/suggest/core/suggest_interface.h b/app/src/main/jni/src/suggest/core/suggest_interface.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/suggest_interface.h rename to app/src/main/jni/src/suggest/core/suggest_interface.h diff --git a/app/src/main/native/jni/src/suggest/core/suggest_options.h b/app/src/main/jni/src/suggest/core/suggest_options.h similarity index 100% rename from app/src/main/native/jni/src/suggest/core/suggest_options.h rename to app/src/main/jni/src/suggest/core/suggest_options.h diff --git a/app/src/main/native/jni/src/suggest/policyimpl/gesture/gesture_suggest_policy_factory.cpp b/app/src/main/jni/src/suggest/policyimpl/gesture/gesture_suggest_policy_factory.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/gesture/gesture_suggest_policy_factory.cpp rename to app/src/main/jni/src/suggest/policyimpl/gesture/gesture_suggest_policy_factory.cpp diff --git a/app/src/main/native/jni/src/suggest/policyimpl/gesture/gesture_suggest_policy_factory.h b/app/src/main/jni/src/suggest/policyimpl/gesture/gesture_suggest_policy_factory.h similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/gesture/gesture_suggest_policy_factory.h rename to app/src/main/jni/src/suggest/policyimpl/gesture/gesture_suggest_policy_factory.h diff --git a/app/src/main/native/jni/src/suggest/policyimpl/typing/scoring_params.cpp b/app/src/main/jni/src/suggest/policyimpl/typing/scoring_params.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/typing/scoring_params.cpp rename to app/src/main/jni/src/suggest/policyimpl/typing/scoring_params.cpp diff --git a/app/src/main/native/jni/src/suggest/policyimpl/typing/scoring_params.h b/app/src/main/jni/src/suggest/policyimpl/typing/scoring_params.h similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/typing/scoring_params.h rename to app/src/main/jni/src/suggest/policyimpl/typing/scoring_params.h diff --git a/app/src/main/native/jni/src/suggest/policyimpl/typing/typing_scoring.cpp b/app/src/main/jni/src/suggest/policyimpl/typing/typing_scoring.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/typing/typing_scoring.cpp rename to app/src/main/jni/src/suggest/policyimpl/typing/typing_scoring.cpp diff --git a/app/src/main/native/jni/src/suggest/policyimpl/typing/typing_scoring.h b/app/src/main/jni/src/suggest/policyimpl/typing/typing_scoring.h similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/typing/typing_scoring.h rename to app/src/main/jni/src/suggest/policyimpl/typing/typing_scoring.h diff --git a/app/src/main/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy.cpp b/app/src/main/jni/src/suggest/policyimpl/typing/typing_suggest_policy.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy.cpp rename to app/src/main/jni/src/suggest/policyimpl/typing/typing_suggest_policy.cpp diff --git a/app/src/main/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy.h b/app/src/main/jni/src/suggest/policyimpl/typing/typing_suggest_policy.h similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy.h rename to app/src/main/jni/src/suggest/policyimpl/typing/typing_suggest_policy.h diff --git a/app/src/main/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy_factory.h b/app/src/main/jni/src/suggest/policyimpl/typing/typing_suggest_policy_factory.h similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/typing/typing_suggest_policy_factory.h rename to app/src/main/jni/src/suggest/policyimpl/typing/typing_suggest_policy_factory.h diff --git a/app/src/main/native/jni/src/suggest/policyimpl/typing/typing_traversal.cpp b/app/src/main/jni/src/suggest/policyimpl/typing/typing_traversal.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/typing/typing_traversal.cpp rename to app/src/main/jni/src/suggest/policyimpl/typing/typing_traversal.cpp diff --git a/app/src/main/native/jni/src/suggest/policyimpl/typing/typing_traversal.h b/app/src/main/jni/src/suggest/policyimpl/typing/typing_traversal.h similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/typing/typing_traversal.h rename to app/src/main/jni/src/suggest/policyimpl/typing/typing_traversal.h diff --git a/app/src/main/native/jni/src/suggest/policyimpl/typing/typing_weighting.cpp b/app/src/main/jni/src/suggest/policyimpl/typing/typing_weighting.cpp similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/typing/typing_weighting.cpp rename to app/src/main/jni/src/suggest/policyimpl/typing/typing_weighting.cpp diff --git a/app/src/main/native/jni/src/suggest/policyimpl/typing/typing_weighting.h b/app/src/main/jni/src/suggest/policyimpl/typing/typing_weighting.h similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/typing/typing_weighting.h rename to app/src/main/jni/src/suggest/policyimpl/typing/typing_weighting.h diff --git a/app/src/main/native/jni/src/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy.h b/app/src/main/jni/src/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy.h similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy.h rename to app/src/main/jni/src/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy.h diff --git a/app/src/main/native/jni/src/suggest/policyimpl/utils/edit_distance.h b/app/src/main/jni/src/suggest/policyimpl/utils/edit_distance.h similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/utils/edit_distance.h rename to app/src/main/jni/src/suggest/policyimpl/utils/edit_distance.h diff --git a/app/src/main/native/jni/src/suggest/policyimpl/utils/edit_distance_policy.h b/app/src/main/jni/src/suggest/policyimpl/utils/edit_distance_policy.h similarity index 100% rename from app/src/main/native/jni/src/suggest/policyimpl/utils/edit_distance_policy.h rename to app/src/main/jni/src/suggest/policyimpl/utils/edit_distance_policy.h diff --git a/app/src/main/native/jni/src/utils/autocorrection_threshold_utils.cpp b/app/src/main/jni/src/utils/autocorrection_threshold_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/utils/autocorrection_threshold_utils.cpp rename to app/src/main/jni/src/utils/autocorrection_threshold_utils.cpp diff --git a/app/src/main/native/jni/src/utils/autocorrection_threshold_utils.h b/app/src/main/jni/src/utils/autocorrection_threshold_utils.h similarity index 100% rename from app/src/main/native/jni/src/utils/autocorrection_threshold_utils.h rename to app/src/main/jni/src/utils/autocorrection_threshold_utils.h diff --git a/app/src/main/native/jni/src/utils/byte_array_view.h b/app/src/main/jni/src/utils/byte_array_view.h similarity index 100% rename from app/src/main/native/jni/src/utils/byte_array_view.h rename to app/src/main/jni/src/utils/byte_array_view.h diff --git a/app/src/main/native/jni/src/utils/char_utils.cpp b/app/src/main/jni/src/utils/char_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/utils/char_utils.cpp rename to app/src/main/jni/src/utils/char_utils.cpp diff --git a/app/src/main/native/jni/src/utils/char_utils.h b/app/src/main/jni/src/utils/char_utils.h similarity index 100% rename from app/src/main/native/jni/src/utils/char_utils.h rename to app/src/main/jni/src/utils/char_utils.h diff --git a/app/src/main/native/jni/src/utils/int_array_view.h b/app/src/main/jni/src/utils/int_array_view.h similarity index 100% rename from app/src/main/native/jni/src/utils/int_array_view.h rename to app/src/main/jni/src/utils/int_array_view.h diff --git a/app/src/main/native/jni/src/utils/jni_data_utils.cpp b/app/src/main/jni/src/utils/jni_data_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/utils/jni_data_utils.cpp rename to app/src/main/jni/src/utils/jni_data_utils.cpp diff --git a/app/src/main/native/jni/src/utils/jni_data_utils.h b/app/src/main/jni/src/utils/jni_data_utils.h similarity index 100% rename from app/src/main/native/jni/src/utils/jni_data_utils.h rename to app/src/main/jni/src/utils/jni_data_utils.h diff --git a/app/src/main/native/jni/src/utils/log_utils.cpp b/app/src/main/jni/src/utils/log_utils.cpp similarity index 100% rename from app/src/main/native/jni/src/utils/log_utils.cpp rename to app/src/main/jni/src/utils/log_utils.cpp diff --git a/app/src/main/native/jni/src/utils/log_utils.h b/app/src/main/jni/src/utils/log_utils.h similarity index 100% rename from app/src/main/native/jni/src/utils/log_utils.h rename to app/src/main/jni/src/utils/log_utils.h diff --git a/app/src/main/native/jni/src/utils/ngram_utils.h b/app/src/main/jni/src/utils/ngram_utils.h similarity index 100% rename from app/src/main/native/jni/src/utils/ngram_utils.h rename to app/src/main/jni/src/utils/ngram_utils.h diff --git a/app/src/main/native/jni/src/utils/profiler.h b/app/src/main/jni/src/utils/profiler.h similarity index 100% rename from app/src/main/native/jni/src/utils/profiler.h rename to app/src/main/jni/src/utils/profiler.h diff --git a/app/src/main/native/jni/src/utils/time_keeper.cpp b/app/src/main/jni/src/utils/time_keeper.cpp similarity index 100% rename from app/src/main/native/jni/src/utils/time_keeper.cpp rename to app/src/main/jni/src/utils/time_keeper.cpp diff --git a/app/src/main/native/jni/src/utils/time_keeper.h b/app/src/main/jni/src/utils/time_keeper.h similarity index 100% rename from app/src/main/native/jni/src/utils/time_keeper.h rename to app/src/main/jni/src/utils/time_keeper.h diff --git a/app/src/main/native/jni/tests/defines_test.cpp b/app/src/main/jni/tests/defines_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/defines_test.cpp rename to app/src/main/jni/tests/defines_test.cpp diff --git a/app/src/main/native/jni/tests/dictionary/header/header_read_write_utils_test.cpp b/app/src/main/jni/tests/dictionary/header/header_read_write_utils_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/dictionary/header/header_read_write_utils_test.cpp rename to app/src/main/jni/tests/dictionary/header/header_read_write_utils_test.cpp diff --git a/app/src/main/native/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 similarity index 100% rename from app/src/main/native/jni/tests/dictionary/structure/v4/content/language_model_dict_content_global_counters_test.cpp rename to app/src/main/jni/tests/dictionary/structure/v4/content/language_model_dict_content_global_counters_test.cpp diff --git a/app/src/main/native/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 similarity index 100% rename from app/src/main/native/jni/tests/dictionary/structure/v4/content/language_model_dict_content_test.cpp rename to app/src/main/jni/tests/dictionary/structure/v4/content/language_model_dict_content_test.cpp diff --git a/app/src/main/native/jni/tests/dictionary/structure/v4/content/probability_entry_test.cpp b/app/src/main/jni/tests/dictionary/structure/v4/content/probability_entry_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/dictionary/structure/v4/content/probability_entry_test.cpp rename to app/src/main/jni/tests/dictionary/structure/v4/content/probability_entry_test.cpp diff --git a/app/src/main/native/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 similarity index 100% rename from app/src/main/native/jni/tests/dictionary/structure/v4/content/terminal_position_lookup_table_test.cpp rename to app/src/main/jni/tests/dictionary/structure/v4/content/terminal_position_lookup_table_test.cpp diff --git a/app/src/main/native/jni/tests/dictionary/utils/bloom_filter_test.cpp b/app/src/main/jni/tests/dictionary/utils/bloom_filter_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/dictionary/utils/bloom_filter_test.cpp rename to app/src/main/jni/tests/dictionary/utils/bloom_filter_test.cpp diff --git a/app/src/main/native/jni/tests/dictionary/utils/buffer_with_extendable_buffer_test.cpp b/app/src/main/jni/tests/dictionary/utils/buffer_with_extendable_buffer_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/dictionary/utils/buffer_with_extendable_buffer_test.cpp rename to app/src/main/jni/tests/dictionary/utils/buffer_with_extendable_buffer_test.cpp diff --git a/app/src/main/native/jni/tests/dictionary/utils/byte_array_utils_test.cpp b/app/src/main/jni/tests/dictionary/utils/byte_array_utils_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/dictionary/utils/byte_array_utils_test.cpp rename to app/src/main/jni/tests/dictionary/utils/byte_array_utils_test.cpp diff --git a/app/src/main/native/jni/tests/dictionary/utils/format_utils_test.cpp b/app/src/main/jni/tests/dictionary/utils/format_utils_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/dictionary/utils/format_utils_test.cpp rename to app/src/main/jni/tests/dictionary/utils/format_utils_test.cpp diff --git a/app/src/main/native/jni/tests/dictionary/utils/probability_utils_test.cpp b/app/src/main/jni/tests/dictionary/utils/probability_utils_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/dictionary/utils/probability_utils_test.cpp rename to app/src/main/jni/tests/dictionary/utils/probability_utils_test.cpp diff --git a/app/src/main/native/jni/tests/dictionary/utils/sparse_table_test.cpp b/app/src/main/jni/tests/dictionary/utils/sparse_table_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/dictionary/utils/sparse_table_test.cpp rename to app/src/main/jni/tests/dictionary/utils/sparse_table_test.cpp diff --git a/app/src/main/native/jni/tests/dictionary/utils/trie_map_test.cpp b/app/src/main/jni/tests/dictionary/utils/trie_map_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/dictionary/utils/trie_map_test.cpp rename to app/src/main/jni/tests/dictionary/utils/trie_map_test.cpp diff --git a/app/src/main/native/jni/tests/suggest/core/dicnode/dic_node_pool_test.cpp b/app/src/main/jni/tests/suggest/core/dicnode/dic_node_pool_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/suggest/core/dicnode/dic_node_pool_test.cpp rename to app/src/main/jni/tests/suggest/core/dicnode/dic_node_pool_test.cpp diff --git a/app/src/main/native/jni/tests/suggest/core/layout/geometry_utils_test.cpp b/app/src/main/jni/tests/suggest/core/layout/geometry_utils_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/suggest/core/layout/geometry_utils_test.cpp rename to app/src/main/jni/tests/suggest/core/layout/geometry_utils_test.cpp diff --git a/app/src/main/native/jni/tests/suggest/core/layout/normal_distribution_2d_test.cpp b/app/src/main/jni/tests/suggest/core/layout/normal_distribution_2d_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/suggest/core/layout/normal_distribution_2d_test.cpp rename to app/src/main/jni/tests/suggest/core/layout/normal_distribution_2d_test.cpp diff --git a/app/src/main/native/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 similarity index 100% rename from app/src/main/native/jni/tests/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy_test.cpp rename to app/src/main/jni/tests/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy_test.cpp diff --git a/app/src/main/native/jni/tests/utils/autocorrection_threshold_utils_test.cpp b/app/src/main/jni/tests/utils/autocorrection_threshold_utils_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/utils/autocorrection_threshold_utils_test.cpp rename to app/src/main/jni/tests/utils/autocorrection_threshold_utils_test.cpp diff --git a/app/src/main/native/jni/tests/utils/char_utils_test.cpp b/app/src/main/jni/tests/utils/char_utils_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/utils/char_utils_test.cpp rename to app/src/main/jni/tests/utils/char_utils_test.cpp diff --git a/app/src/main/native/jni/tests/utils/int_array_view_test.cpp b/app/src/main/jni/tests/utils/int_array_view_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/utils/int_array_view_test.cpp rename to app/src/main/jni/tests/utils/int_array_view_test.cpp diff --git a/app/src/main/native/jni/tests/utils/time_keeper_test.cpp b/app/src/main/jni/tests/utils/time_keeper_test.cpp similarity index 100% rename from app/src/main/native/jni/tests/utils/time_keeper_test.cpp rename to app/src/main/jni/tests/utils/time_keeper_test.cpp diff --git a/app/src/main/native/Android.mk b/app/src/main/native/Android.mk deleted file mode 100755 index 5053e7d64..000000000 --- a/app/src/main/native/Android.mk +++ /dev/null @@ -1 +0,0 @@ -include $(call all-subdir-makefiles) diff --git a/app/src/main/native/dicttoolkit/Android.bp b/app/src/main/native/dicttoolkit/Android.bp deleted file mode 100644 index b214ff984..000000000 --- a/app/src/main/native/dicttoolkit/Android.bp +++ /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. - -cc_defaults { - name: "dicttoolkit_defaults", - - 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", - - // To suppress compiler warnings for unused variables/functions used for debug features etc. - "-Wno-unused-parameter", - "-Wno-unused-function", - ], - - local_include_dirs: ["src"], - // TODO - include_dirs: ["packages/inputmethods/LatinIME/native/jni/src"], - - product_variables: { - unbundled_build: { - enabled: false, - }, - }, -} - -cc_library_host_static { - name: "liblatinime_dicttoolkit", - defaults: ["dicttoolkit_defaults"], - - srcs: [ - "src/command_executors/diff_executor.cpp", - "src/command_executors/header_executor.cpp", - "src/command_executors/help_executor.cpp", - "src/command_executors/info_executor.cpp", - "src/command_executors/makedict_executor.cpp", - "src/offdevice_intermediate_dict/offdevice_intermediate_dict.cpp", - "src/utils/arguments_parser.cpp", - "src/utils/command_utils.cpp", - "src/utils/utf8_utils.cpp", - - ":LATIN_IME_CORE_SRC_FILES", - ], -} - -cc_binary_host { - name: "dicttoolkit", - defaults: ["dicttoolkit_defaults"], - - srcs: ["dict_toolkit_main.cpp"], - static_libs: ["liblatinime_dicttoolkit"], -} - -cc_test_host { - name: "dicttoolkit_unittests", - defaults: ["dicttoolkit_defaults"], - - srcs: [ - "tests/command_executors/diff_executor_test.cpp", - "tests/command_executors/header_executor_test.cpp", - "tests/command_executors/info_executor_test.cpp", - "tests/command_executors/makedict_executor_test.cpp", - "tests/dict_toolkit_defines_test.cpp", - "tests/offdevice_intermediate_dict/offdevice_intermediate_dict_test.cpp", - "tests/utils/arguments_parser_test.cpp", - "tests/utils/command_utils_test.cpp", - "tests/utils/utf8_utils_test.cpp", - ], - static_libs: ["liblatinime_dicttoolkit"], -} diff --git a/app/src/main/native/dicttoolkit/Android.mk b/app/src/main/native/dicttoolkit/Android.mk deleted file mode 100755 index beaff573a..000000000 --- a/app/src/main/native/dicttoolkit/Android.mk +++ /dev/null @@ -1,67 +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. - -ifeq (,$(TARGET_BUILD_APPS)) - -# Only build if it's explicitly requested, or running mm/mmm. -ifneq ($(ONE_SHOT_MAKEFILE)$(filter $(MAKECMDGOALS),dicttoolkit),) - -# 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) - -LATIN_IME_CORE_PATH := $(LOCAL_PATH)/../jni - -LATIN_IME_DICT_TOOLKIT_SRC_DIR := src -LATIN_IME_CORE_SRC_DIR := ../jni/src - -LOCAL_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 - -# To suppress compiler warnings for unused variables/functions used for debug features etc. -LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function -LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-function - -include $(LOCAL_PATH)/NativeFileList.mk -include $(LATIN_IME_CORE_PATH)/NativeFileList.mk - -LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(LATIN_IME_DICT_TOOLKIT_SRC_DIR) \ - $(LATIN_IME_CORE_PATH)/$(LATIN_IME_CORE_SRC_DIR) - -LOCAL_SRC_FILES := $(LATIN_IME_DICT_TOOLKIT_MAIN_SRC_FILES) \ - $(addprefix $(LATIN_IME_DICT_TOOLKIT_SRC_DIR)/, $(LATIN_IME_DICT_TOOLKIT_SRC_FILES)) \ - $(addprefix $(LATIN_IME_CORE_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES)) - -LOCAL_MODULE := dicttoolkit -LOCAL_MODULE_TAGS := optional - -LOCAL_CLANG := true -LOCAL_CXX_STL := libc++ - -include $(BUILD_HOST_EXECUTABLE) -#################### Clean up the tmp vars -include $(LOCAL_PATH)/CleanupNativeFileList.mk -#################### Unit test -#include $(LOCAL_PATH)/UnitTests.mk - -endif # Darwin - TODO: Remove this - -endif - -endif # TARGET_BUILD_APPS diff --git a/app/src/main/native/dicttoolkit/CleanupNativeFileList.mk b/app/src/main/native/dicttoolkit/CleanupNativeFileList.mk deleted file mode 100755 index b804b41ed..000000000 --- a/app/src/main/native/dicttoolkit/CleanupNativeFileList.mk +++ /dev/null @@ -1,17 +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. - -LATIN_IME_DICT_TOOLKIT_MAIN_SRC_FILES := -LATIN_IME_DICT_TOOLKIT_SRC_FILES := -LATIN_IME_DICT_TOOLKIT_TEST_FILES := diff --git a/app/src/main/native/dicttoolkit/NativeFileList.mk b/app/src/main/native/dicttoolkit/NativeFileList.mk deleted file mode 100755 index 9a547b054..000000000 --- a/app/src/main/native/dicttoolkit/NativeFileList.mk +++ /dev/null @@ -1,44 +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. - -LATIN_IME_DICT_TOOLKIT_MAIN_SRC_FILES := \ - dict_toolkit_main.cpp - -LATIN_IME_DICT_TOOLKIT_SRC_FILES := \ - $(addprefix command_executors/, \ - diff_executor.cpp \ - header_executor.cpp \ - help_executor.cpp \ - info_executor.cpp \ - makedict_executor.cpp) \ - $(addprefix offdevice_intermediate_dict/, \ - offdevice_intermediate_dict.cpp) \ - $(addprefix utils/, \ - arguments_parser.cpp \ - command_utils.cpp \ - utf8_utils.cpp) - -LATIN_IME_DICT_TOOLKIT_TEST_FILES := \ - $(addprefix command_executors/, \ - diff_executor_test.cpp \ - header_executor_test.cpp \ - info_executor_test.cpp \ - makedict_executor_test.cpp) \ - dict_toolkit_defines_test.cpp \ - $(addprefix offdevice_intermediate_dict/, \ - offdevice_intermediate_dict_test.cpp) \ - $(addprefix utils/, \ - arguments_parser_test.cpp \ - command_utils_test.cpp \ - utf8_utils_test.cpp) diff --git a/app/src/main/native/dicttoolkit/UnitTests.mk b/app/src/main/native/dicttoolkit/UnitTests.mk deleted file mode 100755 index da1b3767c..000000000 --- a/app/src/main/native/dicttoolkit/UnitTests.mk +++ /dev/null @@ -1,67 +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. - -ifeq (,$(TARGET_BUILD_APPS)) - -LOCAL_PATH := $(call my-dir) - -###################################### -include $(CLEAR_VARS) - -LATIN_IME_CORE_PATH := $(LOCAL_PATH)/../jni - -LATIN_IME_DICT_TOOLKIT_SRC_DIR := src -LATIN_IME_CORE_SRC_DIR := ../jni/src -LATIN_DICT_TOOLKIT_TEST_SRC_DIR := tests - -include $(LOCAL_PATH)/NativeFileList.mk -include $(LATIN_IME_CORE_PATH)/NativeFileList.mk - -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_DICT_TOOLKIT_SRC_DIR) \ - $(LATIN_IME_CORE_PATH)/$(LATIN_IME_CORE_SRC_DIR) -LOCAL_MODULE := liblatinime_dicttoolkit_host_static_for_unittests -LOCAL_MODULE_TAGS := optional -LOCAL_SRC_FILES := \ - $(addprefix $(LATIN_IME_DICT_TOOLKIT_SRC_DIR)/, $(LATIN_IME_DICT_TOOLKIT_SRC_FILES)) \ - $(addprefix $(LATIN_IME_CORE_SRC_DIR)/, $(LATIN_IME_CORE_SRC_FILES)) -include $(BUILD_HOST_STATIC_LIBRARY) - -include $(CLEAR_VARS) - -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_DICT_TOOLKIT_SRC_DIR) \ - $(LATIN_IME_CORE_PATH)/$(LATIN_IME_CORE_SRC_DIR) -LOCAL_MODULE := dicttoolkit_unittests -LOCAL_MODULE_TAGS := tests -LOCAL_SRC_FILES := \ - $(addprefix $(LATIN_DICT_TOOLKIT_TEST_SRC_DIR)/, $(LATIN_IME_DICT_TOOLKIT_TEST_FILES)) -LOCAL_STATIC_LIBRARIES += liblatinime_dicttoolkit_host_static_for_unittests -include $(BUILD_HOST_NATIVE_TEST) - -include $(LOCAL_PATH)/CleanupNativeFileList.mk - -#################### Clean up the tmp vars -LATINIME_HOST_OSNAME := -LATIN_IME_SRC_DIR := -LATIN_IME_TEST_SRC_DIR := - -endif # TARGET_BUILD_APPS diff --git a/app/src/main/native/dicttoolkit/dict_toolkit_main.cpp b/app/src/main/native/dicttoolkit/dict_toolkit_main.cpp deleted file mode 100644 index 53cc5e915..000000000 --- a/app/src/main/native/dicttoolkit/dict_toolkit_main.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 - -#include "dict_toolkit_defines.h" -#include "utils/command_utils.h" - -void usage(int argc, char **argv) { - fprintf(stderr, "Usage: %s [arguments]\n", argc > 0 ? argv[0] : "dicttoolkit"); -} - -int main(int argc, char **argv) { - if (argc < MIN_ARG_COUNT) { - usage(argc, argv); - return 1; - } - using namespace latinime::dicttoolkit; - const CommandType commandType = CommandUtils::getCommandType(argv[1]); - if (commandType == CommandType::Unknown) { - CommandUtils::printCommandUnknownMessage(argv[0], argv[1]); - return 1; - } - const auto executor = CommandUtils::getCommandExecutor(commandType); - return executor(argc - 1, argv + 1); -} diff --git a/app/src/main/native/dicttoolkit/run_tests.sh b/app/src/main/native/dicttoolkit/run_tests.sh deleted file mode 100755 index 44c99c144..000000000 --- a/app/src/main/native/dicttoolkit/run_tests.sh +++ /dev/null @@ -1,34 +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. - -# check script arguments -if [[ $(type -t mmm) != function ]]; then -if [[ ${BASH_SOURCE[0]} != $0 ]]; then return; else exit 1; fi -fi - -# Host build is never supported in unbundled (NDK/tapas) build -if [[ -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 - -test_name=dicttoolkit_unittests - -pushd $PWD > /dev/null -cd $(gettop) -(mmm -j16 packages/inputmethods/LatinIME/native/dicttoolkit) || (make -j16 $test_name) -$ANDROID_HOST_OUT/bin/$test_name -popd > /dev/null diff --git a/app/src/main/native/dicttoolkit/src/command_executors/diff_executor.cpp b/app/src/main/native/dicttoolkit/src/command_executors/diff_executor.cpp deleted file mode 100644 index bf6830686..000000000 --- a/app/src/main/native/dicttoolkit/src/command_executors/diff_executor.cpp +++ /dev/null @@ -1,49 +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 "command_executors/diff_executor.h" - -#include - -namespace latinime { -namespace dicttoolkit { - -const char *const DiffExecutor::COMMAND_NAME = "diff"; - -/* static */ int DiffExecutor::run(const int argc, char **argv) { - fprintf(stderr, "Command '%s' has not been implemented yet.\n", COMMAND_NAME); - return 0; -} - -/* static */ void DiffExecutor::printUsage() { - printf("*** %s\n", COMMAND_NAME); - getArgumentsParser().printUsage(COMMAND_NAME, "Shows differences between two dictionaries."); -} - -/* static */ const ArgumentsParser DiffExecutor::getArgumentsParser() { - std::unordered_map optionSpecs; - optionSpecs["p"] = OptionSpec::switchOption("(plumbing) produce output suitable for a script"); - - const std::vector argumentSpecs = { - ArgumentSpec::singleArgument("dict1", "dictionary file"), - ArgumentSpec::singleArgument("dict2", "dictionary file") - }; - - return ArgumentsParser(std::move(optionSpecs), std::move(argumentSpecs)); -} - -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/src/command_executors/diff_executor.h b/app/src/main/native/dicttoolkit/src/command_executors/diff_executor.h deleted file mode 100644 index f92ae49d5..000000000 --- a/app/src/main/native/dicttoolkit/src/command_executors/diff_executor.h +++ /dev/null @@ -1,40 +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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_DIFF_EXECUTOR_H -#define LATINIME_DICT_TOOLKIT_DIFF_EXECUTOR_H - -#include "dict_toolkit_defines.h" -#include "utils/arguments_parser.h" - -namespace latinime { -namespace dicttoolkit { - -class DiffExecutor final { - public: - static const char *const COMMAND_NAME; - - static int run(const int argc, char **argv); - static void printUsage(); - static const ArgumentsParser getArgumentsParser(); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(DiffExecutor); -}; - -} // namespace dicttoolkit -} // namepsace latinime -#endif // LATINIME_DICT_TOOLKIT_DIFF_EXECUTOR_H diff --git a/app/src/main/native/dicttoolkit/src/command_executors/header_executor.cpp b/app/src/main/native/dicttoolkit/src/command_executors/header_executor.cpp deleted file mode 100644 index b3d273b4e..000000000 --- a/app/src/main/native/dicttoolkit/src/command_executors/header_executor.cpp +++ /dev/null @@ -1,48 +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 "command_executors/header_executor.h" - -#include - -namespace latinime { -namespace dicttoolkit { - -const char *const HeaderExecutor::COMMAND_NAME = "header"; - -/* static */ int HeaderExecutor::run(const int argc, char **argv) { - fprintf(stderr, "Command '%s' has not been implemented yet.\n", COMMAND_NAME); - return 0; -} - -/* static */ void HeaderExecutor::printUsage() { - printf("*** %s\n", COMMAND_NAME); - getArgumentsParser().printUsage(COMMAND_NAME, - "Prints the header contents of a dictionary file."); -} - -/* static */ const ArgumentsParser HeaderExecutor::getArgumentsParser() { - std::unordered_map optionSpecs; - optionSpecs["p"] = OptionSpec::switchOption("(plumbing) produce output suitable for a script"); - - const std::vector argumentSpecs = { - ArgumentSpec::singleArgument("dict", "prints the header contents of a dictionary file") - }; - - return ArgumentsParser(std::move(optionSpecs), std::move(argumentSpecs)); -} -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/src/command_executors/header_executor.h b/app/src/main/native/dicttoolkit/src/command_executors/header_executor.h deleted file mode 100644 index 44cc9cfc4..000000000 --- a/app/src/main/native/dicttoolkit/src/command_executors/header_executor.h +++ /dev/null @@ -1,40 +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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_HEADER_EXECUTOR_H -#define LATINIME_DICT_TOOLKIT_HEADER_EXECUTOR_H - -#include "dict_toolkit_defines.h" -#include "utils/arguments_parser.h" - -namespace latinime { -namespace dicttoolkit { - -class HeaderExecutor final { - public: - static const char *const COMMAND_NAME; - - static int run(const int argc, char **argv); - static void printUsage(); - static const ArgumentsParser getArgumentsParser(); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(HeaderExecutor); -}; - -} // namespace dicttoolkit -} // namepsace latinime -#endif // LATINIME_DICT_TOOLKIT_HEADER_EXECUTOR_H diff --git a/app/src/main/native/dicttoolkit/src/command_executors/help_executor.cpp b/app/src/main/native/dicttoolkit/src/command_executors/help_executor.cpp deleted file mode 100644 index bd29a5b16..000000000 --- a/app/src/main/native/dicttoolkit/src/command_executors/help_executor.cpp +++ /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. - */ - -#include "command_executors/help_executor.h" - -#include -#include -#include - -#include "command_executors/diff_executor.h" -#include "command_executors/header_executor.h" -#include "command_executors/info_executor.h" -#include "command_executors/makedict_executor.h" -#include "utils/command_utils.h" - -namespace latinime { -namespace dicttoolkit { - -const char *const HelpExecutor::COMMAND_NAME = "help"; - -/* static */ int HelpExecutor::run(const int argc, char **argv) { - printf("Available commands:\n\n"); - const std::vector> printUsageMethods = {DiffExecutor::printUsage, - HeaderExecutor::printUsage, InfoExecutor::printUsage, MakedictExecutor::printUsage, - printUsage}; - for (const auto &printUsageMethod : printUsageMethods) { - printUsageMethod(); - } - return 0; -} - -/* static */ void HelpExecutor::printUsage() { - printf("*** %s\n", COMMAND_NAME); - printf("Usage: %s\n", COMMAND_NAME); - printf("Show this help list.\n\n"); -} - -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/src/command_executors/help_executor.h b/app/src/main/native/dicttoolkit/src/command_executors/help_executor.h deleted file mode 100644 index 280610eb9..000000000 --- a/app/src/main/native/dicttoolkit/src/command_executors/help_executor.h +++ /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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_HELP_EXECUTOR_H -#define LATINIME_DICT_TOOLKIT_HELP_EXECUTOR_H - -#include "dict_toolkit_defines.h" - -namespace latinime { -namespace dicttoolkit { - -class HelpExecutor final { - public: - static const char *const COMMAND_NAME; - - static int run(const int argc, char **argv); - static void printUsage(); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(HelpExecutor); -}; - -} // namespace dicttoolkit -} // namepsace latinime -#endif // LATINIME_DICT_TOOLKIT_HELP_EXECUTOR_H diff --git a/app/src/main/native/dicttoolkit/src/command_executors/info_executor.cpp b/app/src/main/native/dicttoolkit/src/command_executors/info_executor.cpp deleted file mode 100644 index 351da4aff..000000000 --- a/app/src/main/native/dicttoolkit/src/command_executors/info_executor.cpp +++ /dev/null @@ -1,54 +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 "command_executors/info_executor.h" - -#include -#include -#include -#include - -namespace latinime { -namespace dicttoolkit { - -const char *const InfoExecutor::COMMAND_NAME = "info"; - -/* static */ int InfoExecutor::run(const int argc, char **argv) { - fprintf(stderr, "Command '%s' has not been implemented yet.\n", COMMAND_NAME); - return 0; -} - -/* static */ void InfoExecutor::printUsage() { - printf("*** %s\n", COMMAND_NAME); - getArgumentsParser().printUsage(COMMAND_NAME, - "Prints various information about a dictionary file."); -} - -/* static */const ArgumentsParser InfoExecutor::getArgumentsParser() { - std::unordered_map optionSpecs; - optionSpecs["p"] = OptionSpec::switchOption("(plumbing) produce output suitable for a script"); - - const std::vector argumentSpecs = { - ArgumentSpec::singleArgument("dict", "dictionary file name"), - ArgumentSpec::variableLengthArguments("word", 0 /* minCount */, - ArgumentSpec::UNLIMITED_COUNT, "word to show information") - }; - - return ArgumentsParser(std::move(optionSpecs), std::move(argumentSpecs)); -} - -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/src/command_executors/info_executor.h b/app/src/main/native/dicttoolkit/src/command_executors/info_executor.h deleted file mode 100644 index d4106d59f..000000000 --- a/app/src/main/native/dicttoolkit/src/command_executors/info_executor.h +++ /dev/null @@ -1,40 +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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_INFO_EXECUTOR_H -#define LATINIME_DICT_TOOLKIT_INFO_EXECUTOR_H - -#include "dict_toolkit_defines.h" -#include "utils/arguments_parser.h" - -namespace latinime { -namespace dicttoolkit { - -class InfoExecutor final { - public: - static const char *const COMMAND_NAME; - - static int run(const int argc, char **argv); - static void printUsage(); - static const ArgumentsParser getArgumentsParser(); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(InfoExecutor); -}; - -} // namepsace dicttoolkit -} // namespace latinime -#endif // LATINIME_DICT_TOOLKIT_INFO_EXECUTOR_H diff --git a/app/src/main/native/dicttoolkit/src/command_executors/makedict_executor.cpp b/app/src/main/native/dicttoolkit/src/command_executors/makedict_executor.cpp deleted file mode 100644 index 4b0a5aeea..000000000 --- a/app/src/main/native/dicttoolkit/src/command_executors/makedict_executor.cpp +++ /dev/null @@ -1,61 +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 "command_executors/makedict_executor.h" - -#include - -namespace latinime { -namespace dicttoolkit { - -const char *const MakedictExecutor::COMMAND_NAME = "makedict"; - -/* static */ int MakedictExecutor::run(const int argc, char **argv) { - const ArgumentsAndOptions argumentsAndOptions = - getArgumentsParser().parseArguments(argc, argv, true /* printErrorMessages */); - if (!argumentsAndOptions.isValid()) { - printUsage(); - return 1; - } - fprintf(stderr, "Command '%s' has not been implemented yet.\n", COMMAND_NAME); - return 0; -} - -/* static */ void MakedictExecutor::printUsage() { - printf("*** %s\n", COMMAND_NAME); - getArgumentsParser().printUsage(COMMAND_NAME, - "Converts a source dictionary file to one or several outputs.\n" - "Source can be a binary dictionary file or a combined format file.\n" - "Binary version 2 (Jelly Bean), 4, and combined format outputs are supported."); -} - -/* static */const ArgumentsParser MakedictExecutor::getArgumentsParser() { - std::unordered_map optionSpecs; - optionSpecs["o"] = OptionSpec::keyValueOption("format", "2", - "output format version: 2/4/combined"); - optionSpecs["t"] = OptionSpec::keyValueOption("mode", "off", - "code point table switch: on/off/auto"); - - const std::vector argumentSpecs = { - ArgumentSpec::singleArgument("src_dict", "source dictionary file"), - ArgumentSpec::singleArgument("dest_dict", "output dictionary file") - }; - - return ArgumentsParser(std::move(optionSpecs), std::move(argumentSpecs)); -} - -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/src/command_executors/makedict_executor.h b/app/src/main/native/dicttoolkit/src/command_executors/makedict_executor.h deleted file mode 100644 index c3de977a3..000000000 --- a/app/src/main/native/dicttoolkit/src/command_executors/makedict_executor.h +++ /dev/null @@ -1,40 +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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_MAKEDICT_EXECUTOR_H -#define LATINIME_DICT_TOOLKIT_MAKEDICT_EXECUTOR_H - -#include "dict_toolkit_defines.h" -#include "utils/arguments_parser.h" - -namespace latinime { -namespace dicttoolkit { - -class MakedictExecutor final { - public: - static const char *const COMMAND_NAME; - - static int run(const int argc, char **argv); - static void printUsage(); - static const ArgumentsParser getArgumentsParser(); - - private: - DISALLOW_IMPLICIT_CONSTRUCTORS(MakedictExecutor); -}; - -} // namespace dicttoolkit -} // namepsace latinime -#endif // LATINIME_DICT_TOOLKIT_MAKEDICT_EXECUTOR_H diff --git a/app/src/main/native/dicttoolkit/src/dict_toolkit_defines.h b/app/src/main/native/dicttoolkit/src/dict_toolkit_defines.h deleted file mode 100644 index dbaae0ca0..000000000 --- a/app/src/main/native/dicttoolkit/src/dict_toolkit_defines.h +++ /dev/null @@ -1,24 +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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_DEFINES_H -#define LATINIME_DICT_TOOLKIT_DEFINES_H - -#include "defines.h" - -#define MIN_ARG_COUNT 2 - -#endif // LATINIME_DICT_TOOLKIT_DEFINES_H diff --git a/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict.cpp b/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict.cpp deleted file mode 100644 index e94a9c2ff..000000000 --- a/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict.cpp +++ /dev/null @@ -1,126 +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 "offdevice_intermediate_dict/offdevice_intermediate_dict.h" - -#include "offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node.h" - -namespace latinime { -namespace dicttoolkit { - -bool OffdeviceIntermediateDict::addWord(const WordProperty &wordProperty) { - const CodePointArrayView codePoints = wordProperty.getCodePoints(); - if (codePoints.empty() || codePoints.size() > MAX_WORD_LENGTH) { - return false; - } - return addWordInner(codePoints, wordProperty, mRootPtNodeArray); -} - -bool OffdeviceIntermediateDict::addWordInner(const CodePointArrayView codePoints, - const WordProperty &wordProperty, OffdeviceIntermediateDictPtNodeArray &ptNodeArray) { - auto ptNodeList = ptNodeArray.getMutablePtNodeList(); - auto ptNodeIt = ptNodeList->begin(); - for (; ptNodeIt != ptNodeList->end(); ++ptNodeIt) { - const auto &ptNode = *ptNodeIt; - const CodePointArrayView ptNodeCodePoints = ptNode->getPtNodeCodePoints(); - if (codePoints[0] < ptNodeCodePoints[0]) { - continue; - } - if (codePoints[0] > ptNodeCodePoints[0]) { - break; - } - size_t i = 1; - for (; i < codePoints.size(); ++i) { - if (i >= ptNodeCodePoints.size()) { - // Add new child. - return addWordInner(codePoints.skip(i), wordProperty, - ptNode->getChildrenPtNodeArray()); - } - if (codePoints[i] != ptNodeCodePoints[i]) { - break; - } - } - if (codePoints.size() == i && codePoints.size() == ptNodeCodePoints.size()) { - // All code points matched. - if (ptNode->getWordProperty()) { - // Adding the same word multiple times is not supported. - return false; - } - ptNodeList->insert(ptNodeIt, - std::make_shared(wordProperty, *ptNode)); - ptNodeList->erase(ptNodeIt); - return true; - } - // The (i+1)-th elements are different. - // Create and Add new parent ptNode for the common part. - auto newPtNode = codePoints.size() == i - ? std::make_shared(codePoints, wordProperty) - : std::make_shared(codePoints.limit(i)); - ptNodeList->insert(ptNodeIt, newPtNode); - OffdeviceIntermediateDictPtNodeArray &childrenPtNodeArray = - newPtNode->getChildrenPtNodeArray(); - // Add new child for the existing ptNode. - childrenPtNodeArray.getMutablePtNodeList()->push_back( - std::make_shared( - ptNodeCodePoints.skip(i), *ptNode)); - ptNodeList->erase(ptNodeIt); - if (codePoints.size() != i) { - // Add a child for the new word. - return addWordInner(codePoints.skip(i), wordProperty, childrenPtNodeArray); - } - return true; - } - ptNodeList->insert(ptNodeIt, - std::make_shared(codePoints, wordProperty)); - return true; -} - -const WordProperty *OffdeviceIntermediateDict::getWordProperty( - const CodePointArrayView codePoints) const { - const OffdeviceIntermediateDictPtNodeArray *ptNodeArray = &mRootPtNodeArray; - for (size_t i = 0; i < codePoints.size();) { - bool foundNext = false; - for (const auto& ptNode : ptNodeArray->getPtNodeList()) { - const CodePointArrayView ptNodeCodePoints = ptNode->getPtNodeCodePoints(); - if (codePoints[i] < ptNodeCodePoints[0]) { - continue; - } - if (codePoints[i] > ptNodeCodePoints[0] - || codePoints.size() < ptNodeCodePoints.size()) { - return nullptr; - } - for (size_t j = 1; j < ptNodeCodePoints.size(); ++j) { - if (codePoints[i + j] != ptNodeCodePoints[j]) { - return nullptr; - } - } - i += ptNodeCodePoints.size(); - if (i == codePoints.size()) { - return ptNode->getWordProperty(); - } - ptNodeArray = &ptNode->getChildrenPtNodeArray(); - foundNext = true; - break; - } - if (!foundNext) { - break; - } - } - return nullptr; -} - -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict.h b/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict.h deleted file mode 100644 index ea17a31d3..000000000 --- a/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict.h +++ /dev/null @@ -1,54 +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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_OFFDEVICE_INTERMEDIATE_DICT_H -#define LATINIME_DICT_TOOLKIT_OFFDEVICE_INTERMEDIATE_DICT_H - -#include "dict_toolkit_defines.h" -#include "offdevice_intermediate_dict/offdevice_intermediate_dict_header.h" -#include "offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node_array.h" -#include "dictionary/property/word_property.h" -#include "utils/int_array_view.h" - -namespace latinime { -namespace dicttoolkit { - -/** - * On memory patricia trie to represent a dictionary. - */ -class OffdeviceIntermediateDict final { - public: - OffdeviceIntermediateDict(const OffdeviceIntermediateDictHeader &header) - : mHeader(header), mRootPtNodeArray() {} - - bool addWord(const WordProperty &wordProperty); - // The returned value will be invalid after modifying the dictionary. e.g. calling addWord(). - const WordProperty *getWordProperty(const CodePointArrayView codePoints) const; - const OffdeviceIntermediateDictHeader &getHeader() const { return mHeader; } - - private: - DISALLOW_ASSIGNMENT_OPERATOR(OffdeviceIntermediateDict); - - const OffdeviceIntermediateDictHeader mHeader; - OffdeviceIntermediateDictPtNodeArray mRootPtNodeArray; - - bool addWordInner(const CodePointArrayView codePoints, const WordProperty &wordProperty, - OffdeviceIntermediateDictPtNodeArray &ptNodeArray); -}; - -} // namespace dicttoolkit -} // namespace latinime -#endif // LATINIME_DICT_TOOLKIT_OFFDEVICE_INTERMEDIATE_DICT_H diff --git a/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_header.h b/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_header.h deleted file mode 100644 index 440627a79..000000000 --- a/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_header.h +++ /dev/null @@ -1,44 +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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_OFFDEVICE_INTERMEDIATE_DICT_HEADER_H -#define LATINIME_DICT_TOOLKIT_OFFDEVICE_INTERMEDIATE_DICT_HEADER_H - -#include -#include - -#include "dict_toolkit_defines.h" - -namespace latinime { -namespace dicttoolkit { - -class OffdeviceIntermediateDictHeader final { - public: - using AttributeMap = std::map, std::vector>; - - OffdeviceIntermediateDictHeader(const AttributeMap &attributesMap) - : mAttributeMap(attributesMap) {} - - private: - DISALLOW_DEFAULT_CONSTRUCTOR(OffdeviceIntermediateDictHeader); - DISALLOW_ASSIGNMENT_OPERATOR(OffdeviceIntermediateDictHeader); - - const AttributeMap mAttributeMap; -}; - -} // namespace dicttoolkit -} // namespace latinime -#endif // LATINIME_DICT_TOOLKIT_OFFDEVICE_INTERMEDIATE_DICT_HEADER_H diff --git a/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node.h b/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node.h deleted file mode 100644 index e7d7e13eb..000000000 --- a/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node.h +++ /dev/null @@ -1,79 +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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_OFFDEVICE_INTERMEDIATE_DICT_PT_NODE_H -#define LATINIME_DICT_TOOLKIT_OFFDEVICE_INTERMEDIATE_DICT_PT_NODE_H - -#include - -#include "dict_toolkit_defines.h" -#include "offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node_array.h" -#include "dictionary/property/word_property.h" -#include "utils/int_array_view.h" - -namespace latinime { -namespace dicttoolkit { - -class OffdeviceIntermediateDictPtNode final { - public: - // Non-terminal - OffdeviceIntermediateDictPtNode(const CodePointArrayView ptNodeCodePoints) - : mPtNodeCodePoints(ptNodeCodePoints.toVector()), mChildrenPtNodeArray(), - mWortProperty(nullptr) {} - - // Terminal - OffdeviceIntermediateDictPtNode(const CodePointArrayView ptNodeCodePoints, - const WordProperty &wordProperty) - : mPtNodeCodePoints(ptNodeCodePoints.toVector()), mChildrenPtNodeArray(), - mWortProperty(new WordProperty(wordProperty)) {} - - // Replacing PtNodeCodePoints. - OffdeviceIntermediateDictPtNode(const CodePointArrayView ptNodeCodePoints, - const OffdeviceIntermediateDictPtNode &ptNode) - : mPtNodeCodePoints(ptNodeCodePoints.toVector()), - mChildrenPtNodeArray(ptNode.mChildrenPtNodeArray), - mWortProperty(new WordProperty(*ptNode.mWortProperty)) {} - - // Replacing WordProperty. - OffdeviceIntermediateDictPtNode(const WordProperty &wordProperty, - const OffdeviceIntermediateDictPtNode &ptNode) - : mPtNodeCodePoints(ptNode.mPtNodeCodePoints), - mChildrenPtNodeArray(ptNode.mChildrenPtNodeArray), - mWortProperty(new WordProperty(wordProperty)) {} - - const WordProperty *getWordProperty() const { - return mWortProperty.get(); - } - - const CodePointArrayView getPtNodeCodePoints() const { - return CodePointArrayView(mPtNodeCodePoints); - } - - OffdeviceIntermediateDictPtNodeArray &getChildrenPtNodeArray() { - return mChildrenPtNodeArray; - } - - private: - DISALLOW_COPY_AND_ASSIGN(OffdeviceIntermediateDictPtNode); - - const std::vector mPtNodeCodePoints; - OffdeviceIntermediateDictPtNodeArray mChildrenPtNodeArray; - const std::unique_ptr mWortProperty; -}; - -} // namespace dicttoolkit -} // namespace latinime -#endif // LATINIME_DICT_TOOLKIT_OFFDEVICE_INTERMEDIATE_DICT_PT_NODE_H diff --git a/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node_array.h b/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node_array.h deleted file mode 100644 index f87456ce0..000000000 --- a/app/src/main/native/dicttoolkit/src/offdevice_intermediate_dict/offdevice_intermediate_dict_pt_node_array.h +++ /dev/null @@ -1,48 +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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_OFFDEVICE_INTERMEDIATE_DICT_PT_NODE_ARRAY_H -#define LATINIME_DICT_TOOLKIT_OFFDEVICE_INTERMEDIATE_DICT_PT_NODE_ARRAY_H - -#include -#include - -#include "dict_toolkit_defines.h" - -namespace latinime { -namespace dicttoolkit { - -class OffdeviceIntermediateDictPtNode; - -class OffdeviceIntermediateDictPtNodeArray final { - public: - const std::list> &getPtNodeList() const { - return mPtNodes; - } - - std::list> *getMutablePtNodeList() { - return &mPtNodes; - } - - private: - DISALLOW_ASSIGNMENT_OPERATOR(OffdeviceIntermediateDictPtNodeArray); - - std::list> mPtNodes; -}; - -} // namespace dicttoolkit -} // namespace latinime -#endif // LATINIME_DICT_TOOLKIT_OFFDEVICE_INTERMEDIATE_DICT_PT_NODE_ARRAY_H diff --git a/app/src/main/native/dicttoolkit/src/utils/arguments_and_options.h b/app/src/main/native/dicttoolkit/src/utils/arguments_and_options.h deleted file mode 100644 index 2d81b1ecb..000000000 --- a/app/src/main/native/dicttoolkit/src/utils/arguments_and_options.h +++ /dev/null @@ -1,77 +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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_ARGUMENTS_AND_OPTIONS_H -#define LATINIME_DICT_TOOLKIT_ARGUMENTS_AND_OPTIONS_H - -#include -#include -#include - -#include "dict_toolkit_defines.h" - -namespace latinime { -namespace dicttoolkit { - -class ArgumentsAndOptions { - public: - ArgumentsAndOptions() : mIsValid(false), mOptions(), mArguments() {} - - ArgumentsAndOptions(std::unordered_map &&options, - std::unordered_map> &&arguments) - : mIsValid(true), mOptions(std::move(options)), mArguments(std::move(arguments)) {} - - bool isValid() const { - return mIsValid; - } - - bool hasOption(const std::string &optionName) const { - return mOptions.find(optionName) != mOptions.end(); - } - - const std::string &getOptionValue(const std::string &optionName) const { - const auto &it = mOptions.find(optionName); - ASSERT(it != mOptions.end()); - return it->second; - } - - bool hasArgument(const std::string &name) const { - const auto &it = mArguments.find(name); - return it != mArguments.end() && !it->second.empty(); - } - - const std::string &getSingleArgument(const std::string &name) const { - const auto &it = mArguments.find(name); - ASSERT(it != mArguments.end() && !it->second.empty()); - return it->second.front(); - } - - const std::vector &getVariableLengthArguments(const std::string &name) const { - const auto &it = mArguments.find(name); - ASSERT(it != mArguments.end()); - return it->second; - } - - private: - DISALLOW_ASSIGNMENT_OPERATOR(ArgumentsAndOptions); - - const bool mIsValid; - const std::unordered_map mOptions; - const std::unordered_map> mArguments; -}; -} // namespace dicttoolkit -} // namespace latinime -#endif // LATINIME_DICT_TOOLKIT_ARGUMENTS_AND_OPTIONS_H diff --git a/app/src/main/native/dicttoolkit/src/utils/arguments_parser.cpp b/app/src/main/native/dicttoolkit/src/utils/arguments_parser.cpp deleted file mode 100644 index 1451284f1..000000000 --- a/app/src/main/native/dicttoolkit/src/utils/arguments_parser.cpp +++ /dev/null @@ -1,165 +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/arguments_parser.h" - -#include - -namespace latinime { -namespace dicttoolkit { - -const size_t ArgumentSpec::UNLIMITED_COUNT = S_INT_MAX; - -bool ArgumentsParser::validateSpecs() const { - std::unordered_set argumentNameSet; - for (size_t i = 0; i < mArgumentSpecs.size() ; ++i) { - if (mArgumentSpecs[i].getMinCount() == 0 && mArgumentSpecs[i].getMaxCount() == 0) { - AKLOGE("minCount = maxCount = 0 for %s.", mArgumentSpecs[i].getName().c_str()); - return false; - } - if (mArgumentSpecs[i].getMinCount() != mArgumentSpecs[i].getMaxCount() - && i != mArgumentSpecs.size() - 1) { - AKLOGE("Variable length argument must be at the end.", - mArgumentSpecs[i].getName().c_str()v ); - return false; - } - if (argumentNameSet.count(mArgumentSpecs[i].getName()) > 0) { - AKLOGE("Multiple arguments have the same name \"%s\".", - mArgumentSpecs[i].getName().c_str()); - return false; - } - argumentNameSet.insert(mArgumentSpecs[i].getName()); - } - return true; -} - -void ArgumentsParser::printUsage(const std::string &commandName, - const std::string &description) const { - printf("Usage: %s", commandName.c_str()); - for (const auto &option : mOptionSpecs) { - const std::string &optionName = option.first; - const OptionSpec &spec = option.second; - printf(" [-%s", optionName.c_str()); - if (spec.needsValue()) { - printf(" <%s>", spec.getValueName().c_str()); - } - printf("]"); - } - for (const auto &argSpec : mArgumentSpecs) { - if (argSpec.getMinCount() == 0 && argSpec.getMaxCount() == 1) { - printf(" [<%s>]", argSpec.getName().c_str()); - } else if (argSpec.getMinCount() == 1 && argSpec.getMaxCount() == 1) { - printf(" <%s>", argSpec.getName().c_str()); - } else if (argSpec.getMinCount() == 0) { - printf(" [<%s>...]", argSpec.getName().c_str()); - } else if (argSpec.getMinCount() == 1) { - printf(" <%s>...", argSpec.getName().c_str()); - } - } - printf("\n%s\n\n", description.c_str()); - for (const auto &option : mOptionSpecs) { - const std::string &optionName = option.first; - const OptionSpec &spec = option.second; - printf(" -%s", optionName.c_str()); - if (spec.needsValue()) { - printf(" <%s>", spec.getValueName().c_str()); - } - printf("\t\t\t%s", spec.getDescription().c_str()); - if (spec.needsValue() && !spec.getDefaultValue().empty()) { - printf("\tdefault: %s", spec.getDefaultValue().c_str()); - } - printf("\n"); - } - for (const auto &argSpec : mArgumentSpecs) { - printf(" <%s>\t\t\t%s\n", argSpec.getName().c_str(), argSpec.getDescription().c_str()); - } - printf("\n\n"); -} - -const ArgumentsAndOptions ArgumentsParser::parseArguments(const int argc, char **argv, - const bool printErrorMessage) const { - if (argc <= 0) { - AKLOGE("Invalid argc (%d).", argc); - ASSERT(false); - return ArgumentsAndOptions(); - } - std::unordered_map options; - for (const auto &entry : mOptionSpecs) { - const std::string &optionName = entry.first; - const OptionSpec &optionSpec = entry.second; - if (optionSpec.needsValue() && !optionSpec.getDefaultValue().empty()) { - // Set default value. - options[optionName] = optionSpec.getDefaultValue(); - } - } - std::unordered_map> arguments; - auto argumentSpecIt = mArgumentSpecs.cbegin(); - for (int i = 1; i < argc; ++i) { - const std::string arg = argv[i]; - if (arg.length() > 1 && arg[0] == '-') { - // option - const std::string optionName = arg.substr(1); - const auto it = mOptionSpecs.find(optionName); - if (it == mOptionSpecs.end()) { - if (printErrorMessage) { - fprintf(stderr, "Unknown option: '%s'\n", optionName.c_str()); - } - return ArgumentsAndOptions(); - } - std::string optionValue; - if (it->second.needsValue()) { - ++i; - if (i >= argc) { - if (printErrorMessage) { - fprintf(stderr, "Missing argument for option '%s'\n", optionName.c_str()); - } - return ArgumentsAndOptions(); - } - optionValue = argv[i]; - } - options[optionName] = optionValue; - } else { - // argument - if (argumentSpecIt == mArgumentSpecs.end()) { - if (printErrorMessage) { - fprintf(stderr, "Too many arguments.\n"); - } - return ArgumentsAndOptions(); - } - arguments[argumentSpecIt->getName()].push_back(arg); - if (arguments[argumentSpecIt->getName()].size() >= argumentSpecIt->getMaxCount()) { - ++argumentSpecIt; - } - } - } - - if (argumentSpecIt != mArgumentSpecs.end()) { - const auto &it = arguments.find(argumentSpecIt->getName()); - const size_t minCount = argumentSpecIt->getMinCount(); - const size_t actualcount = it == arguments.end() ? 0 : it->second.size(); - if (minCount > actualcount) { - if (printErrorMessage) { - fprintf(stderr, "Not enough arguments. %zd argumant(s) required for <%s>\n", - minCount, argumentSpecIt->getName().c_str()); - } - return ArgumentsAndOptions(); - } - } - return ArgumentsAndOptions(std::move(options), std::move(arguments)); -} - -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/src/utils/arguments_parser.h b/app/src/main/native/dicttoolkit/src/utils/arguments_parser.h deleted file mode 100644 index 32bd328d4..000000000 --- a/app/src/main/native/dicttoolkit/src/utils/arguments_parser.h +++ /dev/null @@ -1,119 +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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_ARGUMENTS_PARSER_H -#define LATINIME_DICT_TOOLKIT_ARGUMENTS_PARSER_H - -#include -#include -#include - -#include "dict_toolkit_defines.h" -#include "utils/arguments_and_options.h" - -namespace latinime { -namespace dicttoolkit { - -class OptionSpec { - public: - // Default constructor and assignment operator is enabled to be used with std::unordered_map. - OptionSpec() = default; - OptionSpec &operator=(const OptionSpec &) = default; - - static OptionSpec keyValueOption(const std::string &valueName, const std::string &defaultValue, - const std::string &description) { - return OptionSpec(true /* needsValue */, valueName, defaultValue, description); - } - - static OptionSpec switchOption(const std::string &description) { - return OptionSpec(false /* needsValue */, "" /* valueName */, "" /* defaultValue */, - description); - } - - bool needsValue() const { return mNeedsValue; } - const std::string &getValueName() const { return mValueName; } - const std::string &getDefaultValue() const { return mDefaultValue; } - const std::string &getDescription() const { return mDescription; } - - private: - OptionSpec(const bool needsValue, const std::string &valueName, const std::string &defaultValue, - const std::string &description) - : mNeedsValue(needsValue), mValueName(valueName), mDefaultValue(defaultValue), - mDescription(description) {} - - // Whether the option have to be used with a value or just a switch. - // e.g. 'f' in "command -f /path/to/file" is mNeedsValue == true. - // 'f' in "command -f -t" is mNeedsValue == false. - bool mNeedsValue; - // Name of the value used to show usage. - std::string mValueName; - std::string mDefaultValue; - std::string mDescription; -}; - -class ArgumentSpec { - public: - static const size_t UNLIMITED_COUNT; - - static ArgumentSpec singleArgument(const std::string &name, const std::string &description) { - return ArgumentSpec(name, 1 /* minCount */, 1 /* maxCount */, description); - } - - static ArgumentSpec variableLengthArguments(const std::string &name, const size_t minCount, - const size_t maxCount, const std::string &description) { - return ArgumentSpec(name, minCount, maxCount, description); - } - - const std::string &getName() const { return mName; } - size_t getMinCount() const { return mMinCount; } - size_t getMaxCount() const { return mMaxCount; } - const std::string &getDescription() const { return mDescription; } - - private: - DISALLOW_DEFAULT_CONSTRUCTOR(ArgumentSpec); - - ArgumentSpec(const std::string &name, const size_t minCount, const size_t maxCount, - const std::string &description) - : mName(name), mMinCount(minCount), mMaxCount(maxCount), mDescription(description) {} - - const std::string mName; - const size_t mMinCount; - const size_t mMaxCount; - const std::string mDescription; -}; - -class ArgumentsParser { - public: - ArgumentsParser(const std::unordered_map &&optionSpecs, - const std::vector &&argumentSpecs) - : mOptionSpecs(std::move(optionSpecs)), mArgumentSpecs(std::move(argumentSpecs)) {} - - const ArgumentsAndOptions parseArguments(const int argc, char **argv, - const bool printErrorMessage) const; - bool validateSpecs() const; - void printUsage(const std::string &commandName, const std::string &description) const; - - private: - DISALLOW_DEFAULT_CONSTRUCTOR(ArgumentsParser); - DISALLOW_ASSIGNMENT_OPERATOR(ArgumentsParser); - - const std::unordered_map mOptionSpecs; - const std::vector mArgumentSpecs; -}; - -} // namespace dicttoolkit -} // namespace latinime -#endif // LATINIME_DICT_TOOLKIT_ARGUMENTS_PARSER_H diff --git a/app/src/main/native/dicttoolkit/src/utils/command_utils.cpp b/app/src/main/native/dicttoolkit/src/utils/command_utils.cpp deleted file mode 100644 index 34196425e..000000000 --- a/app/src/main/native/dicttoolkit/src/utils/command_utils.cpp +++ /dev/null @@ -1,74 +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/command_utils.h" - -#include - -#include "command_executors/diff_executor.h" -#include "command_executors/header_executor.h" -#include "command_executors/help_executor.h" -#include "command_executors/info_executor.h" -#include "command_executors/makedict_executor.h" - -namespace latinime { -namespace dicttoolkit { - -/* static */ CommandType CommandUtils::getCommandType(const std::string &commandName) { - if (commandName == InfoExecutor::COMMAND_NAME) { - return CommandType::Info; - } else if (commandName == DiffExecutor::COMMAND_NAME) { - return CommandType::Diff; - } else if (commandName == MakedictExecutor::COMMAND_NAME) { - return CommandType::Makedict; - } else if (commandName == HeaderExecutor::COMMAND_NAME) { - return CommandType::Header; - } else if (commandName == HelpExecutor::COMMAND_NAME) { - return CommandType::Help; - } else { - return CommandType::Unknown; - } -} - -/* static */ void CommandUtils::printCommandUnknownMessage(const std::string &programName, - const std::string &commandName) { - fprintf(stderr, "Command '%s' is unknown. Try '%s %s' for more information.\n", - commandName.c_str(), programName.c_str(), HelpExecutor::COMMAND_NAME); -} - -/* static */ std::function CommandUtils::getCommandExecutor( - const CommandType commandType) { - switch (commandType) { - case CommandType::Info: - return InfoExecutor::run; - case CommandType::Diff: - return DiffExecutor::run; - case CommandType::Makedict: - return MakedictExecutor::run; - case CommandType::Header: - return HeaderExecutor::run; - case CommandType::Help: - return HelpExecutor::run; - default: - return [] (int, char **) -> int { - printf("Command executor not found."); - return 1; - }; - } -} - -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/src/utils/command_utils.h b/app/src/main/native/dicttoolkit/src/utils/command_utils.h deleted file mode 100644 index 4a181f194..000000000 --- a/app/src/main/native/dicttoolkit/src/utils/command_utils.h +++ /dev/null @@ -1,50 +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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_COMMAND_UTILS_H -#define LATINIME_DICT_TOOLKIT_COMMAND_UTILS_H - -#include -#include -#include - -#include "dict_toolkit_defines.h" - -namespace latinime { -namespace dicttoolkit { - -enum class CommandType : int { - Info, - Diff, - Makedict, - Header, - Help, - Unknown -}; - -class CommandUtils { -public: - static CommandType getCommandType(const std::string &commandName); - static void printCommandUnknownMessage(const std::string &programName, - const std::string &commandName); - static std::function getCommandExecutor(const CommandType commandType); - -private: - DISALLOW_IMPLICIT_CONSTRUCTORS(CommandUtils); -}; -} // namespace dicttoolkit -} // namespace latinime -#endif // LATINIME_DICT_TOOLKIT_COMMAND_UTILS_H diff --git a/app/src/main/native/dicttoolkit/src/utils/utf8_utils.cpp b/app/src/main/native/dicttoolkit/src/utils/utf8_utils.cpp deleted file mode 100644 index 0f349f512..000000000 --- a/app/src/main/native/dicttoolkit/src/utils/utf8_utils.cpp +++ /dev/null @@ -1,119 +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/utf8_utils.h" - -#include "utils/char_utils.h" - -namespace latinime { -namespace dicttoolkit { - -const size_t Utf8Utils::MAX_SEQUENCE_SIZE_FOR_A_CODE_POINT = 4; -const uint8_t Utf8Utils::FIRST_BYTE_MARKER_MASKS[] = {0, 0x80, 0xE0, 0xF0, 0xF8}; -const uint8_t Utf8Utils::FIRST_BYTE_MARKERS[] = {0, 0x00, 0xC0, 0xE0, 0xF0}; -const uint8_t Utf8Utils::FIRST_BYTE_CODE_POINT_BITS_MASKS[] = {0, 0x7F, 0x1F, 0x0F, 0x03}; -const int Utf8Utils::MAX_ENCODED_CODE_POINT_VALUES[] = {-1, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; - -const uint8_t Utf8Utils::TRAILING_BYTE_CODE_POINT_BITS_MASK = 0x3F; -const uint8_t Utf8Utils::TRAILING_BYTE_MARKER = 0x80; -const size_t Utf8Utils::CODE_POINT_BIT_COUNT_IN_TRAILING_BYTE = 6; - -/* static */ std::vector Utf8Utils::getCodePoints(const std::string &utf8Str) { - std::vector codePoints; - int remainingByteCountForCurrentCodePoint = 0; - int currentCodePointSequenceSize = 0; - int codePoint = 0; - for (const char c : utf8Str) { - if (remainingByteCountForCurrentCodePoint == 0) { - currentCodePointSequenceSize = getSequenceSizeByCheckingFirstByte(c); - if (currentCodePointSequenceSize <= 0) { - AKLOGE("%x is an invalid utf8 first byte value.", c); - return std::vector(); - } - remainingByteCountForCurrentCodePoint = currentCodePointSequenceSize; - codePoint = maskFirstByte(c, remainingByteCountForCurrentCodePoint); - } else { - codePoint <<= CODE_POINT_BIT_COUNT_IN_TRAILING_BYTE; - codePoint += maskTrailingByte(c); - } - remainingByteCountForCurrentCodePoint--; - if (remainingByteCountForCurrentCodePoint == 0) { - if (codePoint <= MAX_ENCODED_CODE_POINT_VALUES[currentCodePointSequenceSize - 1]) { - AKLOGE("%d bytes encode for codePoint(%x) is a redundant UTF-8 sequence.", - currentCodePointSequenceSize, codePoint); - return std::vector(); - } - codePoints.push_back(codePoint); - } - } - return codePoints; -} - -/* static */ int Utf8Utils::getSequenceSizeByCheckingFirstByte(const uint8_t firstByte) { - for (size_t i = 1; i <= MAX_SEQUENCE_SIZE_FOR_A_CODE_POINT; ++i) { - if ((firstByte & FIRST_BYTE_MARKER_MASKS[i]) == FIRST_BYTE_MARKERS[i]) { - return i; - } - } - // Not a valid utf8 char first byte. - return -1; -} - -/* static */ AK_FORCE_INLINE int Utf8Utils::maskFirstByte(const uint8_t firstByte, - const int sequenceSize) { - return firstByte & FIRST_BYTE_CODE_POINT_BITS_MASKS[sequenceSize]; -} - -/* static */ AK_FORCE_INLINE int Utf8Utils::maskTrailingByte(const uint8_t secondOrLaterByte) { - return secondOrLaterByte & TRAILING_BYTE_CODE_POINT_BITS_MASK; -} - -/* static */ std::string Utf8Utils::getUtf8String(const CodePointArrayView codePoints) { - std::string utf8String; - for (const int codePoint : codePoints) { - const int sequenceSize = getSequenceSizeToEncodeCodePoint(codePoint); - if (sequenceSize <= 0) { - AKLOGE("Cannot encode code point (%d).", codePoint); - return std::string(); - } - const int trailingByteCount = sequenceSize - 1; - // Output first byte. - const int value = codePoint >> (trailingByteCount * CODE_POINT_BIT_COUNT_IN_TRAILING_BYTE); - utf8String.push_back(static_cast(value | FIRST_BYTE_MARKERS[sequenceSize])); - // Output second and later bytes. - for (int i = 1; i < sequenceSize; ++i) { - const int shiftAmount = (trailingByteCount - i) * CODE_POINT_BIT_COUNT_IN_TRAILING_BYTE; - const int value = (codePoint >> shiftAmount) & TRAILING_BYTE_CODE_POINT_BITS_MASK; - utf8String.push_back(static_cast(value | TRAILING_BYTE_MARKER)); - } - } - return utf8String; -} - -/* static */ int Utf8Utils::getSequenceSizeToEncodeCodePoint(const int codePoint) { - if (codePoint < 0) { - return -1; - } - for (size_t i = 1; i <= MAX_SEQUENCE_SIZE_FOR_A_CODE_POINT; ++i) { - if (codePoint <= MAX_ENCODED_CODE_POINT_VALUES[i]) { - return i; - } - } - return -1; -} - -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/src/utils/utf8_utils.h b/app/src/main/native/dicttoolkit/src/utils/utf8_utils.h deleted file mode 100644 index 35818e56c..000000000 --- a/app/src/main/native/dicttoolkit/src/utils/utf8_utils.h +++ /dev/null @@ -1,56 +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. - */ - -#ifndef LATINIME_DICT_TOOLKIT_UTF8_UTILS_H -#define LATINIME_DICT_TOOLKIT_UTF8_UTILS_H - -#include -#include -#include - -#include "dict_toolkit_defines.h" -#include "utils/int_array_view.h" - -namespace latinime { -namespace dicttoolkit { - -class Utf8Utils { -public: - static std::vector getCodePoints(const std::string &utf8Str); - static std::string getUtf8String(const CodePointArrayView codePoints); - -private: - DISALLOW_IMPLICIT_CONSTRUCTORS(Utf8Utils); - - // Values indexed by sequence size. - static const size_t MAX_SEQUENCE_SIZE_FOR_A_CODE_POINT; - static const uint8_t FIRST_BYTE_MARKER_MASKS[]; - static const uint8_t FIRST_BYTE_MARKERS[]; - static const uint8_t FIRST_BYTE_CODE_POINT_BITS_MASKS[]; - static const int MAX_ENCODED_CODE_POINT_VALUES[]; - - static const uint8_t TRAILING_BYTE_CODE_POINT_BITS_MASK; - static const uint8_t TRAILING_BYTE_MARKER; - static const size_t CODE_POINT_BIT_COUNT_IN_TRAILING_BYTE; - - static int getSequenceSizeByCheckingFirstByte(const uint8_t firstByte); - static int maskFirstByte(const uint8_t firstByte, const int encodeSize); - static int maskTrailingByte(const uint8_t secondOrLaterByte); - static int getSequenceSizeToEncodeCodePoint(const int codePoint); -}; -} // namespace dicttoolkit -} // namespace latinime -#endif // LATINIME_DICT_TOOLKIT_UTF8_UTILS_H diff --git a/app/src/main/native/dicttoolkit/tests/command_executors/diff_executor_test.cpp b/app/src/main/native/dicttoolkit/tests/command_executors/diff_executor_test.cpp deleted file mode 100644 index 444141427..000000000 --- a/app/src/main/native/dicttoolkit/tests/command_executors/diff_executor_test.cpp +++ /dev/null @@ -1,31 +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 "command_executors/diff_executor.h" - -#include - -namespace latinime { -namespace dicttoolkit { -namespace { - -TEST(DiffExecutorTests, TestArguemntSpecs) { - EXPECT_TRUE(DiffExecutor::getArgumentsParser().validateSpecs()); -} - -} // namespace -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/tests/command_executors/header_executor_test.cpp b/app/src/main/native/dicttoolkit/tests/command_executors/header_executor_test.cpp deleted file mode 100644 index a94150b01..000000000 --- a/app/src/main/native/dicttoolkit/tests/command_executors/header_executor_test.cpp +++ /dev/null @@ -1,31 +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 "command_executors/header_executor.h" - -#include - -namespace latinime { -namespace dicttoolkit { -namespace { - -TEST(HeaderExecutorTests, TestArguemntSpecs) { - EXPECT_TRUE(HeaderExecutor::getArgumentsParser().validateSpecs()); -} - -} // namespace -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/tests/command_executors/info_executor_test.cpp b/app/src/main/native/dicttoolkit/tests/command_executors/info_executor_test.cpp deleted file mode 100644 index debe8c601..000000000 --- a/app/src/main/native/dicttoolkit/tests/command_executors/info_executor_test.cpp +++ /dev/null @@ -1,31 +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 "command_executors/info_executor.h" - -#include - -namespace latinime { -namespace dicttoolkit { -namespace { - -TEST(InfoExecutorTests, TestArguemntSpecs) { - EXPECT_TRUE(InfoExecutor::getArgumentsParser().validateSpecs()); -} - -} // namespace -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/tests/command_executors/makedict_executor_test.cpp b/app/src/main/native/dicttoolkit/tests/command_executors/makedict_executor_test.cpp deleted file mode 100644 index 44eb3dc1b..000000000 --- a/app/src/main/native/dicttoolkit/tests/command_executors/makedict_executor_test.cpp +++ /dev/null @@ -1,31 +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 "command_executors/makedict_executor.h" - -#include - -namespace latinime { -namespace dicttoolkit { -namespace { - -TEST(MakedictExecutorTests, TestArguemntSpecs) { - EXPECT_TRUE(MakedictExecutor::getArgumentsParser().validateSpecs()); -} - -} // namespace -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/tests/dict_toolkit_defines_test.cpp b/app/src/main/native/dicttoolkit/tests/dict_toolkit_defines_test.cpp deleted file mode 100644 index 3445bd0c5..000000000 --- a/app/src/main/native/dicttoolkit/tests/dict_toolkit_defines_test.cpp +++ /dev/null @@ -1,32 +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 "dict_toolkit_defines.h" - -#include - -namespace latinime { -namespace dicttoolkit { -namespace { - -// Initial trivial test case. -TEST(DictToolkitDefinesTest, TestKeycodeSpace) { - EXPECT_EQ(' ', KEYCODE_SPACE); -} - -} // namespace -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/tests/offdevice_intermediate_dict/offdevice_intermediate_dict_test.cpp b/app/src/main/native/dicttoolkit/tests/offdevice_intermediate_dict/offdevice_intermediate_dict_test.cpp deleted file mode 100644 index 89598de60..000000000 --- a/app/src/main/native/dicttoolkit/tests/offdevice_intermediate_dict/offdevice_intermediate_dict_test.cpp +++ /dev/null @@ -1,85 +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 "offdevice_intermediate_dict/offdevice_intermediate_dict.h" - -#include - -#include - -#include "dictionary/property/word_property.h" -#include "utils/int_array_view.h" - -namespace latinime { -namespace dicttoolkit { -namespace { - -const std::vector getCodePointVector(const char *str) { - std::vector codePoints; - while (*str) { - codePoints.push_back(*str); - ++str; - } - return codePoints; -} - -const WordProperty getDummpWordProperty(const std::vector &&codePoints) { - return WordProperty(std::move(codePoints), UnigramProperty(), std::vector()); -} - -TEST(OffdeviceIntermediateDictTest, TestAddWordProperties) { - OffdeviceIntermediateDict dict = OffdeviceIntermediateDict( - OffdeviceIntermediateDictHeader(OffdeviceIntermediateDictHeader::AttributeMap())); - EXPECT_EQ(nullptr, dict.getWordProperty(CodePointArrayView())); - - const WordProperty wordProperty0 = getDummpWordProperty(getCodePointVector("abcd")); - EXPECT_TRUE(dict.addWord(wordProperty0)); - EXPECT_NE(nullptr, dict.getWordProperty(wordProperty0.getCodePoints())); - - const WordProperty wordProperty1 = getDummpWordProperty(getCodePointVector("efgh")); - EXPECT_TRUE(dict.addWord(wordProperty1)); - EXPECT_NE(nullptr, dict.getWordProperty(wordProperty1.getCodePoints())); - - const WordProperty wordProperty2 = getDummpWordProperty(getCodePointVector("ab")); - EXPECT_TRUE(dict.addWord(wordProperty2)); - EXPECT_NE(nullptr, dict.getWordProperty(wordProperty2.getCodePoints())); - - const WordProperty wordProperty3 = getDummpWordProperty(getCodePointVector("abcdefg")); - EXPECT_TRUE(dict.addWord(wordProperty3)); - EXPECT_NE(nullptr, dict.getWordProperty(wordProperty3.getCodePoints())); - - const WordProperty wordProperty4 = getDummpWordProperty(getCodePointVector("efef")); - EXPECT_TRUE(dict.addWord(wordProperty4)); - EXPECT_NE(nullptr, dict.getWordProperty(wordProperty4.getCodePoints())); - - const WordProperty wordProperty5 = getDummpWordProperty(getCodePointVector("ef")); - EXPECT_TRUE(dict.addWord(wordProperty5)); - EXPECT_NE(nullptr, dict.getWordProperty(wordProperty5.getCodePoints())); - - const WordProperty wordProperty6 = getDummpWordProperty(getCodePointVector("abcd")); - EXPECT_FALSE(dict.addWord(wordProperty6)) << "Adding the same word multiple times should fail."; - - EXPECT_NE(nullptr, dict.getWordProperty(wordProperty0.getCodePoints())); - EXPECT_NE(nullptr, dict.getWordProperty(wordProperty1.getCodePoints())); - EXPECT_NE(nullptr, dict.getWordProperty(wordProperty2.getCodePoints())); - EXPECT_NE(nullptr, dict.getWordProperty(wordProperty3.getCodePoints())); - EXPECT_NE(nullptr, dict.getWordProperty(wordProperty4.getCodePoints())); - EXPECT_NE(nullptr, dict.getWordProperty(wordProperty5.getCodePoints())); -} - -} // namespace -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/tests/utils/arguments_parser_test.cpp b/app/src/main/native/dicttoolkit/tests/utils/arguments_parser_test.cpp deleted file mode 100644 index 58b499823..000000000 --- a/app/src/main/native/dicttoolkit/tests/utils/arguments_parser_test.cpp +++ /dev/null @@ -1,147 +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/arguments_parser.h" - -#include - -namespace latinime { -namespace dicttoolkit { -namespace { - -TEST(ArgumentsParserTests, TestValitadeSpecs) { - { - std::unordered_map optionSpecs; - std::vector argumentSpecs; - EXPECT_TRUE( - ArgumentsParser(std::move(optionSpecs), std::move(argumentSpecs)).validateSpecs()); - } - { - std::unordered_map optionSpecs; - optionSpecs["a"] = OptionSpec::keyValueOption("valueName", "default", "description"); - const std::vector argumentSpecs = { - ArgumentSpec::singleArgument("name", "description"), - ArgumentSpec::variableLengthArguments("name2", 0 /* minCount */, 1 /* maxCount */, - "description2") - }; - EXPECT_TRUE( - ArgumentsParser(std::move(optionSpecs), std::move(argumentSpecs)).validateSpecs()); - } - { - const std::vector argumentSpecs = { - ArgumentSpec::variableLengthArguments("name", 0 /* minCount */, 0 /* maxCount */, - "description") - }; - EXPECT_FALSE(ArgumentsParser(std::unordered_map(), - std::move(argumentSpecs)).validateSpecs()); - } - { - const std::vector argumentSpecs = { - ArgumentSpec::singleArgument("name", "description"), - ArgumentSpec::variableLengthArguments("name", 0 /* minCount */, 1 /* maxCount */, - "description") - }; - EXPECT_FALSE(ArgumentsParser(std::unordered_map(), - std::move(argumentSpecs)).validateSpecs()); - } - { - const std::vector argumentSpecs = { - ArgumentSpec::variableLengthArguments("name", 0 /* minCount */, 1 /* maxCount */, - "description"), - ArgumentSpec::singleArgument("name2", "description2") - }; - EXPECT_FALSE(ArgumentsParser(std::unordered_map(), - std::move(argumentSpecs)).validateSpecs()); - } -} - -int initArgv(char *mutableCommandLine, char **argv) { - bool readingSeparator = false; - int argc = 1; - argv[0] = mutableCommandLine; - const size_t length = strlen(mutableCommandLine); - for (size_t i = 0; i < length; ++i) { - if (mutableCommandLine[i] != ' ' && readingSeparator) { - readingSeparator = false; - argv[argc] = mutableCommandLine + i; - ++argc; - } else if (mutableCommandLine[i] == ' ' && !readingSeparator) { - readingSeparator = true; - mutableCommandLine[i] = '\0'; - } - } - argv[argc] = nullptr; - return argc; -} - -TEST(ArgumentsParserTests, TestParseArguments) { - std::unordered_map optionSpecs; - optionSpecs["a"] = OptionSpec::switchOption("description"); - optionSpecs["b"] = OptionSpec::keyValueOption("valueName", "default", "description"); - const std::vector argumentSpecs = { - ArgumentSpec::singleArgument("arg0", "description"), - ArgumentSpec::variableLengthArguments("arg1", 0 /* minCount */, 2 /* maxCount */, - "description"), - }; - const ArgumentsParser parser = - ArgumentsParser(std::move(optionSpecs), std::move(argumentSpecs)); - - { - char kMutableCommandLine[1024] = "command arg"; - char *argv[128] = {}; - const int argc = initArgv(kMutableCommandLine, argv); - ASSERT_EQ(2, argc); - const ArgumentsAndOptions argumentsAndOptions = parser.parseArguments( - argc, argv, false /* printErrorMessages */); - EXPECT_FALSE(argumentsAndOptions.hasOption("a")); - EXPECT_EQ("default", argumentsAndOptions.getOptionValue("b")); - EXPECT_EQ("arg", argumentsAndOptions.getSingleArgument("arg0")); - EXPECT_FALSE(argumentsAndOptions.hasArgument("arg1")); - } - { - char kArgumentBuffer[1024] = "command -a arg arg"; - char *argv[128] = {}; - const int argc = initArgv(kArgumentBuffer, argv); - ASSERT_EQ(4, argc); - const ArgumentsAndOptions argumentsAndOptions = parser.parseArguments( - argc, argv, false /* printErrorMessages */); - EXPECT_TRUE(argumentsAndOptions.hasOption("a")); - EXPECT_EQ("default", argumentsAndOptions.getOptionValue("b")); - EXPECT_EQ("arg", argumentsAndOptions.getSingleArgument("arg0")); - EXPECT_TRUE(argumentsAndOptions.hasArgument("arg1")); - EXPECT_EQ(1u, argumentsAndOptions.getVariableLengthArguments("arg1").size()); - } - { - char kArgumentBuffer[1024] = "command -b value arg arg1 arg2"; - char *argv[128] = {}; - const int argc = initArgv(kArgumentBuffer, argv); - ASSERT_EQ(6, argc); - const ArgumentsAndOptions argumentsAndOptions = parser.parseArguments( - argc, argv, false /* printErrorMessages */); - EXPECT_FALSE(argumentsAndOptions.hasOption("a")); - EXPECT_EQ("value", argumentsAndOptions.getOptionValue("b")); - EXPECT_EQ("arg", argumentsAndOptions.getSingleArgument("arg0")); - const std::vector &arg1 = - argumentsAndOptions.getVariableLengthArguments("arg1"); - EXPECT_EQ(2u, arg1.size()); - EXPECT_EQ("arg1", arg1[0]); - EXPECT_EQ("arg2", arg1[1]); - } -} - -} // namespace -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/tests/utils/command_utils_test.cpp b/app/src/main/native/dicttoolkit/tests/utils/command_utils_test.cpp deleted file mode 100644 index 9d79c9dd9..000000000 --- a/app/src/main/native/dicttoolkit/tests/utils/command_utils_test.cpp +++ /dev/null @@ -1,37 +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/command_utils.h" - -#include - -namespace latinime { -namespace dicttoolkit { -namespace { - -TEST(CommandUtilsTests, TestGetCommandType) { - EXPECT_EQ(CommandUtils::getCommandType(""), CommandType::Unknown); - EXPECT_EQ(CommandUtils::getCommandType("abc"), CommandType::Unknown); - EXPECT_EQ(CommandUtils::getCommandType("info"), CommandType::Info); - EXPECT_EQ(CommandUtils::getCommandType("diff"), CommandType::Diff); - EXPECT_EQ(CommandUtils::getCommandType("makedict"), CommandType::Makedict); - EXPECT_EQ(CommandUtils::getCommandType("header"), CommandType::Header); - EXPECT_EQ(CommandUtils::getCommandType("help"), CommandType::Help); -} - -} // namespace -} // namespace dicttoolkit -} // namespace latinime diff --git a/app/src/main/native/dicttoolkit/tests/utils/utf8_utils_test.cpp b/app/src/main/native/dicttoolkit/tests/utils/utf8_utils_test.cpp deleted file mode 100644 index 9c59a8b05..000000000 --- a/app/src/main/native/dicttoolkit/tests/utils/utf8_utils_test.cpp +++ /dev/null @@ -1,85 +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/utf8_utils.h" - -#include - -#include - -#include "utils/int_array_view.h" - -namespace latinime { -namespace dicttoolkit { -namespace { - -TEST(Utf8UtilsTests, TestGetCodePoints) { - { - const std::vector codePoints = Utf8Utils::getCodePoints(""); - EXPECT_EQ(0u, codePoints.size()); - } - { - const std::vector codePoints = Utf8Utils::getCodePoints("test"); - EXPECT_EQ(4u, codePoints.size()); - EXPECT_EQ('t', codePoints[0]); - EXPECT_EQ('e', codePoints[1]); - EXPECT_EQ('s', codePoints[2]); - EXPECT_EQ('t', codePoints[3]); - } - { - const std::vector codePoints = Utf8Utils::getCodePoints(u8"\u3042a\u03C2\u0410"); - EXPECT_EQ(4u, codePoints.size()); - EXPECT_EQ(0x3042, codePoints[0]); // HIRAGANA LETTER A - EXPECT_EQ('a', codePoints[1]); - EXPECT_EQ(0x03C2, codePoints[2]); // CYRILLIC CAPITAL LETTER A - EXPECT_EQ(0x0410, codePoints[3]); // GREEK SMALL LETTER FINAL SIGMA - } - { - const std::vector codePoints = Utf8Utils::getCodePoints(u8"\U0001F36A?\U0001F752"); - EXPECT_EQ(3u, codePoints.size()); - EXPECT_EQ(0x1F36A, codePoints[0]); // COOKIE - EXPECT_EQ('?', codePoints[1]); - EXPECT_EQ(0x1F752, codePoints[2]); // ALCHEMICAL SYMBOL FOR STARRED TRIDENT - } - - // Redundant UTF-8 sequences must be rejected. - EXPECT_TRUE(Utf8Utils::getCodePoints("\xC0\xAF").empty()); - EXPECT_TRUE(Utf8Utils::getCodePoints("\xE0\x80\xAF").empty()); - EXPECT_TRUE(Utf8Utils::getCodePoints("\xF0\x80\x80\xAF").empty()); -} - -TEST(Utf8UtilsTests, TestGetUtf8String) { - { - const std::vector codePoints = {'t', 'e', 's', 't'}; - EXPECT_EQ("test", Utf8Utils::getUtf8String(CodePointArrayView(codePoints))); - } - { - const std::vector codePoints = { - 0x00E0 /* LATIN SMALL LETTER A WITH GRAVE */, - 0x03C2 /* GREEK SMALL LETTER FINAL SIGMA */, - 0x0430 /* CYRILLIC SMALL LETTER A */, - 0x3042 /* HIRAGANA LETTER A */, - 0x1F36A /* COOKIE */, - 0x1F752 /* ALCHEMICAL SYMBOL FOR STARRED TRIDENT */ - }; - EXPECT_EQ(u8"\u00E0\u03C2\u0430\u3042\U0001F36A\U0001F752", - Utf8Utils::getUtf8String(CodePointArrayView(codePoints))); - } -} - -} // namespace -} // namespace dicttoolkit -} // namespace latinime