ERROR_OUT_OF_RANGE, /* beyond the end of the sub phrase index */
ERROR_FILE_CORRUPTION, /* file is corrupted */
ERROR_INTEGER_OVERFLOW, /* integer is overflowed */
- ERROR_ALREADY_EXISTS /* the sub phrase already exists. */
+ ERROR_ALREADY_EXISTS, /* the sub phrase already exists. */
+ ERROR_NO_USER_TABLE /* the user table is not loaded. */
};
/* For N-gram */
int add_index(int phrase_length, /* in */ ChewingKey keys[],
/* in */ phrase_token_t token) {
if (NULL == m_user_chewing_table)
- return false;
+ return ERROR_NO_USER_TABLE;
return m_user_chewing_table->add_index(phrase_length, keys, token);
}
int remove_index(int phrase_length, /* in */ ChewingKey keys[],
/* in */ phrase_token_t token) {
if (NULL == m_user_chewing_table)
- return false;
+ return ERROR_NO_USER_TABLE;
return m_user_chewing_table->remove_index(phrase_length, keys, token);
}
+
+ /**
+ * FacadeChewingTable::mask_out:
+ * @mask: the mask.
+ * @value: the value.
+ * @returns: whether the mask out operation is successful.
+ *
+ * Mask out the matched chewing index.
+ *
+ */
+ bool mask_out(phrase_token_t mask, phrase_token_t value) {
+ if (NULL == m_user_chewing_table)
+ return false;
+ return m_user_chewing_table->mask_out(mask, value);
+ }
};
};
int add_index(int phrase_length, /* in */ ucs4_t phrase[],
/* in */ phrase_token_t token) {
if (NULL == m_user_phrase_table)
- return false;
+ return ERROR_NO_USER_TABLE;
+
return m_user_phrase_table->add_index
(phrase_length, phrase, token);
}
int remove_index(int phrase_length, /* in */ ucs4_t phrase[],
/* in */ phrase_token_t token) {
if (NULL == m_user_phrase_table)
- return false;
+ return ERROR_NO_USER_TABLE;
+
return m_user_phrase_table->remove_index
(phrase_length, phrase, token);
}
+
+ /**
+ * FacadePhraseTable2::mask_out:
+ * @mask: the mask.
+ * @value: the value.
+ * @returns: whether the mask out operation is successful.
+ *
+ * Mask out the matched phrase index.
+ *
+ */
+ bool mask_out(phrase_token_t mask, phrase_token_t value) {
+ if (NULL == m_user_phrase_table)
+ return false;
+
+ return m_user_phrase_table->mask_out
+ (mask, value);
+ }
};
};