PyEnchant는 C 및 C++ 인터페이스를 제공하는 C 라이브러리 인 Enchant을 기반으로합니다. 그래서 C++ 용으로 사용할 수 있습니다. 자신의 SVN repository를 참조
#include <memory>
#include <cstdio>
#include "enchant.h"
#include "enchant++.h"
int main()
{
try
{
enchant::Broker *broker = enchant::Broker::instance();
std::auto_ptr<enchant::Dict> dict (broker->request_dict ("en_US"));
const char *check_checks[] = { "hello", "helllo" };
for (int i = 0; i < (sizeof (check_checks)/sizeof (check_checks[0])); ++i)
{
printf ("enchant_dict_check (%s): %d\n", check_checks[i],
dict->check (check_checks[i]) == false);
}
} catch (const enchant::Exception &) {
return 1;
}
}
더 많은 예제/테스트의 경우 : 최소한의 예는 다음과 같이 될 것입니다.
관련 항목 : http://stackoverflow.com/questions/862699/c-spellchecker-library – nico