• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ chewing_delete函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中chewing_delete函数的典型用法代码示例。如果您正苦于以下问题:C++ chewing_delete函数的具体用法?C++ chewing_delete怎么用?C++ chewing_delete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了chewing_delete函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: test_libchewing_googlecode_issue_472

void test_libchewing_googlecode_issue_472()
{
    /* FIXME: Add const cause gcc warning */
    static char *INPUT[] = {
        "<T>|&Wt<H>mrJY)G<C2>OqJ<H><H>Yl<R>p0<EE>QE[^<C1>k",
        "+F<C9>hQ$UIICMr!X8/9<C3>(N<T>yU2!-LUI<D>`CS<D>jShm9SF}<EN>[`QYu<C8>k",
        "hk4`2<D>jk",
        "hk4`j 0",
        "hk4<C0>j 0",
    };
    size_t i;
    ChewingContext *ctx;

    ctx = chewing_new();
    start_testcase(ctx, fd);
    chewing_set_maxChiSymbolLen(ctx, 16);
    chewing_set_autoShiftCur(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_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


示例3: test_set_ChiEngMode

void test_set_ChiEngMode()
{
	const int VALUE[] = {
		CHINESE_MODE,
		SYMBOL_MODE,
	};

	const int INVALID_VALUE[] = {
		-1,
		2,
	};

	ChewingContext *ctx;
	size_t i;
	size_t j;

	print_function_name();

	ctx = chewing_new();

	for ( i = 0; i < ARRAY_SIZE( VALUE ); ++i ) {
		chewing_set_ChiEngMode( ctx, VALUE[i] );
		ok( chewing_get_ChiEngMode( ctx ) == VALUE[i],
			"ChiEngMode shall be `%d'", VALUE[i] );

		for ( j = 0; j < ARRAY_SIZE( INVALID_VALUE ); ++j ) {
			// mode shall not change when set mode has invalid value.
			chewing_set_ChiEngMode( ctx, INVALID_VALUE[j] );
			ok( chewing_get_ChiEngMode( ctx ) == VALUE[i],
				"ChiEngMode shall be `%d'", VALUE[i] );
		}
	}

	chewing_delete( ctx );
}
开发者ID:blue119,项目名称:libchewing,代码行数:35,代码来源:test-config.c


示例4: test_CtrlNum_add_phrase_symbol_in_between

void test_CtrlNum_add_phrase_symbol_in_between()
{
	static const char bopomofo[] = "\xE3\x84\x98\xE3\x84\x9C\xCB\x8B \xE3\x84\x95\xCB\x8B" /* ㄘㄜˋ ㄕˋ */;
	int cursor;
	ChewingContext *ctx;

	remove( TEST_HASH_DIR PLAT_SEPARATOR HASH_FILE );

	chewing_Init( NULL, NULL );

	ctx = chewing_new();
	chewing_set_maxChiSymbolLen( ctx, 16 );
        chewing_set_addPhraseDirection( ctx, 1 );

	ok( has_userphrase( ctx, bopomofo, NULL ) == 0,
		"`%s' shall not be in userphrase", bopomofo );

	type_keystroke_by_string( ctx, "hk4`1g4<C2>" );
	cursor = chewing_cursor_Current( ctx );
	ok( cursor == 3, "cursor position `%d' shall be 3", cursor );

	/*
	 * FIXME: Current buggy here. User phrase shall not be added when there
	 * is a symbol in between.
	 */
	/* ok( has_userphrase( ctx, bopomofo, NULL ) == 0,
		"`%s' shall not be in userphrase", bopomofo ); */

	chewing_delete( ctx );
	chewing_Terminate();
}
开发者ID:chiehwen,项目名称:libchewing,代码行数:31,代码来源:test-userphrase.c


示例5: test_enumerate_keyboard_type

void test_enumerate_keyboard_type()
{
	ChewingContext *ctx;
	size_t i;
	char *keyboard_string;


	ctx = chewing_new();

	ok( chewing_kbtype_Total( ctx ) == ARRAY_SIZE( KEYBOARD_STRING ),
		"total keyboard_string type shall be %d", ARRAY_SIZE( KEYBOARD_STRING ) );

	chewing_kbtype_Enumerate( ctx );
	for ( i = 0; i < ARRAY_SIZE( KEYBOARD_STRING ); ++i ) {
		ok( chewing_kbtype_hasNext( ctx ) == 1 ,
			"shall have next keyboard_string type" );
		keyboard_string = chewing_kbtype_String( ctx );
		ok( strcmp( keyboard_string, KEYBOARD_STRING[i] ) == 0,
			"`%s' shall be `%s'", keyboard_string, KEYBOARD_STRING[i] );
		chewing_free( keyboard_string );
	}
	ok( chewing_kbtype_hasNext( ctx ) == 0 ,
		"shall not have next keyboard_string type" );
	keyboard_string = chewing_kbtype_String( ctx );
	ok( strcmp( keyboard_string, "" ) == 0,
		"`%s' shall be `%s'", keyboard_string, "" );
	chewing_free( keyboard_string );

	chewing_delete( ctx );
}
开发者ID:beantu,项目名称:libchewing,代码行数:30,代码来源:test-keyboard.c


示例6: test_zuin_buffer

void test_zuin_buffer()
{
	ChewingContext *ctx;
	ctx = chewing_new();

	type_keystroke_by_string( ctx, "1ul" );
	ok_zuin_buffer( ctx, "\xE3\x84\x85\xE3\x84\xA7\xE3\x84\xA0" /* ㄅㄧㄠ */ );

	type_keystroke_by_string( ctx, " " );
	ok_zuin_buffer( ctx, "" );

	type_keystroke_by_string( ctx, "ul" );
	ok_zuin_buffer( ctx, "\xE3\x84\xA7\xE3\x84\xA0" /* ㄧㄠ */ );

	type_keystroke_by_string( ctx, " " );
	ok_zuin_buffer( ctx, "" );

	type_keystroke_by_string( ctx, "3");
	ok_zuin_buffer( ctx, "\xCB\x87" /* ˇ */);

	type_keystroke_by_string( ctx, " " );
	ok_zuin_buffer( ctx, "" );

	chewing_delete( ctx );
}
开发者ID:beantu,项目名称:libchewing,代码行数:25,代码来源:test-bopomofo.c


示例7: test_select_candidate_4_bytes_utf8

void test_select_candidate_4_bytes_utf8()
{
	ChewingContext *ctx;

	remove( TEST_HASH_DIR PLAT_SEPARATOR HASH_FILE );


	ctx = chewing_new();

	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" /*  

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ chewing_new函数代码示例发布时间:2022-05-30
下一篇:
C++ cherokee_buffer_mrproper函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap