From 7bf1a089547be9add7cb01a5e7b45806031f99ff Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Thu, 23 Jul 2020 15:58:51 +0800 Subject: fixes Network Dictionary --- src/PYLibPinyin.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/PYLibPinyin.cc b/src/PYLibPinyin.cc index 1f9d444..e5a69db 100644 --- a/src/PYLibPinyin.cc +++ b/src/PYLibPinyin.cc @@ -21,6 +21,7 @@ #include "PYLibPinyin.h" #include +#include #include #include "PYPConfig.h" @@ -321,6 +322,8 @@ LibPinyinBackEnd::clearPinyinUserData (const char *target) if (0 == strcmp ("all", target)) { pinyin_mask_out (m_pinyin_context, 0x0, 0x0); + PinyinConfig::instance ().networkDictionaryStartTimestamp (0); + PinyinConfig::instance ().networkDictionaryEndTimestamp (0); } else if (0 == strcmp ("user", target)) { /* clear addon dictionary. */ pinyin_mask_out (m_pinyin_context, PHRASE_INDEX_LIBRARY_MASK, @@ -408,6 +411,10 @@ LibPinyinBackEnd::readNetworkDictionary(pinyin_context_t * context, fclose (dictfile); + /* if network.txt only contains one time stamp entry */ + if (start > loaded) + loaded = start; + pinyin_save (context); return TRUE; } -- cgit