PageRenderTime 283ms CodeModel.GetById 161ms app.highlight 3ms RepoModel.GetById 118ms app.codeStats 0ms

/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
 1#include <cstdio>
 2#include <cassert>
 3#include "pinyinime.h"
 4using namespace ime_pinyin;
 5
 6int main(int argc, char* argv[])
 7{
 8	unsigned i = 0;
 9	unsigned nr = 0;
10	unsigned size = 0;
11	char16 str[64] = {0};
12	bool ret = im_open_decoder("./dict_pinyin.dat", "./user.dat");
13	assert(ret);
14
15	im_set_max_lens(32, 16);
16	im_reset_search();
17	nr = im_search("xian'jin", 8);
18	printf("%s", im_get_sps_str(&size));
19	for(i = 0; i < nr; i++)
20	{
21		im_get_candidate(i, str, 32);
22	}
23
24	im_close_decoder();
25
26	return 0;
27}