ChewingKeyVector keys = g_array_new(FALSE, FALSE, sizeof(ChewingKey));
ChewingKeyRestVector key_rests =
g_array_new(FALSE, FALSE, sizeof(ChewingKeyRest));
+
pinyin_option_t options = PINYIN_CORRECT_ALL | USE_TONE | USE_RESPLIT_TABLE;
int i = 1;
&g_array_index(keys, ChewingKey, i);
ChewingKeyRest * key_rest =
&g_array_index(key_rests, ChewingKeyRest, i);
- printf("%s %d %d\t", key->get_pinyin_string(),
+
+ gchar * pinyins = key->get_pinyin_string();
+ printf("%s %d %d\t", pinyins,
key_rest->m_raw_begin, key_rest->m_raw_end);
+ g_free(pinyins);
}
printf("\n");
#endif
if (linebuf)
free(linebuf);
+ delete parser;
+
+ g_array_free(key_rests, TRUE);
+ g_array_free(keys, TRUE);
+
return 0;
}