summaryrefslogtreecommitdiffstats
path: root/src/storage/pinyin_phrase.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/storage/pinyin_phrase.h')
-rw-r--r--src/storage/pinyin_phrase.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/storage/pinyin_phrase.h b/src/storage/pinyin_phrase.h
index 61c0c6e..b9a8812 100644
--- a/src/storage/pinyin_phrase.h
+++ b/src/storage/pinyin_phrase.h
@@ -187,8 +187,28 @@ public:
}
};
+
//for find the element in the phrase array
template<int phrase_length>
+inline int phrase_exact_compare(const PinyinIndexItem<phrase_length> &lhs,
+ const PinyinIndexItem<phrase_length> &rhs)
+{
+ PinyinKey * key_lhs = (PinyinKey *) lhs.m_keys;
+ PinyinKey * key_rhs = (PinyinKey *) rhs.m_keys;
+ return pinyin_exact_compare(key_lhs, key_rhs, phrase_length);
+}
+
+template<int phrase_length>
+inline bool phrase_exact_less_than(const PinyinIndexItem<phrase_length> &lhs,
+ const PinyinIndexItem<phrase_length> &rhs)
+{
+ return 0 > phrase_exact_compare<phrase_length>(lhs, rhs);
+}
+
+
+#if 0
+
+template<int phrase_length>
class PhraseExactCompare
: public std_lite::binary_function <const PinyinIndexItem<phrase_length>
,const PinyinIndexItem<phrase_length>, int>
@@ -219,6 +239,8 @@ class PhraseExactLessThan
}
};
+#endif
+
};
#endif