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


C++ SpellChecker类代码示例

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


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

示例1: didCancel

void SpellCheckRequest::didCancel()
{
    if (!m_checker)
        return;
    SpellChecker* checker = m_checker;
    m_checker = 0;
    checker->didCheckCancel(m_requestData.sequence());
}
开发者ID:windyuuy,项目名称:opera,代码行数:8,代码来源:SpellChecker.cpp

示例2: didSucceed

void SpellCheckRequest::didSucceed(const Vector<TextCheckingResult>& results)
{
    if (!m_checker)
        return;
    SpellChecker* checker = m_checker;
    m_checker = 0;
    checker->didCheckSucceed(m_requestData.sequence(), results);
}
开发者ID:windyuuy,项目名称:opera,代码行数:8,代码来源:SpellChecker.cpp

示例3: SpellChecker

void SpellChecker::checkDocument(Editor* document)
{
	SpellChecker* checker = new SpellChecker(document);
	checker->m_start_cursor = document->textCursor();
	checker->m_cursor = checker->m_start_cursor;
	checker->m_cursor.movePosition(QTextCursor::Start);
	checker->show();
	checker->check();
}
开发者ID:quickhand,项目名称:Prosit,代码行数:9,代码来源:spell_checker.cpp

示例4: SpellChecker

void SpellChecker::checkDocument(QPlainTextEdit* document, Dictionary& dictionary)
{
	SpellChecker* checker = new SpellChecker(document, dictionary);
	checker->m_start_cursor = document->textCursor();
	checker->m_cursor = checker->m_start_cursor;
	checker->m_cursor.movePosition(QTextCursor::Start);
	checker->show();
	checker->check();
}
开发者ID:Modanung,项目名称:MarkLaR,代码行数:9,代码来源:spell_checker.cpp

示例5: check

static VALUE check(VALUE self, VALUE val) {
   SpellChecker *obj;
   Data_Get_Struct(self, SpellChecker, obj);
   char  *word = RSTRING_PTR(val);
   //cout << obj->exists(word);
   if(obj->exists(word))
      return Qtrue;
   else
      return Qfalse;
}
开发者ID:HackerLabs,项目名称:ImageSimilarity,代码行数:10,代码来源:ImgSeekExt.cpp

示例6: load

static VALUE load(VALUE self, VALUE val) {
   SpellChecker *obj;
   Data_Get_Struct(self, SpellChecker, obj);
   std::string  words_list_file = RSTRING_PTR(val);
   //cout << obj->exists(word);
   if(obj->load(words_list_file))
      return Qtrue;
   else
      return Qfalse;
}
开发者ID:HackerLabs,项目名称:ImageSimilarity,代码行数:10,代码来源:ImgSeekExt.cpp

示例7: SpellChecker

void SpellChecker::checkDocument(QTextEdit* document, DictionaryRef& dictionary)
{
	SpellChecker* checker = new SpellChecker(document, dictionary);
	checker->m_start_cursor = document->textCursor();
	checker->m_cursor = checker->m_start_cursor;
	checker->m_cursor.movePosition(QTextCursor::StartOfBlock);
	checker->m_loop_available = checker->m_start_cursor.block().previous().isValid();
	checker->show();
	checker->check();
}
开发者ID:glenux,项目名称:contrib-focuswriter,代码行数:10,代码来源:spell_checker.cpp

示例8: spellchecker

int Internals::lastSpellCheckProcessedSequence(Document* document, ExceptionCode& ec)
{
    SpellChecker* checker = spellchecker(document);

    if (!checker) {
        ec = INVALID_ACCESS_ERR;
        return -1;
    }

    return checker->lastProcessedSequence();
}
开发者ID:,项目名称:,代码行数:11,代码来源:

示例9: getAvailableDictionaries

/*
	Creates a vector with a list of support languages for spell checking

	You must to g_free the allocated memory
*/
UT_Vector* XAP_Dialog_Language::getAvailableDictionaries()
{
#ifdef ENABLE_SPELL
    SpellChecker * checker = SpellManager::instance().getInstance();
    UT_Vector& vec= checker->getMapping();
    DictionaryMapping * mapping;
    UT_Vector* vecRslt = new UT_Vector();

    const UT_uint32 nItems = vec.getItemCount();

    for (UT_uint32 iItem = nItems; iItem; --iItem)
    {
        mapping = static_cast<DictionaryMapping*>(const_cast<void*>(vec.getNthItem(iItem - 1)));

        if (checker->doesDictionaryExist(mapping->lang.c_str()))
            vecRslt->addItem( g_strdup(mapping->lang.c_str()));
    }

    return vecRslt;
#else
    return NULL;
#endif
}
开发者ID:tanya-guza,项目名称:abiword,代码行数:28,代码来源:xap_Dlg_Language.cpp

示例10: fixPositionsIfBroken

void SpellcheckerWidget::Private::check()
{
	BufferView * bv = gv_->documentBufferView();
	if (!bv || bv->buffer().text().empty())
		return;

	fixPositionsIfBroken();
	
	SpellChecker * speller = theSpellChecker();
	if (speller && !speller->hasDictionary(bv->buffer().language())) {
		int dsize = speller->numDictionaries();
		if (0 == dsize) {
			hide();
			QMessageBox::information(p,
				qt_("Spell Checker"),
				qt_("Spell checker has no dictionaries."));
			return;
		}
	}

	DocIterator from = bv->cursor();
	DocIterator to = isCurrentBuffer(from) ? end_ : doc_iterator_end(&bv->buffer());
	WordLangTuple word_lang;
	docstring_list suggestions;

	LYXERR(Debug::GUI, "Spellchecker: start check at " << from);
	try {
		bv->buffer().spellCheck(from, to, word_lang, suggestions);
	} catch (ExceptionMessage const & message) {
		if (message.type_ == WarningException) {
			Alert::warning(message.title_, message.details_);
			return;
		}
		throw message;
	}

	// end of document or selection?
	if (atLastPos(from)) {
		if (isWrapAround()) {
			hide();
			return;
		}
		if (continueFromBeginning())
			check();
		return;
	}

	if (isWrapAround(from)) {
		hide();
		return;
	}

	word_ = word_lang;

	// set suggestions
	updateSuggestions(suggestions);
	// set language
	if (!word_lang.lang())
		return;
	setLanguage(word_lang.lang());
	// mark misspelled word
	setSelection(from, to);
}
开发者ID:315234,项目名称:lyx-retina,代码行数:63,代码来源:GuiSpellchecker.cpp


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