当前位置: 首页>>代码示例>>C++>>正文


C++ WordLangTuple::lang方法代码示例

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


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

示例1:

void AspellChecker::Private::insert(WordLangTuple const & word)
{
	Spellers::iterator it = spellers_.find(word.lang()->lang());
	if (it != spellers_.end()) {
		addToSession(it->second.e_speller, word.word());
		PersonalWordList * pd = personal_[word.lang()->lang()];
		if (!pd)
			return;
		pd->insert(word.word());
	}
}
开发者ID:hashinisenaratne,项目名称:HSTML,代码行数:11,代码来源:AspellChecker.cpp

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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


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