本文整理汇总了C++中chewing_new函数的典型用法代码示例。如果您正苦于以下问题:C++ chewing_new函数的具体用法?C++ chewing_new怎么用?C++ chewing_new使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了chewing_new函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: test_libchewing_googlecode_issue_473
void test_libchewing_googlecode_issue_473()
{
/* FIXME: Add const cause gcc warning */
static char *INPUT[] = {
"t<N->_ M1<N+>H[Ls3<L><N1>PL+Z]4<C1>&(^H*H<TT>Sc<N->P]!|<CB>-<C6>S<H><N1><C0>U<B>d}P!f<EN><N.><C7>V!U!w|4-=S<C1>b<N2>Q",
"wv<C0><C5><N9>$FIF<D><N4>B *<C2>E4*<C2>q)Kf)<SS><TT>4=<N5>%<R>mN4<EN>H<N9><N.>8s{XTD<N6>jZV(y3G`9<C6>JTy<B>J<C1>SNc<E>hC<SL><N/><R><C6>@an<C3><N7>wzF<C3>P*<N*><B>l<C3><N6>W<N*> $<SR><N.><N1><E><E><N0><N6>Y",
};
size_t i;
ChewingContext *ctx;
ctx = chewing_new();
start_testcase(ctx, fd);
chewing_set_maxChiSymbolLen(ctx, 16);
chewing_set_autoShiftCur(ctx, 1);
chewing_set_candPerPage(ctx, 9);
chewing_set_addPhraseDirection(ctx, 1);
chewing_set_spaceAsSelection(ctx, 1);
for (i = 0; i < ARRAY_SIZE(INPUT); ++i) {
chewing_Reset(ctx);
type_keystroke_by_string(ctx, INPUT[i]);
}
chewing_delete(ctx);
}
开发者ID:StanleyDing,项目名称:libchewing,代码行数:25,代码来源:test-regression.c
示例2: test_Backspace_in_select
void test_Backspace_in_select()
{
ChewingContext *ctx;
int ret;
ctx = chewing_new();
start_testcase(ctx, fd);
type_keystroke_by_string(ctx, "`<B>");
ok_candidate(ctx, NULL, 0);
type_keystroke_by_string(ctx, "hk4");
ret = chewing_cand_TotalChoice(ctx);
ok(ret == 0, "chewing_cand_TotalChoice() returns `%d' shall be `%d'", ret, 0);
type_keystroke_by_string(ctx, "<D>");
ret = chewing_cand_TotalChoice(ctx);
ok(ret > 0, "chewing_cand_TotalChoice() returns `%d' shall be greater than `%d'", ret, 0);
type_keystroke_by_string(ctx, "<B>");
ret = chewing_cand_TotalChoice(ctx);
ok(ret == 0, "chewing_cand_TotalChoice() returns `%d' shall be `%d'", ret, 0);
chewing_delete(ctx);
}
开发者ID:PingNote,项目名称:libchewing,代码行数:25,代码来源:test-bopomofo.c
示例3: test_Capslock
void test_Capslock()
{
ChewingContext *ctx;
int mode;
ctx = chewing_new();
start_testcase(ctx, fd);
mode = chewing_get_ChiEngMode(ctx);
ok(mode == CHINESE_MODE, "mode shall be CHINESE_MODE");
type_keystroke_by_string(ctx, "ji"); /* ㄨㄛ */
ok_bopomofo_buffer(ctx, "\xe3\x84\xa8\xe3\x84\x9b" /* ㄨㄛ */ );
ok_preedit_buffer(ctx, "");
ok_commit_buffer(ctx, "");
type_keystroke_by_string(ctx, "<CB>");
mode = chewing_get_ChiEngMode(ctx);
ok(mode == SYMBOL_MODE, "mode shall change to SYMBOL_MODE");
ok_bopomofo_buffer(ctx, "");
ok_preedit_buffer(ctx, "");
ok_commit_buffer(ctx, "");
chewing_delete(ctx);
}
开发者ID:PingNote,项目名称:libchewing,代码行数:27,代码来源:test-bopomofo.c
示例4: test_jk_selection
void test_jk_selection()
{
#if 0
FIXME: libchewing is broken in this case
ChewingContext *ctx;
int ret;
int i;
const int EXPECT_CAND_LEN[] = { 1, 2, 1, 1, 2, 1, 1 };
ctx = chewing_new();
start_testcase(ctx, fd);
type_keystroke_by_string(ctx, "`31hk4g4`31hk4g4`31" /* ,測試,測試, */ );
ret = chewing_cand_open(ctx);
ok(ret == 0, "chewing_cand_open() returns `%d' shall be `%d'", ret, 0);
for (i = ARRAY_SIZE(EXPECT_CAND_LEN) - 1; i >= 0; --i) {
ret = chewing_cand_TotalChoice(ctx);
ok(ret > 0, "chewing_cand_TotalChoice() returns `%d' shall be greater than `%d'", ret, 0);
ok_candidate_len(ctx, EXPECT_CAND_LEN[i]);
type_keystroke_by_string(ctx, "j");
}
for (i = 0; i < ARRAY_SIZE(EXPECT_CAND_LEN); ++i) {
ret = chewing_cand_TotalChoice(ctx);
ok(ret > 0, "chewing_cand_TotalChoice() returns `%d' shall be greater than `%d'", ret, 0);
ok_candidate_len(ctx, EXPECT_CAND_LEN[i]);
type_keystroke_by_string(ctx, "i");
}
chewing_delete(ctx);
#endif
}
开发者ID:PingNote,项目名称:libchewing,代码行数:33,代码来源:test-bopomofo.c
示例5: test_select_candidate_4_bytes_utf8
void test_select_candidate_4_bytes_utf8()
{
ChewingContext *ctx;
clean_userphrase();
ctx = chewing_new();
start_testcase(ctx, fd);
chewing_set_maxChiSymbolLen(ctx, 16);
chewing_set_phraseChoiceRearward(ctx, 1);
chewing_set_autoShiftCur(ctx, 1);
type_keystroke_by_string(ctx, "2k62k6"); /* ㄉㄜˊ ㄉㄜˊ */
ok_preedit_buffer(ctx, "\xE5\xBE\x97\xE5\xBE\x97" /* 得得 */ );
type_keystroke_by_string(ctx, "<H>");
type_keystroke_by_string(ctx, "<D>8");
ok_preedit_buffer(ctx, "\xF0\xA2\x94\xA8\xE5\xBE\x97" /*
|
请发表评论