/src/im/gpinyin/command/test.cpp
http://ftk.googlecode.com/ · C++ · 27 lines · 23 code · 4 blank · 0 comment · 1 complexity · a82c001e906235511f2774adf6513851 MD5 · raw file
- #include <cstdio>
- #include <cassert>
- #include "pinyinime.h"
- using namespace ime_pinyin;
- int main(int argc, char* argv[])
- {
- unsigned i = 0;
- unsigned nr = 0;
- unsigned size = 0;
- char16 str[64] = {0};
- bool ret = im_open_decoder("./dict_pinyin.dat", "./user.dat");
- assert(ret);
- im_set_max_lens(32, 16);
- im_reset_search();
- nr = im_search("xian'jin", 8);
- printf("%s", im_get_sps_str(&size));
- for(i = 0; i < nr; i++)
- {
- im_get_candidate(i, str, 32);
- }
- im_close_decoder();
- return 0;
- }