From 0cf6dd37e1dbd21195e78756aa90b36e59914f71 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 14 Sep 2011 12:33:13 +0800 Subject: clean up pinyin_phrase.h --- src/storage/pinyin_phrase.h | 73 --------------------------------------------- 1 file changed, 73 deletions(-) diff --git a/src/storage/pinyin_phrase.h b/src/storage/pinyin_phrase.h index df6f26a..0c7bbc5 100644 --- a/src/storage/pinyin_phrase.h +++ b/src/storage/pinyin_phrase.h @@ -27,16 +27,6 @@ namespace pinyin{ -/* -static inline int pinyin_utility_sign(int value){ - if(value > 0) - return 1; - else if (value < 0) - return -1; - else return 0; -} -*/ - inline int pinyin_exact_compare(const PinyinKey key_lhs[], const PinyinKey key_rhs[], int phrase_length){ @@ -197,29 +187,6 @@ public: } }; -/* -//just need less than mode -//this method mainly used in pinyin lookup -template -class PhraseCompareWithAmbiguities - : public std_lite::binary_function , - const PinyinIndexItem , int> -{ - const PinyinCustomSettings & m_custom; -public: - PhraseCompareWithAmbiguities - (const PinyinCustomSettings & custom):m_custom(custom){} - - int operator () (const PinyinIndexItem &lhs, - const PinyinIndexItem &rhs) const{ - PinyinKey * key_lhs = (PinyinKey *) lhs.m_keys; - PinyinKey * key_rhs = (PinyinKey *) rhs.m_keys; - return pinyin_compare_with_ambiguities(m_custom, - key_lhs, key_rhs, phrase_length); - } -}; -*/ - //for find the element in the phrase array template class PhraseExactCompare @@ -236,29 +203,6 @@ public: } }; -/* -//for find the element in the phrase array -template -class PhraseExactCompareWithToken - : public std_lite::binary_function - ,const PinyinIndexItem, int> -{ -public: - int operator () (const PinyinIndexItem &lhs, - const PinyinIndexItem &rhs) const{ - PinyinKey * key_lhs = (PinyinKey *) lhs.m_keys; - PinyinKey * key_rhs = (PinyinKey *) rhs.m_keys; - - phrase_token_t token_lhs = lhs.m_token; - phrase_token_t token_rhs = rhs.m_token; - - int result = pinyin_exact_compare(key_lhs, key_rhs, phrase_length); - if ( !result ) - return result; - return pinyin_utility_sign(token_lhs - token_rhs); - } -}; -*/ template class PhraseExactLessThan @@ -275,23 +219,6 @@ class PhraseExactLessThan } }; -/* -template -class PhraseExactLessThanWithToken - : public std_lite::binary_function - ,const PinyinIndexItem, - bool> -{ - private: - PhraseExactCompareWithToken m_compare; - public: - bool operator () (const PinyinIndexItem &lhs, - const PinyinIndexItem &rhs) const{ - return 0 > m_compare(lhs, rhs); - } -}; -*/ - }; #endif -- cgit