LibPinyinBopomofoEditor::updatePinyin (void)
{
if (G_UNLIKELY (m_text.empty ())) {
- m_pinyins.clear ();
m_pinyin_len = 0;
/* TODO: check whether to replace "" with NULL. */
pinyin_parse_more_chewings (m_instance, "");
LibPinyinDoublePinyinEditor::updatePinyin (void)
{
if (G_UNLIKELY (m_text.empty ())) {
- m_pinyins.clear ();
m_pinyin_len = 0;
/* TODO: check whether to replace "" with NULL. */
pinyin_parse_more_double_pinyins (m_instance, "");
LibPinyinFullPinyinEditor::updatePinyin (void)
{
if (G_UNLIKELY (m_text.empty ())) {
- m_pinyins.clear ();
m_pinyin_len = 0;
/* TODO: check whether to replace "" with NULL. */
pinyin_parse_more_full_pinyins (m_instance, "");
return;
}
+ PinyinArray pinyins (MAX_PINYIN_LEN);
+
m_pinyin_len = PinyinParser::parse (m_text, // text
m_text.length (), // text length
m_config.option (), // option
- m_pinyins, // result
+ pinyins, // result
MAX_PHRASE_LEN); // max result length
/* propagate to libpinyin */
g_array_set_size (m_instance->m_pinyin_poses, 0);
PinyinKey key; PinyinKeyPos pos;
- PinyinArray::const_iterator iter = m_pinyins.begin ();
- for ( ; iter != m_pinyins.end (); ++iter ) {
+ PinyinArray::const_iterator iter = pinyins.begin ();
+ for ( ; iter != pinyins.end (); ++iter ) {
PinyinSegment py = *iter;
pinyin_parse_full_pinyin (m_instance, py.pinyin->text, &key);
pos.set_pos (py.begin); pos.set_length (py.len);
LibPinyinPhoneticEditor::LibPinyinPhoneticEditor (PinyinProperties &props,
Config &config):
Editor (props, config),
- m_pinyins (MAX_PHRASE_LEN),
m_pinyin_len (0),
m_lookup_table (m_config.pageSize ())
{
void
LibPinyinPhoneticEditor::reset (void)
{
- m_pinyins.clear ();
m_pinyin_len = 0;
m_lookup_table.clear ();