From addea83bad5751308fef508d79c6989b8872f050 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Mon, 3 Jun 2013 12:25:57 +0900 Subject: [PATCH] Create "src/utils" directory Change-Id: I0b7c51d181edc4786e343f7a953367b040ee6b66 --- native/jni/Android.mk | 4 ++-- native/jni/src/bigram_dictionary.cpp | 2 +- native/jni/src/correction.cpp | 2 +- native/jni/src/correction.h | 2 +- native/jni/src/suggest/core/dicnode/dic_node.h | 2 +- native/jni/src/suggest/core/dicnode/dic_node_utils.cpp | 2 +- native/jni/src/suggest/core/dictionary/binary_format.h | 4 ++-- native/jni/src/suggest/core/dictionary/digraph_utils.cpp | 2 +- native/jni/src/suggest/core/dictionary/multi_bigram_map.h | 2 +- native/jni/src/suggest/core/layout/proximity_info.cpp | 2 +- native/jni/src/suggest/core/layout/proximity_info.h | 2 +- .../jni/src/suggest/core/layout/proximity_info_state.cpp | 2 +- native/jni/src/suggest/core/layout/proximity_info_state.h | 2 +- .../src/suggest/core/layout/proximity_info_state_utils.h | 2 +- native/jni/src/suggest/core/layout/proximity_info_utils.h | 4 ++-- .../jni/src/suggest/policyimpl/typing/typing_traversal.h | 2 +- .../jni/src/suggest/policyimpl/typing/typing_weighting.h | 2 +- .../utils/damerau_levenshtein_edit_distance_policy.h | 2 +- native/jni/src/unigram_dictionary.cpp | 2 +- .../src/{suggest/core/dictionary => utils}/char_utils.cpp | 7 +++---- .../src/{suggest/core/dictionary => utils}/char_utils.h | 0 native/jni/src/{ => utils}/hash_map_compat.h | 0 22 files changed, 25 insertions(+), 26 deletions(-) rename native/jni/src/{suggest/core/dictionary => utils}/char_utils.cpp (99%) rename native/jni/src/{suggest/core/dictionary => utils}/char_utils.h (100%) rename native/jni/src/{ => utils}/hash_map_compat.h (100%) diff --git a/native/jni/Android.mk b/native/jni/Android.mk index 0631b2255..f56223f74 100644 --- a/native/jni/Android.mk +++ b/native/jni/Android.mk @@ -57,7 +57,6 @@ LATIN_IME_CORE_SRC_FILES := \ dic_node_utils.cpp \ dic_nodes_cache.cpp) \ $(addprefix suggest/core/dictionary/, \ - char_utils.cpp \ binary_dictionary_format.cpp \ byte_array_utils.cpp \ dictionary.cpp \ @@ -76,7 +75,8 @@ LATIN_IME_CORE_SRC_FILES := \ typing_scoring.cpp \ typing_suggest_policy.cpp \ typing_traversal.cpp \ - typing_weighting.cpp) + typing_weighting.cpp) \ + utils/char_utils.cpp LOCAL_SRC_FILES := \ $(LATIN_IME_JNI_SRC_FILES) \ diff --git a/native/jni/src/bigram_dictionary.cpp b/native/jni/src/bigram_dictionary.cpp index b57227880..59d1b19b6 100644 --- a/native/jni/src/bigram_dictionary.cpp +++ b/native/jni/src/bigram_dictionary.cpp @@ -24,9 +24,9 @@ #include "suggest/core/dictionary/binary_dictionary_info.h" #include "suggest/core/dictionary/binary_format.h" #include "suggest/core/dictionary/bloom_filter.h" -#include "suggest/core/dictionary/char_utils.h" #include "suggest/core/dictionary/dictionary.h" #include "suggest/core/dictionary/probability_utils.h" +#include "utils/char_utils.h" namespace latinime { diff --git a/native/jni/src/correction.cpp b/native/jni/src/correction.cpp index 3dc2f3748..feed5622b 100644 --- a/native/jni/src/correction.cpp +++ b/native/jni/src/correction.cpp @@ -20,11 +20,11 @@ #include "correction.h" #include "defines.h" -#include "suggest/core/dictionary/char_utils.h" #include "suggest/core/layout/proximity_info_state.h" #include "suggest/core/layout/touch_position_correction_utils.h" #include "suggest/policyimpl/utils/edit_distance.h" #include "suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy.h" +#include "utils/char_utils.h" namespace latinime { diff --git a/native/jni/src/correction.h b/native/jni/src/correction.h index 3f60d48cf..84d6429ba 100644 --- a/native/jni/src/correction.h +++ b/native/jni/src/correction.h @@ -21,8 +21,8 @@ #include "correction_state.h" #include "defines.h" -#include "suggest/core/dictionary/char_utils.h" #include "suggest/core/layout/proximity_info_state.h" +#include "utils/char_utils.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 14bd2d57a..3f64d07b2 100644 --- a/native/jni/src/suggest/core/dicnode/dic_node.h +++ b/native/jni/src/suggest/core/dicnode/dic_node.h @@ -22,8 +22,8 @@ #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/char_utils.h" #include "suggest/core/dictionary/digraph_utils.h" +#include "utils/char_utils.h" #if DEBUG_DICT #define LOGI_SHOW_ADD_COST_PROP \ 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 46dbe4364..3deee1a42 100644 --- a/native/jni/src/suggest/core/dicnode/dic_node_utils.cpp +++ b/native/jni/src/suggest/core/dicnode/dic_node_utils.cpp @@ -22,11 +22,11 @@ #include "suggest/core/dicnode/dic_node_vector.h" #include "suggest/core/dictionary/binary_dictionary_info.h" #include "suggest/core/dictionary/binary_format.h" -#include "suggest/core/dictionary/char_utils.h" #include "suggest/core/dictionary/multi_bigram_map.h" #include "suggest/core/dictionary/probability_utils.h" #include "suggest/core/layout/proximity_info.h" #include "suggest/core/layout/proximity_info_state.h" +#include "utils/char_utils.h" namespace latinime { diff --git a/native/jni/src/suggest/core/dictionary/binary_format.h b/native/jni/src/suggest/core/dictionary/binary_format.h index 3bacc0982..1b57793fa 100644 --- a/native/jni/src/suggest/core/dictionary/binary_format.h +++ b/native/jni/src/suggest/core/dictionary/binary_format.h @@ -20,10 +20,10 @@ #include #include -#include "hash_map_compat.h" #include "suggest/core/dictionary/bloom_filter.h" -#include "suggest/core/dictionary/char_utils.h" #include "suggest/core/dictionary/probability_utils.h" +#include "utils/char_utils.h" +#include "utils/hash_map_compat.h" namespace latinime { diff --git a/native/jni/src/suggest/core/dictionary/digraph_utils.cpp b/native/jni/src/suggest/core/dictionary/digraph_utils.cpp index e8cdd5352..f53e56ef1 100644 --- a/native/jni/src/suggest/core/dictionary/digraph_utils.cpp +++ b/native/jni/src/suggest/core/dictionary/digraph_utils.cpp @@ -18,7 +18,7 @@ #include "defines.h" #include "suggest/core/dictionary/binary_format.h" -#include "suggest/core/dictionary/char_utils.h" +#include "utils/char_utils.h" namespace latinime { diff --git a/native/jni/src/suggest/core/dictionary/multi_bigram_map.h b/native/jni/src/suggest/core/dictionary/multi_bigram_map.h index b17c75803..ba97e5842 100644 --- a/native/jni/src/suggest/core/dictionary/multi_bigram_map.h +++ b/native/jni/src/suggest/core/dictionary/multi_bigram_map.h @@ -18,9 +18,9 @@ #define LATINIME_MULTI_BIGRAM_MAP_H #include "defines.h" -#include "hash_map_compat.h" #include "suggest/core/dictionary/binary_dictionary_info.h" #include "suggest/core/dictionary/binary_format.h" +#include "utils/hash_map_compat.h" namespace latinime { diff --git a/native/jni/src/suggest/core/layout/proximity_info.cpp b/native/jni/src/suggest/core/layout/proximity_info.cpp index 0b5d71a43..80355c148 100644 --- a/native/jni/src/suggest/core/layout/proximity_info.cpp +++ b/native/jni/src/suggest/core/layout/proximity_info.cpp @@ -23,10 +23,10 @@ #include "defines.h" #include "jni.h" -#include "suggest/core/dictionary/char_utils.h" #include "suggest/core/layout/additional_proximity_chars.h" #include "suggest/core/layout/geometry_utils.h" #include "suggest/core/layout/proximity_info_params.h" +#include "utils/char_utils.h" namespace latinime { diff --git a/native/jni/src/suggest/core/layout/proximity_info.h b/native/jni/src/suggest/core/layout/proximity_info.h index 6d2ddd4bc..6ca2fdd7b 100644 --- a/native/jni/src/suggest/core/layout/proximity_info.h +++ b/native/jni/src/suggest/core/layout/proximity_info.h @@ -18,9 +18,9 @@ #define LATINIME_PROXIMITY_INFO_H #include "defines.h" -#include "hash_map_compat.h" #include "jni.h" #include "suggest/core/layout/proximity_info_utils.h" +#include "utils/hash_map_compat.h" namespace latinime { diff --git a/native/jni/src/suggest/core/layout/proximity_info_state.cpp b/native/jni/src/suggest/core/layout/proximity_info_state.cpp index 412d5508b..4e53992d4 100644 --- a/native/jni/src/suggest/core/layout/proximity_info_state.cpp +++ b/native/jni/src/suggest/core/layout/proximity_info_state.cpp @@ -23,10 +23,10 @@ #include #include "defines.h" -#include "suggest/core/dictionary/char_utils.h" #include "suggest/core/layout/geometry_utils.h" #include "suggest/core/layout/proximity_info.h" #include "suggest/core/layout/proximity_info_state_utils.h" +#include "utils/char_utils.h" namespace latinime { diff --git a/native/jni/src/suggest/core/layout/proximity_info_state.h b/native/jni/src/suggest/core/layout/proximity_info_state.h index a971294e3..0079ab5b8 100644 --- a/native/jni/src/suggest/core/layout/proximity_info_state.h +++ b/native/jni/src/suggest/core/layout/proximity_info_state.h @@ -21,9 +21,9 @@ #include #include "defines.h" -#include "hash_map_compat.h" #include "suggest/core/layout/proximity_info_params.h" #include "suggest/core/layout/proximity_info_state_utils.h" +#include "utils/hash_map_compat.h" namespace latinime { diff --git a/native/jni/src/suggest/core/layout/proximity_info_state_utils.h b/native/jni/src/suggest/core/layout/proximity_info_state_utils.h index 1837c7ab6..66fe07926 100644 --- a/native/jni/src/suggest/core/layout/proximity_info_state_utils.h +++ b/native/jni/src/suggest/core/layout/proximity_info_state_utils.h @@ -21,7 +21,7 @@ #include #include "defines.h" -#include "hash_map_compat.h" +#include "utils/hash_map_compat.h" namespace latinime { class ProximityInfo; diff --git a/native/jni/src/suggest/core/layout/proximity_info_utils.h b/native/jni/src/suggest/core/layout/proximity_info_utils.h index 3588f4df8..54f7539d1 100644 --- a/native/jni/src/suggest/core/layout/proximity_info_utils.h +++ b/native/jni/src/suggest/core/layout/proximity_info_utils.h @@ -20,10 +20,10 @@ #include #include "defines.h" -#include "hash_map_compat.h" -#include "suggest/core/dictionary/char_utils.h" #include "suggest/core/layout/additional_proximity_chars.h" #include "suggest/core/layout/geometry_utils.h" +#include "utils/char_utils.h" +#include "utils/hash_map_compat.h" namespace latinime { class ProximityInfoUtils { diff --git a/native/jni/src/suggest/policyimpl/typing/typing_traversal.h b/native/jni/src/suggest/policyimpl/typing/typing_traversal.h index e0664185c..e21b318e6 100644 --- a/native/jni/src/suggest/policyimpl/typing/typing_traversal.h +++ b/native/jni/src/suggest/policyimpl/typing/typing_traversal.h @@ -22,11 +22,11 @@ #include "defines.h" #include "suggest/core/dicnode/dic_node.h" #include "suggest/core/dicnode/dic_node_vector.h" -#include "suggest/core/dictionary/char_utils.h" #include "suggest/core/layout/proximity_info_state.h" #include "suggest/core/policy/traversal.h" #include "suggest/core/session/dic_traverse_session.h" #include "suggest/policyimpl/typing/scoring_params.h" +#include "utils/char_utils.h" namespace latinime { class TypingTraversal : public Traversal { diff --git a/native/jni/src/suggest/policyimpl/typing/typing_weighting.h b/native/jni/src/suggest/policyimpl/typing/typing_weighting.h index 36d496a27..17fa11082 100644 --- a/native/jni/src/suggest/policyimpl/typing/typing_weighting.h +++ b/native/jni/src/suggest/policyimpl/typing/typing_weighting.h @@ -19,11 +19,11 @@ #include "defines.h" #include "suggest/core/dicnode/dic_node_utils.h" -#include "suggest/core/dictionary/char_utils.h" #include "suggest/core/layout/touch_position_correction_utils.h" #include "suggest/core/policy/weighting.h" #include "suggest/core/session/dic_traverse_session.h" #include "suggest/policyimpl/typing/scoring_params.h" +#include "utils/char_utils.h" namespace latinime { diff --git a/native/jni/src/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy.h b/native/jni/src/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy.h index 09f986adf..81614bc9c 100644 --- a/native/jni/src/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy.h +++ b/native/jni/src/suggest/policyimpl/utils/damerau_levenshtein_edit_distance_policy.h @@ -17,8 +17,8 @@ #ifndef LATINIME_DAEMARU_LEVENSHTEIN_EDIT_DISTANCE_POLICY_H #define LATINIME_DAEMARU_LEVENSHTEIN_EDIT_DISTANCE_POLICY_H -#include "suggest/core/dictionary/char_utils.h" #include "suggest/policyimpl/utils/edit_distance_policy.h" +#include "utils/char_utils.h" namespace latinime { diff --git a/native/jni/src/unigram_dictionary.cpp b/native/jni/src/unigram_dictionary.cpp index 8fd015c62..5820a1d0e 100644 --- a/native/jni/src/unigram_dictionary.cpp +++ b/native/jni/src/unigram_dictionary.cpp @@ -21,12 +21,12 @@ #include "defines.h" #include "suggest/core/dictionary/binary_dictionary_info.h" #include "suggest/core/dictionary/binary_format.h" -#include "suggest/core/dictionary/char_utils.h" #include "suggest/core/dictionary/dictionary.h" #include "suggest/core/dictionary/digraph_utils.h" #include "suggest/core/dictionary/probability_utils.h" #include "suggest/core/dictionary/terminal_attributes.h" #include "suggest/core/layout/proximity_info.h" +#include "utils/char_utils.h" #include "unigram_dictionary.h" #include "words_priority_queue.h" #include "words_priority_queue_pool.h" diff --git a/native/jni/src/suggest/core/dictionary/char_utils.cpp b/native/jni/src/utils/char_utils.cpp similarity index 99% rename from native/jni/src/suggest/core/dictionary/char_utils.cpp rename to native/jni/src/utils/char_utils.cpp index 8d40e54c9..0e7039610 100644 --- a/native/jni/src/suggest/core/dictionary/char_utils.cpp +++ b/native/jni/src/utils/char_utils.cpp @@ -14,7 +14,7 @@ * limitations under the License. */ -#include "suggest/core/dictionary/char_utils.h" +#include "utils/char_utils.h" #include @@ -37,7 +37,7 @@ struct LatinCapitalSmallPair { * $ apt-get install libicu-dev * * 3. Build the following code - * $ g++ -o char_utils -I../../.. -DUPDATING_CHAR_UTILS char_utils.cpp -licuuc + * $ g++ -o char_utils -I.. -DUPDATING_CHAR_UTILS char_utils.cpp -licuuc */ #ifdef UPDATING_CHAR_UTILS #include @@ -70,8 +70,7 @@ extern "C" int main() { * * 5. Update the SORTED_CHAR_MAP[] array below with the output above. * Then, rebuild with -DCONFIRMING_CHAR_UTILS and confirm the program exits successfully. - * $ g++ -o char_utils -I../../.. -DUPDATING_CHAR_UTILS -DCONFIRMING_CHAR_UTILS char_utils.cpp \ - * -licuuc + * $ g++ -o char_utils -I.. -DUPDATING_CHAR_UTILS -DCONFIRMING_CHAR_UTILS char_utils.cpp -licuuc * $ ./char_utils * $ */ diff --git a/native/jni/src/suggest/core/dictionary/char_utils.h b/native/jni/src/utils/char_utils.h similarity index 100% rename from native/jni/src/suggest/core/dictionary/char_utils.h rename to native/jni/src/utils/char_utils.h diff --git a/native/jni/src/hash_map_compat.h b/native/jni/src/utils/hash_map_compat.h similarity index 100% rename from native/jni/src/hash_map_compat.h rename to native/jni/src/utils/hash_map_compat.h