Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

A Spell Checking Engine

, 5 Feb 2001
A free spell checking engine for use in your C++ applications. Includes the current US English dictionary
/*

  Copyright:		2000
  Author:			Matthew T Gullett
  Email:			gullettm@yahoo.com
  Name:				CFPSSpellCheckEngine
  Part of:			Spell Checking Engine 
  Requires:			USMain.dic, [USUser.dic], [USCommon.dic]

  DESCRIPTION
  ----------------------------------------------------------
  This class is designed to implement a phonetic spell
  checking engine with support for US English (and probably
  UK english)  It implements a simple interface for accessing
  spell checking functions.  It is designed to be very fast
  with support for a user dictionary and a common misspelling
  dictionary to improve performance and user perception.  


  INFO:
  ----------------------------------------------------------
  This class is provided -as is-.  No warranty as to the
  function or performance of this class is provided either 
  written or implied.  
  
  You may freely use this code and modify it as necessary,
  as long as this header is unmodified and credit is given
  to the author in the application(s) in which it is
  incorporated.

*/

#if !defined(AFX_FPSSPELLCHECKENGINE_H__9CDCF81C_0F4A_11D3_9EAF_444553540000__INCLUDED_)
#define AFX_FPSSPELLCHECKENGINE_H__9CDCF81C_0F4A_11D3_9EAF_444553540000__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "FPSSpellCheckEngineOptions.h"
class CFPSDictionary;

class CFPSSpellCheckEngine  
{
public:	
	virtual long GetRecordCount();
	virtual void IgnoreWord(LPCSTR lpszWord);
	virtual BOOL InitEngine (LPCSTR lpszConfigFile);

	virtual CFPSDictionary* GetMainDic() {return m_pMainDic;}
	virtual CFPSDictionary* GetUserDic() {return m_pUserDic;}
	virtual CFPSSpellCheckEngineOptions& GetOptions() {return m_Options;}

	virtual BOOL FindWord(LPCSTR lpszWord, CStringList &PossibleMatches, BOOL bSuggest);
	virtual BOOL IsIgnoredWord(LPCSTR lpszWord);
	virtual void ReloadCommonDic();
	virtual void DisplayOptions();

	CFPSSpellCheckEngine();
	virtual ~CFPSSpellCheckEngine();

protected:
	virtual BOOL InitEngine();
	virtual void CacheCommonUseWords();

	CMapStringToString m_CmnUseDic;
	CMapStringToString m_RecentFinds;

	CFPSSpellCheckEngineOptions m_Options;

	CFPSDictionary*	m_pMainDic;
	CFPSDictionary* m_pUserDic;
};


#endif // !defined(AFX_FPSSPELLCHECKENGINE_H__9CDCF81C_0F4A_11D3_9EAF_444553540000__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Matt Gullett
Web Developer
United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web03 | 2.8.141029.1 | Last Updated 6 Feb 2001
Article Copyright 2001 by Matt Gullett
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid