summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pinyin.cpp3
-rw-r--r--src/storage/pinyin_custom2.h19
-rw-r--r--src/storage/pinyin_parser2.cpp5
-rw-r--r--tests/lookup/test_pinyin_lookup.cpp2
-rw-r--r--tests/storage/test_parser2.cpp2
-rw-r--r--tests/test_pinyin.cpp2
-rw-r--r--utils/storage/gen_pinyin_table.cpp2
7 files changed, 10 insertions, 25 deletions
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index 1cf3c10..b64fb7d 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -374,7 +374,8 @@ bool pinyin_iterator_add_phrase(import_iterator_t * iter,
glong len_phrase = 0;
ucs4_t * ucs4_phrase = g_utf8_to_ucs4(phrase, -1, NULL, &len_phrase, NULL);
- pinyin_option_t options = PINYIN_CORRECT_ALL | USE_TONE;
+ /* pinyin_option_t options = PINYIN_CORRECT_ALL | USE_TONE; */
+ pinyin_option_t options = USE_TONE;
FullPinyinParser2 parser;
ChewingKeyVector keys =
g_array_new(FALSE, FALSE, sizeof(ChewingKey));
diff --git a/src/storage/pinyin_custom2.h b/src/storage/pinyin_custom2.h
index 1d1ebe3..505cc36 100644
--- a/src/storage/pinyin_custom2.h
+++ b/src/storage/pinyin_custom2.h
@@ -61,25 +61,6 @@ enum PinyinAmbiguity2{
};
/**
- * PinyinCorrection2:
- *
- * The enums of pinyin corrections.
- *
- */
-
-enum PinyinCorrection2{
- PINYIN_CORRECT_GN_NG = 1U << 21,
- PINYIN_CORRECT_MG_NG = 1U << 22,
- PINYIN_CORRECT_IOU_IU = 1U << 23,
- PINYIN_CORRECT_UEI_UI = 1U << 24,
- PINYIN_CORRECT_UEN_UN = 1U << 25,
- PINYIN_CORRECT_UE_VE = 1U << 26,
- PINYIN_CORRECT_V_U = 1U << 27,
- PINYIN_CORRECT_ON_ONG = 1U << 28,
- PINYIN_CORRECT_ALL = 0xFFU << 21
-};
-
-/**
* @brief enums of Chewing Schemes.
*/
enum ChewingScheme
diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp
index 4c0c6f6..e3f43b2 100644
--- a/src/storage/pinyin_parser2.cpp
+++ b/src/storage/pinyin_parser2.cpp
@@ -45,6 +45,7 @@ static bool check_pinyin_options(pinyin_option_t options, const pinyin_index_ite
return false;
}
+#if 0
/* handle correct pinyin, currently only one flag per item. */
flags &= PINYIN_CORRECT_ALL;
options &= PINYIN_CORRECT_ALL;
@@ -53,6 +54,7 @@ static bool check_pinyin_options(pinyin_option_t options, const pinyin_index_ite
if ((flags & options) != flags)
return false;
}
+#endif
return true;
}
@@ -650,7 +652,8 @@ static bool search_chewing_tones(const chewing_tone_item_t * tone_table,
bool ChewingParser2::parse_one_key(pinyin_option_t options,
ChewingKey & key,
const char *str, int len) const {
- options &= ~(PINYIN_CORRECT_ALL|PINYIN_AMB_ALL);
+ /* options &= ~(PINYIN_CORRECT_ALL|PINYIN_AMB_ALL); */
+ options &= ~PINYIN_AMB_ALL;
char tone = CHEWING_ZERO_TONE;
int symbols_len = len;
diff --git a/tests/lookup/test_pinyin_lookup.cpp b/tests/lookup/test_pinyin_lookup.cpp
index 3175db0..5c1d63a 100644
--- a/tests/lookup/test_pinyin_lookup.cpp
+++ b/tests/lookup/test_pinyin_lookup.cpp
@@ -37,7 +37,7 @@ int main( int argc, char * argv[]){
}
pinyin_option_t options =
- USE_TONE | USE_RESPLIT_TABLE | PINYIN_CORRECT_ALL | PINYIN_AMB_ALL;
+ USE_TONE | USE_RESPLIT_TABLE | PINYIN_AMB_ALL;
FacadeChewingTable largetable;
MemoryChunk * chunk = new MemoryChunk;
diff --git a/tests/storage/test_parser2.cpp b/tests/storage/test_parser2.cpp
index 0fde80d..85edef3 100644
--- a/tests/storage/test_parser2.cpp
+++ b/tests/storage/test_parser2.cpp
@@ -62,7 +62,7 @@ int main(int argc, char * argv[]) {
exit(EINVAL);
}
- pinyin_option_t options = PINYIN_CORRECT_ALL | USE_TONE | USE_RESPLIT_TABLE;
+ pinyin_option_t options = USE_TONE | USE_RESPLIT_TABLE;
if (incomplete)
options |= PINYIN_INCOMPLETE | CHEWING_INCOMPLETE;
diff --git a/tests/test_pinyin.cpp b/tests/test_pinyin.cpp
index f94263b..d41a535 100644
--- a/tests/test_pinyin.cpp
+++ b/tests/test_pinyin.cpp
@@ -30,7 +30,7 @@ int main(int argc, char * argv[]){
pinyin_init("../data", "../data");
pinyin_option_t options =
- PINYIN_CORRECT_ALL | USE_DIVIDED_TABLE | USE_RESPLIT_TABLE |
+ USE_DIVIDED_TABLE | USE_RESPLIT_TABLE |
DYNAMIC_ADJUST;
pinyin_set_options(context, options);
diff --git a/utils/storage/gen_pinyin_table.cpp b/utils/storage/gen_pinyin_table.cpp
index 3b541d1..96b35d5 100644
--- a/utils/storage/gen_pinyin_table.cpp
+++ b/utils/storage/gen_pinyin_table.cpp
@@ -179,7 +179,7 @@ void feed_line(const char * phrase, const char * pinyin, const guint32 freq) {
ChewingKeyRestVector key_rests = g_array_new
(FALSE, FALSE, sizeof(ChewingKeyRest));
- pinyin_option_t options = PINYIN_CORRECT_ALL | USE_TONE;
+ pinyin_option_t options = USE_TONE;
parser.parse(options, keys, key_rests, pinyin, strlen(pinyin));
assert(keys->len == key_rests->len);