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

C++ WordLangTuple类代码示例

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

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



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

示例1: accept

// ignore for session
void AppleSpellChecker::accept(WordLangTuple const & word)
{
	string const word_str = to_utf8(word.word());
	AppleSpeller_ignore(d->speller, word_str.c_str());
	LYXERR(Debug::GUI, "ignore word: \"" << word.word() << "\"") ;
	advanceChangeNumber();
}
开发者ID:rpavlik,项目名称:lyx-lucid-backport,代码行数:8,代码来源:AppleSpellChecker.cpp


示例2: suggest

void AspellChecker::suggest(WordLangTuple const & wl,
	docstring_list & suggestions)
{
	suggestions.clear();
	AspellSpeller * m = d->speller(wl.lang());

	if (!m)
		return;

	string const word = d->toAspellWord(wl.word());
	AspellWordList const * sugs =
		aspell_speller_suggest(m, word.c_str(), -1);
	LASSERT(sugs != 0, return);
	AspellStringEnumeration * els = aspell_word_list_elements(sugs);
	if (!els || aspell_word_list_empty(sugs))
		return;

	for (;;) {
		char const * str = aspell_string_enumeration_next(els);
		if (!str)
			break;
		suggestions.push_back(from_utf8(str));
	}

	delete_aspell_string_enumeration(els);
}
开发者ID:hashinisenaratne,项目名称:HSTML,代码行数:26,代码来源:AspellChecker.cpp


示例3: remove

// remove from personal dictionary
void AppleSpellChecker::remove(WordLangTuple const & word)
{
	string const word_str = to_utf8(word.word());
	AppleSpeller_unlearn(d->speller, word_str.c_str());
	LYXERR(Debug::GUI, "unlearn word: \"" << word.word() << "\"") ;
	advanceChangeNumber();
}
开发者ID:rpavlik,项目名称:lyx-lucid-backport,代码行数:8,代码来源:AppleSpellChecker.cpp


示例4:

bool AspellChecker::Private::learned(WordLangTuple const & word)
{
	PersonalWordList * pd = personal_[word.lang()->lang()];
	if (!pd)
		return false;
	return pd->exists(word.word());
}
开发者ID:hashinisenaratne,项目名称:HSTML,代码行数:7,代码来源:AspellChecker.cpp


示例5: accept

void EnchantChecker::accept(WordLangTuple const & word)
{
	enchant::Dict * m = d->speller(word.lang()->code());
	if (m) {
		m->add_to_session(to_utf8(word.word()));
		advanceChangeNumber();
	}
}
开发者ID:cburschka,项目名称:lyx,代码行数:8,代码来源:EnchantChecker.cpp


示例6: remove

void EnchantChecker::remove(WordLangTuple const & word)
{
	enchant::Dict * m = d->speller(word.lang()->code());
	if (m) {
		m->remove(to_utf8(word.word()));
		advanceChangeNumber();
	}
}
开发者ID:cburschka,项目名称:lyx,代码行数:8,代码来源:EnchantChecker.cpp


示例7: accept

void AspellChecker::accept(WordLangTuple const & word)
{
	Spellers::iterator it = d->spellers_.find(word.lang()->lang());
	if (it != d->spellers_.end()) {
		d->addToSession(it->second.e_speller, word.word());
		d->accept(it->second, word);
		advanceChangeNumber();
	}
}
开发者ID:hashinisenaratne,项目名称:HSTML,代码行数:9,代码来源:AspellChecker.cpp


示例8: suggest

void AppleSpellChecker::suggest(WordLangTuple const & wl,
	docstring_list & suggestions)
{
	suggestions.clear();
	string const word_str = to_utf8(wl.word());
	size_t num = AppleSpeller_makeSuggestion(d->speller, 
					word_str.c_str(), wl.lang()->code().c_str());
	for (size_t i = 0; i < num; i++) {
		char const * next = AppleSpeller_getSuggestion(d->speller, i);
		if (!next) break;
		suggestions.push_back(from_utf8(next));
	}
}
开发者ID:rpavlik,项目名称:lyx-lucid-backport,代码行数:13,代码来源:AppleSpellChecker.cpp


示例9: check

SpellChecker::Result AppleSpellChecker::check(WordLangTuple const & word)
{
	if (!hasDictionary(word.lang()))
		return WORD_OK;

	string const word_str = to_utf8(word.word());
	string const lang = d->languageMap[word.lang()->lang()];
	SpellCheckResult result =
		AppleSpeller_check(d->speller,
			word_str.c_str(), lang.c_str());
	LYXERR(Debug::GUI, "spellCheck: \"" <<
		   word.word() << "\" = " << d->toString(result) <<
		   ", lang = " << lang) ;
	return d->toResult(result);
}
开发者ID:rpavlik,项目名称:lyx-lucid-backport,代码行数:15,代码来源:AppleSpellChecker.cpp


示例10: check

SpellChecker::Result AspellChecker::check(WordLangTuple const & word)
{
  
	AspellSpeller * m = d->speller(word.lang());

	if (!m)
		return NO_DICTIONARY;

	if (word.word().empty())
		// MSVC compiled Aspell doesn't like it.
		return WORD_OK;

	SpellChecker::Result rc = d->check(m, word);
	return (rc == WORD_OK && d->learned(word)) ? LEARNED_WORD : rc;
}
开发者ID:hashinisenaratne,项目名称:HSTML,代码行数:15,代码来源:AspellChecker.cpp


示例11: suggest

void EnchantChecker::suggest(WordLangTuple const & wl,
	docstring_list & suggestions)
{
	suggestions.clear();
	enchant::Dict * m = d->speller(wl.lang()->code());

	if (!m)
		return;

	string utf8word = to_utf8(wl.word());

	vector<string> suggs = m->suggest(utf8word);
	vector<string>::const_iterator it = suggs.begin();

	for (; it != suggs.end(); ++it)
		suggestions.push_back(from_utf8(*it));
}
开发者ID:cburschka,项目名称:lyx,代码行数:17,代码来源:EnchantChecker.cpp


示例12: check

SpellChecker::Result EnchantChecker::check(WordLangTuple const & word)
{
	enchant::Dict * m = d->speller(word.lang()->code());

	if (!m)
		return NO_DICTIONARY;

	if (word.word().empty())
		return WORD_OK;

	string utf8word = to_utf8(word.word());

	if (m->check(utf8word))
		return WORD_OK;

	return UNKNOWN_WORD;
}
开发者ID:cburschka,项目名称:lyx,代码行数:17,代码来源:EnchantChecker.cpp


示例13: split

SpellChecker::Result AspellChecker::Private::check(
	AspellSpeller * m, WordLangTuple const & word) 
	const
{
	SpellChecker::Result result = WORD_OK;
	docstring w1;
	docstring rest = split(word.word(), w1, '-');
	for (; result == WORD_OK;) {
		string const word_str = toAspellWord(w1);
		int const word_ok = aspell_speller_check(m, word_str.c_str(), -1);
		LASSERT(word_ok != -1, return UNKNOWN_WORD);
		result = (word_ok) ? WORD_OK : UNKNOWN_WORD;
		if (rest.empty())
			break;
		rest = split(rest,w1,'-');
	}
	if (result == WORD_OK)
		return result;
	string const word_str = toAspellWord(word.word());
	int const word_ok = aspell_speller_check(m, word_str.c_str(), -1);
	LASSERT(word_ok != -1, return UNKNOWN_WORD);
	return (word_ok) ? WORD_OK : UNKNOWN_WORD;
}
开发者ID:hashinisenaratne,项目名称:HSTML,代码行数:23,代码来源:AspellChecker.cpp



注:本文中的WordLangTuple类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ WordList类代码示例发布时间:2022-05-31
下一篇:
C++ Word类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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