From a65c267b1f1207e54c6f821148c600e3899b7f9c Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Fri, 31 May 2013 00:02:57 +0900 Subject: [PATCH] Move some dictionary related implementations to the dictionary directory Change-Id: I6fe71a540ad91ca46755be234abc8894242e2413 --- native/jni/Android.mk | 5 +++-- .../com_android_inputmethod_latin_BinaryDictionary.cpp | 5 +++-- native/jni/src/bigram_dictionary.cpp | 7 ++++--- native/jni/src/suggest/core/dicnode/dic_node.cpp | 2 +- native/jni/src/suggest/core/dicnode/dic_node.h | 10 +++++----- .../src/suggest/core/dicnode/dic_node_priority_queue.h | 4 ++-- .../jni/src/suggest/core/dicnode/dic_node_properties.h | 2 +- native/jni/src/suggest/core/dicnode/dic_node_state.h | 8 ++++---- .../src/suggest/core/dicnode/dic_node_state_prevword.h | 2 +- .../src/suggest/core/dicnode/dic_node_state_scoring.h | 2 +- native/jni/src/suggest/core/dicnode/dic_node_utils.cpp | 10 +++++----- native/jni/src/suggest/core/dicnode/dic_node_vector.h | 2 +- .../jni/src/suggest/core/dicnode/dic_nodes_cache.cpp | 6 +++--- native/jni/src/suggest/core/dicnode/dic_nodes_cache.h | 2 +- .../src/{ => suggest/core/dictionary}/binary_format.h | 2 +- .../src/{ => suggest/core/dictionary}/bloom_filter.h | 0 .../src/{ => suggest/core/dictionary}/dictionary.cpp | 4 ++-- .../jni/src/{ => suggest/core/dictionary}/dictionary.h | 0 .../{ => suggest/core/dictionary}/digraph_utils.cpp | 5 +++-- .../src/{ => suggest/core/dictionary}/digraph_utils.h | 2 ++ .../{ => suggest/core/dictionary}/multi_bigram_map.h | 3 +-- .../jni/src/suggest/core/dictionary/shortcut_utils.h | 2 +- .../core/dictionary}/terminal_attributes.h | 3 ++- .../core/layout/touch_position_correction_utils.h | 2 +- .../src/suggest/core/session/dic_traverse_session.cpp | 4 ++-- .../src/suggest/core/session/dic_traverse_session.h | 2 +- native/jni/src/suggest/core/suggest.cpp | 6 +++--- native/jni/src/unigram_dictionary.cpp | 8 ++++---- native/jni/src/unigram_dictionary.h | 3 ++- 29 files changed, 60 insertions(+), 53 deletions(-) rename native/jni/src/{ => suggest/core/dictionary}/binary_format.h (99%) rename native/jni/src/{ => suggest/core/dictionary}/bloom_filter.h (100%) rename native/jni/src/{ => suggest/core/dictionary}/dictionary.cpp (97%) rename native/jni/src/{ => suggest/core/dictionary}/dictionary.h (100%) rename native/jni/src/{ => suggest/core/dictionary}/digraph_utils.cpp (98%) rename native/jni/src/{ => suggest/core/dictionary}/digraph_utils.h (99%) rename native/jni/src/{ => suggest/core/dictionary}/multi_bigram_map.h (98%) rename native/jni/src/{ => suggest/core/dictionary}/terminal_attributes.h (98%) diff --git a/native/jni/Android.mk b/native/jni/Android.mk index ea35dab18..34b352433 100644 --- a/native/jni/Android.mk +++ b/native/jni/Android.mk @@ -49,9 +49,7 @@ LATIN_IME_CORE_SRC_FILES := \ bigram_dictionary.cpp \ char_utils.cpp \ correction.cpp \ - dictionary.cpp \ dic_traverse_wrapper.cpp \ - digraph_utils.cpp \ unigram_dictionary.cpp \ words_priority_queue.cpp \ suggest/core/suggest.cpp \ @@ -59,6 +57,9 @@ LATIN_IME_CORE_SRC_FILES := \ dic_node.cpp \ dic_node_utils.cpp \ dic_nodes_cache.cpp) \ + $(addprefix suggest/core/dictionary/, \ + dictionary.cpp \ + digraph_utils.cpp) \ $(addprefix suggest/core/layout/, \ additional_proximity_chars.cpp \ proximity_info.cpp \ diff --git a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp index 03b3c6028..9f5e2ae73 100644 --- a/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp +++ b/native/jni/com_android_inputmethod_latin_BinaryDictionary.cpp @@ -29,13 +29,14 @@ #include // for fopen() etc. #endif // USE_MMAP_FOR_DICTIONARY -#include "binary_format.h" #include "com_android_inputmethod_latin_BinaryDictionary.h" + #include "correction.h" -#include "dictionary.h" #include "jni.h" #include "jni_common.h" #include "suggest_options.h" +#include "suggest/core/dictionary/binary_format.h" +#include "suggest/core/dictionary/dictionary.h" namespace latinime { diff --git a/native/jni/src/bigram_dictionary.cpp b/native/jni/src/bigram_dictionary.cpp index 9053e7226..c592542bd 100644 --- a/native/jni/src/bigram_dictionary.cpp +++ b/native/jni/src/bigram_dictionary.cpp @@ -19,11 +19,12 @@ #define LOG_TAG "LatinIME: bigram_dictionary.cpp" #include "bigram_dictionary.h" -#include "binary_format.h" -#include "bloom_filter.h" + #include "char_utils.h" #include "defines.h" -#include "dictionary.h" +#include "suggest/core/dictionary/binary_format.h" +#include "suggest/core/dictionary/bloom_filter.h" +#include "suggest/core/dictionary/dictionary.h" namespace latinime { diff --git a/native/jni/src/suggest/core/dicnode/dic_node.cpp b/native/jni/src/suggest/core/dicnode/dic_node.cpp index 8c48c587b..de088c7d0 100644 --- a/native/jni/src/suggest/core/dicnode/dic_node.cpp +++ b/native/jni/src/suggest/core/dicnode/dic_node.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "dic_node.h" +#include "suggest/core/dicnode/dic_node.h" namespace latinime { diff --git a/native/jni/src/suggest/core/dicnode/dic_node.h b/native/jni/src/suggest/core/dicnode/dic_node.h index 4225bb3e5..1510e3d5e 100644 --- a/native/jni/src/suggest/core/dicnode/dic_node.h +++ b/native/jni/src/suggest/core/dicnode/dic_node.h @@ -19,11 +19,11 @@ #include "char_utils.h" #include "defines.h" -#include "dic_node_state.h" -#include "dic_node_profiler.h" -#include "dic_node_properties.h" -#include "dic_node_release_listener.h" -#include "digraph_utils.h" +#include "suggest/core/dicnode/dic_node_state.h" +#include "suggest/core/dicnode/dic_node_profiler.h" +#include "suggest/core/dicnode/dic_node_properties.h" +#include "suggest/core/dicnode/dic_node_release_listener.h" +#include "suggest/core/dictionary/digraph_utils.h" #if DEBUG_DICT #define LOGI_SHOW_ADD_COST_PROP \ diff --git a/native/jni/src/suggest/core/dicnode/dic_node_priority_queue.h b/native/jni/src/suggest/core/dicnode/dic_node_priority_queue.h index d3f28a8bd..970e3bda4 100644 --- a/native/jni/src/suggest/core/dicnode/dic_node_priority_queue.h +++ b/native/jni/src/suggest/core/dicnode/dic_node_priority_queue.h @@ -21,8 +21,8 @@ #include #include "defines.h" -#include "dic_node.h" -#include "dic_node_release_listener.h" +#include "suggest/core/dicnode/dic_node.h" +#include "suggest/core/dicnode/dic_node_release_listener.h" #define MAX_DIC_NODE_PRIORITY_QUEUE_CAPACITY 200 diff --git a/native/jni/src/suggest/core/dicnode/dic_node_properties.h b/native/jni/src/suggest/core/dicnode/dic_node_properties.h index 63a6b1340..d2f87c10b 100644 --- a/native/jni/src/suggest/core/dicnode/dic_node_properties.h +++ b/native/jni/src/suggest/core/dicnode/dic_node_properties.h @@ -19,8 +19,8 @@ #include -#include "binary_format.h" #include "defines.h" +#include "suggest/core/dictionary/binary_format.h" namespace latinime { diff --git a/native/jni/src/suggest/core/dicnode/dic_node_state.h b/native/jni/src/suggest/core/dicnode/dic_node_state.h index 239b63c32..d35e7d79f 100644 --- a/native/jni/src/suggest/core/dicnode/dic_node_state.h +++ b/native/jni/src/suggest/core/dicnode/dic_node_state.h @@ -18,10 +18,10 @@ #define LATINIME_DIC_NODE_STATE_H #include "defines.h" -#include "dic_node_state_input.h" -#include "dic_node_state_output.h" -#include "dic_node_state_prevword.h" -#include "dic_node_state_scoring.h" +#include "suggest/core/dicnode/dic_node_state_input.h" +#include "suggest/core/dicnode/dic_node_state_output.h" +#include "suggest/core/dicnode/dic_node_state_prevword.h" +#include "suggest/core/dicnode/dic_node_state_scoring.h" namespace latinime { diff --git a/native/jni/src/suggest/core/dicnode/dic_node_state_prevword.h b/native/jni/src/suggest/core/dicnode/dic_node_state_prevword.h index e3b892bda..c3968c090 100644 --- a/native/jni/src/suggest/core/dicnode/dic_node_state_prevword.h +++ b/native/jni/src/suggest/core/dicnode/dic_node_state_prevword.h @@ -21,7 +21,7 @@ #include #include "defines.h" -#include "dic_node_utils.h" +#include "suggest/core/dicnode/dic_node_utils.h" namespace latinime { diff --git a/native/jni/src/suggest/core/dicnode/dic_node_state_scoring.h b/native/jni/src/suggest/core/dicnode/dic_node_state_scoring.h index dca9d60da..4c884225a 100644 --- a/native/jni/src/suggest/core/dicnode/dic_node_state_scoring.h +++ b/native/jni/src/suggest/core/dicnode/dic_node_state_scoring.h @@ -20,7 +20,7 @@ #include #include "defines.h" -#include "digraph_utils.h" +#include "suggest/core/dictionary/digraph_utils.h" namespace latinime { diff --git a/native/jni/src/suggest/core/dicnode/dic_node_utils.cpp b/native/jni/src/suggest/core/dicnode/dic_node_utils.cpp index 4fe4badc5..7f0d0ed0e 100644 --- a/native/jni/src/suggest/core/dicnode/dic_node_utils.cpp +++ b/native/jni/src/suggest/core/dicnode/dic_node_utils.cpp @@ -17,11 +17,11 @@ #include #include -#include "binary_format.h" -#include "dic_node.h" -#include "dic_node_utils.h" -#include "dic_node_vector.h" -#include "multi_bigram_map.h" +#include "suggest/core/dicnode/dic_node.h" +#include "suggest/core/dicnode/dic_node_utils.h" +#include "suggest/core/dicnode/dic_node_vector.h" +#include "suggest/core/dictionary/binary_format.h" +#include "suggest/core/dictionary/multi_bigram_map.h" #include "suggest/core/layout/proximity_info.h" #include "suggest/core/layout/proximity_info_state.h" diff --git a/native/jni/src/suggest/core/dicnode/dic_node_vector.h b/native/jni/src/suggest/core/dicnode/dic_node_vector.h index ca07edaee..e23c411f0 100644 --- a/native/jni/src/suggest/core/dicnode/dic_node_vector.h +++ b/native/jni/src/suggest/core/dicnode/dic_node_vector.h @@ -20,7 +20,7 @@ #include #include "defines.h" -#include "dic_node.h" +#include "suggest/core/dicnode/dic_node.h" namespace latinime { diff --git a/native/jni/src/suggest/core/dicnode/dic_nodes_cache.cpp b/native/jni/src/suggest/core/dicnode/dic_nodes_cache.cpp index b9a60780b..c3d2a2e74 100644 --- a/native/jni/src/suggest/core/dicnode/dic_nodes_cache.cpp +++ b/native/jni/src/suggest/core/dicnode/dic_nodes_cache.cpp @@ -17,9 +17,9 @@ #include #include "defines.h" -#include "dic_node_priority_queue.h" -#include "dic_node_utils.h" -#include "dic_nodes_cache.h" +#include "suggest/core/dicnode/dic_node_priority_queue.h" +#include "suggest/core/dicnode/dic_node_utils.h" +#include "suggest/core/dicnode/dic_nodes_cache.h" namespace latinime { diff --git a/native/jni/src/suggest/core/dicnode/dic_nodes_cache.h b/native/jni/src/suggest/core/dicnode/dic_nodes_cache.h index a62aa422a..7f5bdbcf6 100644 --- a/native/jni/src/suggest/core/dicnode/dic_nodes_cache.h +++ b/native/jni/src/suggest/core/dicnode/dic_nodes_cache.h @@ -20,7 +20,7 @@ #include #include "defines.h" -#include "dic_node_priority_queue.h" +#include "suggest/core/dicnode/dic_node_priority_queue.h" #define INITIAL_QUEUE_ID_ACTIVE 0 #define INITIAL_QUEUE_ID_NEXT_ACTIVE 1 diff --git a/native/jni/src/binary_format.h b/native/jni/src/suggest/core/dictionary/binary_format.h similarity index 99% rename from native/jni/src/binary_format.h rename to native/jni/src/suggest/core/dictionary/binary_format.h index 98241532f..65c2e9115 100644 --- a/native/jni/src/binary_format.h +++ b/native/jni/src/suggest/core/dictionary/binary_format.h @@ -21,9 +21,9 @@ #include #include -#include "bloom_filter.h" #include "char_utils.h" #include "hash_map_compat.h" +#include "suggest/core/dictionary/bloom_filter.h" namespace latinime { diff --git a/native/jni/src/bloom_filter.h b/native/jni/src/suggest/core/dictionary/bloom_filter.h similarity index 100% rename from native/jni/src/bloom_filter.h rename to native/jni/src/suggest/core/dictionary/bloom_filter.h diff --git a/native/jni/src/dictionary.cpp b/native/jni/src/suggest/core/dictionary/dictionary.cpp similarity index 97% rename from native/jni/src/dictionary.cpp rename to native/jni/src/suggest/core/dictionary/dictionary.cpp index d9ed0fe49..1939c7420 100644 --- a/native/jni/src/dictionary.cpp +++ b/native/jni/src/suggest/core/dictionary/dictionary.cpp @@ -16,17 +16,17 @@ #define LOG_TAG "LatinIME: dictionary.cpp" -#include "dictionary.h" +#include "suggest/core/dictionary/dictionary.h" #include // TODO: remove #include #include "bigram_dictionary.h" -#include "binary_format.h" #include "defines.h" #include "dic_traverse_wrapper.h" #include "suggest_options.h" #include "suggest/core/suggest.h" +#include "suggest/core/dictionary/binary_format.h" #include "suggest/policyimpl/gesture/gesture_suggest_policy_factory.h" #include "suggest/policyimpl/typing/typing_suggest_policy_factory.h" #include "unigram_dictionary.h" diff --git a/native/jni/src/dictionary.h b/native/jni/src/suggest/core/dictionary/dictionary.h similarity index 100% rename from native/jni/src/dictionary.h rename to native/jni/src/suggest/core/dictionary/dictionary.h diff --git a/native/jni/src/digraph_utils.cpp b/native/jni/src/suggest/core/dictionary/digraph_utils.cpp similarity index 98% rename from native/jni/src/digraph_utils.cpp rename to native/jni/src/suggest/core/dictionary/digraph_utils.cpp index 083442669..7a0f755e5 100644 --- a/native/jni/src/digraph_utils.cpp +++ b/native/jni/src/suggest/core/dictionary/digraph_utils.cpp @@ -14,10 +14,11 @@ * limitations under the License. */ +#include "suggest/core/dictionary/digraph_utils.h" + #include "char_utils.h" -#include "binary_format.h" #include "defines.h" -#include "digraph_utils.h" +#include "suggest/core/dictionary/binary_format.h" namespace latinime { diff --git a/native/jni/src/digraph_utils.h b/native/jni/src/suggest/core/dictionary/digraph_utils.h similarity index 99% rename from native/jni/src/digraph_utils.h rename to native/jni/src/suggest/core/dictionary/digraph_utils.h index 94435228e..c1205940c 100644 --- a/native/jni/src/digraph_utils.h +++ b/native/jni/src/suggest/core/dictionary/digraph_utils.h @@ -17,6 +17,8 @@ #ifndef DIGRAPH_UTILS_H #define DIGRAPH_UTILS_H +#include "defines.h" + namespace latinime { class DigraphUtils { diff --git a/native/jni/src/multi_bigram_map.h b/native/jni/src/suggest/core/dictionary/multi_bigram_map.h similarity index 98% rename from native/jni/src/multi_bigram_map.h rename to native/jni/src/suggest/core/dictionary/multi_bigram_map.h index 7e1b6301f..fcac98f35 100644 --- a/native/jni/src/multi_bigram_map.h +++ b/native/jni/src/suggest/core/dictionary/multi_bigram_map.h @@ -17,12 +17,11 @@ #ifndef LATINIME_MULTI_BIGRAM_MAP_H #define LATINIME_MULTI_BIGRAM_MAP_H -#include #include #include "defines.h" -#include "binary_format.h" #include "hash_map_compat.h" +#include "suggest/core/dictionary/binary_format.h" namespace latinime { diff --git a/native/jni/src/suggest/core/dictionary/shortcut_utils.h b/native/jni/src/suggest/core/dictionary/shortcut_utils.h index c411408ec..601ac5f5a 100644 --- a/native/jni/src/suggest/core/dictionary/shortcut_utils.h +++ b/native/jni/src/suggest/core/dictionary/shortcut_utils.h @@ -19,7 +19,7 @@ #include "defines.h" #include "suggest/core/dicnode/dic_node_utils.h" -#include "terminal_attributes.h" +#include "suggest/core/dictionary/terminal_attributes.h" namespace latinime { diff --git a/native/jni/src/terminal_attributes.h b/native/jni/src/suggest/core/dictionary/terminal_attributes.h similarity index 98% rename from native/jni/src/terminal_attributes.h rename to native/jni/src/suggest/core/dictionary/terminal_attributes.h index 92ef71c2c..8377c603d 100644 --- a/native/jni/src/terminal_attributes.h +++ b/native/jni/src/suggest/core/dictionary/terminal_attributes.h @@ -18,7 +18,8 @@ #define LATINIME_TERMINAL_ATTRIBUTES_H #include -#include "binary_format.h" + +#include "suggest/core/dictionary/binary_format.h" namespace latinime { diff --git a/native/jni/src/suggest/core/layout/touch_position_correction_utils.h b/native/jni/src/suggest/core/layout/touch_position_correction_utils.h index e7a8cae58..429dcae0d 100644 --- a/native/jni/src/suggest/core/layout/touch_position_correction_utils.h +++ b/native/jni/src/suggest/core/layout/touch_position_correction_utils.h @@ -18,7 +18,7 @@ #define LATINIME_TOUCH_POSITION_CORRECTION_UTILS_H #include "defines.h" -#include "proximity_info_params.h" +#include "suggest/core/layout/proximity_info_params.h" namespace latinime { class TouchPositionCorrectionUtils { diff --git a/native/jni/src/suggest/core/session/dic_traverse_session.cpp b/native/jni/src/suggest/core/session/dic_traverse_session.cpp index f9f1c0915..4e634500c 100644 --- a/native/jni/src/suggest/core/session/dic_traverse_session.cpp +++ b/native/jni/src/suggest/core/session/dic_traverse_session.cpp @@ -16,12 +16,12 @@ #include "suggest/core/session/dic_traverse_session.h" -#include "binary_format.h" #include "defines.h" -#include "dictionary.h" #include "dic_traverse_wrapper.h" #include "jni.h" #include "suggest/core/dicnode/dic_node_utils.h" +#include "suggest/core/dictionary/binary_format.h" +#include "suggest/core/dictionary/dictionary.h" namespace latinime { diff --git a/native/jni/src/suggest/core/session/dic_traverse_session.h b/native/jni/src/suggest/core/session/dic_traverse_session.h index c774eae71..e5c7f8e0c 100644 --- a/native/jni/src/suggest/core/session/dic_traverse_session.h +++ b/native/jni/src/suggest/core/session/dic_traverse_session.h @@ -22,8 +22,8 @@ #include "defines.h" #include "jni.h" -#include "multi_bigram_map.h" #include "suggest/core/dicnode/dic_nodes_cache.h" +#include "suggest/core/dictionary/multi_bigram_map.h" #include "suggest/core/layout/proximity_info_state.h" namespace latinime { diff --git a/native/jni/src/suggest/core/suggest.cpp b/native/jni/src/suggest/core/suggest.cpp index 8fe8fbc95..94441877a 100644 --- a/native/jni/src/suggest/core/suggest.cpp +++ b/native/jni/src/suggest/core/suggest.cpp @@ -17,18 +17,18 @@ #include "suggest/core/suggest.h" #include "char_utils.h" -#include "dictionary.h" -#include "digraph_utils.h" #include "suggest/core/dicnode/dic_node.h" #include "suggest/core/dicnode/dic_node_priority_queue.h" #include "suggest/core/dicnode/dic_node_vector.h" +#include "suggest/core/dictionary/dictionary.h" +#include "suggest/core/dictionary/digraph_utils.h" #include "suggest/core/dictionary/shortcut_utils.h" +#include "suggest/core/dictionary/terminal_attributes.h" #include "suggest/core/layout/proximity_info.h" #include "suggest/core/policy/scoring.h" #include "suggest/core/policy/traversal.h" #include "suggest/core/policy/weighting.h" #include "suggest/core/session/dic_traverse_session.h" -#include "terminal_attributes.h" namespace latinime { diff --git a/native/jni/src/unigram_dictionary.cpp b/native/jni/src/unigram_dictionary.cpp index 08cd7b7fd..1133256c4 100644 --- a/native/jni/src/unigram_dictionary.cpp +++ b/native/jni/src/unigram_dictionary.cpp @@ -18,13 +18,13 @@ #define LOG_TAG "LatinIME: unigram_dictionary.cpp" -#include "binary_format.h" #include "char_utils.h" #include "defines.h" -#include "dictionary.h" -#include "digraph_utils.h" +#include "suggest/core/dictionary/binary_format.h" +#include "suggest/core/dictionary/dictionary.h" +#include "suggest/core/dictionary/digraph_utils.h" +#include "suggest/core/dictionary/terminal_attributes.h" #include "suggest/core/layout/proximity_info.h" -#include "terminal_attributes.h" #include "unigram_dictionary.h" #include "words_priority_queue.h" #include "words_priority_queue_pool.h" diff --git a/native/jni/src/unigram_dictionary.h b/native/jni/src/unigram_dictionary.h index a64a539bd..a50503256 100644 --- a/native/jni/src/unigram_dictionary.h +++ b/native/jni/src/unigram_dictionary.h @@ -19,8 +19,9 @@ #include #include + #include "defines.h" -#include "digraph_utils.h" +#include "suggest/core/dictionary/digraph_utils.h" namespace latinime {