summaryrefslogtreecommitdiffstats
path: root/src/pinyin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/pinyin.cpp')
-rw-r--r--src/pinyin.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/pinyin.cpp b/src/pinyin.cpp
index 26653e8..fcb82ac 100644
--- a/src/pinyin.cpp
+++ b/src/pinyin.cpp
@@ -3290,6 +3290,29 @@ bool pinyin_remember_user_input(pinyin_instance_t * instance,
return result;
}
+bool pinyin_is_user_candidate(pinyin_instance_t * instance,
+ lookup_candidate_t * candidate) {
+ if (NORMAL_CANDIDATE != candidate->m_candidate_type)
+ return false;
+
+ phrase_token_t token = candidate->m_token;
+ guint8 index = PHRASE_INDEX_LIBRARY_INDEX(token);
+ if (USER_DICTIONARY != index)
+ return false;
+
+ return true;
+}
+
+bool pinyin_remove_user_candidate(pinyin_instance_t * instance,
+ lookup_candidate_t * candidate) {
+ assert(NORMAL_CANDIDATE == candidate->m_candidate_type);
+
+ phrase_token_t token = candidate->m_token;
+ guint8 index = PHRASE_INDEX_LIBRARY_INDEX(token);
+ assert(USER_DICTIONARY == index);
+}
+
+
/**
* Note: prefix is the text before the pre-edit string.
*/