spellchecker.cpp

来自「管理项目进度工具的原代码」· C++ 代码 · 共 51 行

CPP
51
字号
// SpellChecker.cpp: implementation of the CSpellChecker class.
//
//////////////////////////////////////////////////////////////////////

#include "SpellChecker.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CSpellChecker::CSpellChecker(const char* szAffPath, const char* szDicPath) : MySpell(szAffPath, szDicPath)
{

}

CSpellChecker::~CSpellChecker()
{

}

bool CSpellChecker::IsValid()
{
	return MySpell::isvalid();
}

void CSpellChecker::Release()
{
	delete this;
}

bool CSpellChecker::CheckSpelling(const char* szWord)
{
	return (spell(szWord) > 0);
}

bool CSpellChecker::CheckSpelling(const char* szWord, char**& pSuggestions, int& nNumSuggestions)
{
	bool bResult = CheckSpelling(szWord);

	if (!bResult)
		nNumSuggestions = suggest(&pSuggestions, szWord);

	return bResult;
}

void CSpellChecker::FreeSuggestions(char**& pSuggestions)
{
	free(pSuggestions);
	pSuggestions = NULL;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?