};
-template<int phrase_length>
+template<size_t phrase_length>
class ChewingArrayIndexLevel{
protected:
typedef PinyinIndexItem2<phrase_length> IndexItem;
}
-template<int phrase_length>
+template<size_t phrase_length>
int ChewingArrayIndexLevel<phrase_length>::search
(pinyin_option_t options, /* in */ChewingKey keys[],
/* out */ PhraseIndexRanges ranges) const {
}
/* compress consecutive tokens */
-template<int phrase_length>
+template<size_t phrase_length>
int ChewingArrayIndexLevel<phrase_length>::convert
(pinyin_option_t options, ChewingKey keys[],
IndexItem * begin, IndexItem * end,
#undef CASE
}
-template<int phrase_length>
+template<size_t phrase_length>
int ChewingArrayIndexLevel<phrase_length>::add_index
(/* in */ ChewingKey keys[], /* in */ phrase_token_t token) {
IndexItem * begin, * end;
return ERROR_OK;
}
-template<int phrase_length>
+template<size_t phrase_length>
int ChewingArrayIndexLevel<phrase_length>::remove_index
(/* in */ ChewingKey keys[], /* in */ phrase_token_t token) {
IndexItem * begin, * end;
return true;
}
-template<int phrase_length>
+template<size_t phrase_length>
bool ChewingArrayIndexLevel<phrase_length>::
load(MemoryChunk * chunk, table_offset_t offset, table_offset_t end) {
char * begin = (char *) chunk->begin();
return true;
}
-template<int phrase_length>
+template<size_t phrase_length>
bool ChewingArrayIndexLevel<phrase_length>::
store(MemoryChunk * new_chunk, table_offset_t offset, table_offset_t & end) {
new_chunk->set_content(offset, m_chunk.begin(), m_chunk.size());
}
-template<int phrase_length>
+template<size_t phrase_length>
struct PinyinIndexItem2{
phrase_token_t m_token;
ChewingKey m_keys[phrase_length];
/* for find the element in the phrase array */
-template<int phrase_length>
+template<size_t phrase_length>
inline int phrase_exact_compare2(const PinyinIndexItem2<phrase_length> &lhs,
const PinyinIndexItem2<phrase_length> &rhs)
{
return pinyin_exact_compare2(keys_lhs, keys_rhs, phrase_length);
}
-template<int phrase_length>
+template<size_t phrase_length>
inline bool phrase_exact_less_than2(const PinyinIndexItem2<phrase_length> &lhs,
const PinyinIndexItem2<phrase_length> &rhs)
{