PinyinKeyPos *pos = &g_array_index (pinyin_poses, PinyinKeyPos, i);
guint cursor = pos->m_raw_begin;
+ gchar * str = NULL;
if (G_UNLIKELY (cursor == m_cursor)) { /* at word boundary. */
- m_buffer << '|' << key->get_pinyin_string ();
+ pinyin_get_pinyin_string(m_instance, key, &str);
+ m_buffer << '|' << str;
+ g_free(str);
} else if (G_LIKELY ( cursor < m_cursor &&
m_cursor < pos->m_raw_end )) { /* in word */
/* raw text */
m_buffer << ' ' << raw.substr (0, offset)
<< '|' << raw.substr (offset);
} else { /* other words */
- m_buffer << ' ' << key->get_pinyin_string ();
+ pinyin_get_pinyin_string(m_instance, key, &str);
+ m_buffer << ' ' << str;
+ g_free(str);
}
}
PinyinKeyPos *pos = &g_array_index (pinyin_poses, PinyinKeyPos, i);
guint cursor = pos->m_raw_begin;
+ gchar * str = NULL;
if (G_UNLIKELY (cursor == m_cursor)) { /* at word boundary. */
- m_buffer << '|' << key->get_pinyin_string ();
+ pinyin_get_pinyin_string(m_instance, key, &str);
+ m_buffer << '|' << str;
+ g_free(str);
} else if (G_LIKELY ( cursor < m_cursor &&
m_cursor < pos->m_raw_end )) { /* in word */
/* raw text */
m_buffer << ' ' << raw.substr (0, offset)
<< '|' << raw.substr (offset);
} else { /* other words */
- m_buffer << ' ' << key->get_pinyin_string ();
+ pinyin_get_pinyin_string(m_instance, key, &str);
+ m_buffer << ' ' << str;
+ g_free(str);
}
}
for (guint i = 0; i < pinyin_keys->len; ++i) {
if (G_LIKELY (i))
m_buffer << ' ';
+
PinyinKey *key = &g_array_index (pinyin_keys, PinyinKey, i);
- m_buffer << key->get_pinyin_string ();
+ gchar * str = NULL;
+ pinyin_get_pinyin_string(m_instance, key, &str);
+ m_buffer << str;
+ g_free(str);
}
/* append rest text */