Loading src/PyZyDoublePinyinContext.cc +6 −8 Original line number Diff line number Diff line Loading @@ -56,14 +56,10 @@ DoublePinyinContext::~DoublePinyinContext () bool DoublePinyinContext::insert (char ch) { int id; /* is full */ if (G_UNLIKELY (m_text.length () >= MAX_PINYIN_LEN)) return true; const int id = ID (ch); id = ID (ch); if (id == -1) { /* it is not availidate ch */ /* it is not available ch */ return false; } Loading @@ -72,6 +68,10 @@ DoublePinyinContext::insert (char ch) return false; } /* is full */ if (G_UNLIKELY (m_text.length () >= MAX_PINYIN_LEN)) return true; m_text.insert (m_cursor++, ch); if (m_cursor > m_pinyin_len + 2 || updatePinyin (false) == false) { Loading Loading @@ -447,5 +447,3 @@ DoublePinyinContext::updatePinyin (bool all) } }; // namespace PyZy src/PyZyFullPinyinContext.cc +7 −0 Original line number Diff line number Diff line Loading @@ -19,10 +19,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include <cctype> #include "PyZyFullPinyinContext.h" #include "PyZyConfig.h" #include "PyZyPinyinParser.h" namespace PyZy { FullPinyinContext::FullPinyinContext (Config & config, PhoneticContext::Observer *observer) Loading @@ -37,6 +39,11 @@ FullPinyinContext::~FullPinyinContext (void) bool FullPinyinContext::insert (char ch) { if (!islower(ch) && ch != '\'') { /* it is not available ch */ return false; } /* is full */ if (G_UNLIKELY (m_text.length () >= MAX_PINYIN_LEN)) return true; Loading Loading
src/PyZyDoublePinyinContext.cc +6 −8 Original line number Diff line number Diff line Loading @@ -56,14 +56,10 @@ DoublePinyinContext::~DoublePinyinContext () bool DoublePinyinContext::insert (char ch) { int id; /* is full */ if (G_UNLIKELY (m_text.length () >= MAX_PINYIN_LEN)) return true; const int id = ID (ch); id = ID (ch); if (id == -1) { /* it is not availidate ch */ /* it is not available ch */ return false; } Loading @@ -72,6 +68,10 @@ DoublePinyinContext::insert (char ch) return false; } /* is full */ if (G_UNLIKELY (m_text.length () >= MAX_PINYIN_LEN)) return true; m_text.insert (m_cursor++, ch); if (m_cursor > m_pinyin_len + 2 || updatePinyin (false) == false) { Loading Loading @@ -447,5 +447,3 @@ DoublePinyinContext::updatePinyin (bool all) } }; // namespace PyZy
src/PyZyFullPinyinContext.cc +7 −0 Original line number Diff line number Diff line Loading @@ -19,10 +19,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */ #include <cctype> #include "PyZyFullPinyinContext.h" #include "PyZyConfig.h" #include "PyZyPinyinParser.h" namespace PyZy { FullPinyinContext::FullPinyinContext (Config & config, PhoneticContext::Observer *observer) Loading @@ -37,6 +39,11 @@ FullPinyinContext::~FullPinyinContext (void) bool FullPinyinContext::insert (char ch) { if (!islower(ch) && ch != '\'') { /* it is not available ch */ return false; } /* is full */ if (G_UNLIKELY (m_text.length () >= MAX_PINYIN_LEN)) return true; Loading