summaryrefslogtreecommitdiffstats
path: root/src/storage/pinyin_parser2.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/storage/pinyin_parser2.h')
-rw-r--r--src/storage/pinyin_parser2.h101
1 files changed, 0 insertions, 101 deletions
diff --git a/src/storage/pinyin_parser2.h b/src/storage/pinyin_parser2.h
index b7d30ad..4a80495 100644
--- a/src/storage/pinyin_parser2.h
+++ b/src/storage/pinyin_parser2.h
@@ -400,107 +400,6 @@ public:
};
-/* compare pinyins with chewing internal representations. */
-inline int pinyin_compare_initial2(pinyin_option_t options,
- ChewingInitial lhs,
- ChewingInitial rhs) {
- if (lhs == rhs)
- return 0;
-
- if ((options & PINYIN_AMB_C_CH) &&
- ((lhs == CHEWING_C && rhs == CHEWING_CH) ||
- (lhs == CHEWING_CH && rhs == CHEWING_C)))
- return 0;
-
- if ((options & PINYIN_AMB_S_SH) &&
- ((lhs == CHEWING_S && rhs == CHEWING_SH) ||
- (lhs == CHEWING_SH && rhs == CHEWING_S)))
- return 0;
-
- if ((options & PINYIN_AMB_Z_ZH) &&
- ((lhs == CHEWING_Z && rhs == CHEWING_ZH) ||
- (lhs == CHEWING_ZH && rhs == CHEWING_Z)))
- return 0;
-
- if ((options & PINYIN_AMB_F_H) &&
- ((lhs == CHEWING_F && rhs == CHEWING_H) ||
- (lhs == CHEWING_H && rhs == CHEWING_F)))
- return 0;
-
- if ((options & PINYIN_AMB_L_N) &&
- ((lhs == CHEWING_L && rhs == CHEWING_N) ||
- (lhs == CHEWING_N && rhs == CHEWING_L)))
- return 0;
-
- if ((options & PINYIN_AMB_L_R) &&
- ((lhs == CHEWING_L && rhs == CHEWING_R) ||
- (lhs == CHEWING_R && rhs == CHEWING_L)))
- return 0;
-
- if ((options & PINYIN_AMB_G_K) &&
- ((lhs == CHEWING_G && rhs == CHEWING_K) ||
- (lhs == CHEWING_K && rhs == CHEWING_G)))
- return 0;
-
- return (lhs - rhs);
-}
-
-
-inline int pinyin_compare_middle_and_final2(pinyin_option_t options,
- ChewingMiddle middle_lhs,
- ChewingMiddle middle_rhs,
- ChewingFinal final_lhs,
- ChewingFinal final_rhs) {
- if (middle_lhs == middle_rhs && final_lhs == final_rhs)
- return 0;
-
- /* both pinyin and chewing incomplete options will enable this. */
- if (options & (PINYIN_INCOMPLETE | ZHUYIN_INCOMPLETE)) {
- if (middle_lhs == CHEWING_ZERO_MIDDLE &&
- final_lhs == CHEWING_ZERO_FINAL)
- return 0;
- if (middle_rhs == CHEWING_ZERO_MIDDLE &&
- final_rhs == CHEWING_ZERO_FINAL)
- return 0;
- }
-
- /* compare chewing middle first. */
- int middle_diff = middle_lhs - middle_rhs;
- if (middle_diff)
- return middle_diff;
-
- if ((options & PINYIN_AMB_AN_ANG) &&
- ((final_lhs == CHEWING_AN && final_rhs == CHEWING_ANG) ||
- (final_lhs == CHEWING_ANG && final_rhs == CHEWING_AN)))
- return 0;
-
- if ((options & PINYIN_AMB_EN_ENG) &&
- ((final_lhs == CHEWING_EN && final_rhs == CHEWING_ENG) ||
- (final_lhs == CHEWING_ENG && final_rhs == CHEWING_EN)))
- return 0;
-
- if ((options & PINYIN_AMB_IN_ING) &&
- ((final_lhs == PINYIN_IN && final_rhs == PINYIN_ING) ||
- (final_lhs == PINYIN_ING && final_rhs == PINYIN_IN)))
- return 0;
-
- return (final_lhs - final_rhs);
-}
-
-
-inline int pinyin_compare_tone2(pinyin_option_t options,
- ChewingTone lhs,
- ChewingTone rhs) {
- if (lhs == rhs)
- return 0;
- if (lhs == CHEWING_ZERO_TONE)
- return 0;
- if (rhs == CHEWING_ZERO_TONE)
- return 0;
- return (lhs - rhs);
-}
-
-
};
#endif