Added HunSpell support

This commit is contained in:
Ianos Gnatiuc 2006-04-08 04:30:32 +00:00
parent fef9faee87
commit df425217eb
6 changed files with 38 additions and 30 deletions

View File

@ -77,7 +77,7 @@
#CPPFLAGS+=-DGCFG_NOSYNCHRONET
# Uncomment to disable MS Office spellchecker support (win32 only)
#CPPFLAGS+=-DGCFG_NO_MSSPELL
# Uncomment to disable MySpell spellchecker support (multiplatform)
# Uncomment to disable HunSpell spellchecker support (multiplatform)
#CPPFLAGS+=-DGCFG_NO_MYSPELL
# Comment to disable AreaRecycleBin keyword and feature
CPPFLAGS+=-D__INCLUDE_NEW_KEYWORDS__

View File

@ -7,34 +7,34 @@ include Config.def
LIBS=gall gcfg gmb3 glibc uulib smblib msgidlib
ifneq ($(findstring GCFG_NO_MYSPELL, $(CPPFLAGS)), GCFG_NO_MYSPELL)
LIBS+=myspell
LIBS+=hunspell
endif
EXECUTABLES=golded3 goldnode rddt
all: sourcelists
@$(SHELL) -ec 'for i in $(foreach dir,$(LIBS),goldlib/$(dir)); do cd $$i; $(MAKE) all; cd ../..; done'
@$(SHELL) -ec 'for i in $(EXECUTABLES); do cd $$i; $(MAKE) all; cd ..; done'
@echo 'To build HTML man pages run "make docs".'
@echo 'To reduce binaries size (remove debug information) run "make strip".'
@$(SHELL) -ec 'for i in $(foreach dir,$(LIBS),goldlib/$(dir)); do cd $$i; $(MAKE) all; cd ../..; done'
@$(SHELL) -ec 'for i in $(EXECUTABLES); do cd $$i; $(MAKE) all; cd ..; done'
@echo 'To build HTML man pages run "make docs".'
@echo 'To reduce binaries size (remove debug information) run "make strip".'
clean:
@$(SHELL) -ec 'for i in $(foreach dir,$(LIBS),goldlib/$(dir)); do cd $$i; $(MAKE) clean; cd ../..; done'
@$(SHELL) -ec 'for i in $(EXECUTABLES); do cd $$i; $(MAKE) clean; cd ..; done'
@-rm -f $(OBJPATH)/$(PLATFORM)/source.lst
@$(SHELL) -ec 'for i in $(foreach dir,$(LIBS),goldlib/$(dir)); do cd $$i; $(MAKE) clean; cd ../..; done'
@$(SHELL) -ec 'for i in $(EXECUTABLES); do cd $$i; $(MAKE) clean; cd ..; done'
@-rm -f $(OBJPATH)/$(PLATFORM)/source.lst
dirs:
@mkdir -p $(BIN) $(LIBPATH)/$(PLATFORM)
@mkdir -p $(foreach dir,$(LIBS),$(OBJPATH)/$(PLATFORM)/$(dir))
@mkdir -p $(foreach dir,$(EXECUTABLES),$(OBJPATH)/$(PLATFORM)/$(dir))
@mkdir -p $(BIN) $(LIBPATH)/$(PLATFORM)
@mkdir -p $(foreach dir,$(LIBS),$(OBJPATH)/$(PLATFORM)/$(dir))
@mkdir -p $(foreach dir,$(EXECUTABLES),$(OBJPATH)/$(PLATFORM)/$(dir))
sourcelists: dirs
@$(SHELL) -ec 'for i in $(foreach dir,$(LIBS),goldlib/$(dir)); do cd $$i; $(MAKE) sourcelist; cd ../..; done'
@$(SHELL) -ec 'for i in $(EXECUTABLES); do cd $$i; $(MAKE) sourcelist; cd ..; done'
@echo -n >$(OBJPATH)/$(PLATFORM)/source.lst
@$(SHELL) -ec 'for i in $(foreach dir,$(LIBS),goldlib/$(dir)); do cd $$i; $(MAKE) sourcelist; cd ../..; done'
@$(SHELL) -ec 'for i in $(EXECUTABLES); do cd $$i; $(MAKE) sourcelist; cd ..; done'
@echo -n >$(OBJPATH)/$(PLATFORM)/source.lst
docs:
@cd $@ ; $(MAKE) all ; cd ..
@cd $@ ; $(MAKE) all ; cd ..
strip:
cd $(BIN)/ ; strip *$(PLATFORM)$(EXEEXT)
cd $(BIN)/ ; strip *$(PLATFORM)$(EXEEXT)

View File

@ -15,7 +15,7 @@
# Uncomment to disable MS Office spellchecker support
# CPP_EXTRA_FLAGS=$(CPP_EXTRA_FLAGS) /DGCFG_NO_MSSPELL
# Uncomment to disable MySpell spellchecker support
# Uncomment to disable HunSpell spellchecker support
# CPP_EXTRA_FLAGS=$(CPP_EXTRA_FLAGS) /DGCFG_NO_MYSPELL
@ -384,13 +384,13 @@ LNK_OBJS= \
$(OBJ_DIR)\geview.obj \
$(OBJ_DIR)\gmarea.obj \
$(OBJ_DIR)\golded3.obj \
$(OBJ_DIR)\myspell.obj \
$(OBJ_DIR)\suggest.obj \
$(OBJ_DIR)\hashmgr.obj \
$(OBJ_DIR)\dictmgr.obj \
$(OBJ_DIR)\csutil.obj \
$(OBJ_DIR)\affentry.obj \
$(OBJ_DIR)\affixmgr.obj \
$(OBJ_DIR)\affentry.obj
$(OBJ_DIR)\csutil.obj \
$(OBJ_DIR)\dictmgr.obj \
$(OBJ_DIR)\hashmgr.obj \
$(OBJ_DIR)\hunspell.obj \
$(OBJ_DIR)\suggmgr.obj
GOLDED_OBJS=$(OBJ_DIR)\gemain.obj
RDDT_OBJS=$(OBJ_DIR)\rddt.obj

View File

@ -36,7 +36,7 @@
#include <gdirposx.h>
#include <gstrall.h>
#if !defined(GCFG_NO_MYSPELL)
#include <myspell.hxx>
#include <hunspell.hxx>
#endif
#include <gespell.h>
@ -474,7 +474,7 @@ bool CMYSpellLang::Init(const gdirentry *entry)
bool CMYSpellLang::Load(const char *codeset, const char *)
{
mMSpell = new MySpell(mEngine, mDictionary);
mMSpell = new Hunspell(mEngine, mDictionary);
if (mMSpell)
{
@ -547,6 +547,14 @@ bool CMYSpellLang::SpellCheck(const char *text)
}
// ------------------------------------------------------------------
bool CMYSpellLang::AddWord(const char *text)
{
return false;
}
// ------------------------------------------------------------------
#endif //#if !defined(GCFG_NO_MYSPELL)

View File

@ -237,14 +237,14 @@ public:
#if !defined(GCFG_NO_MYSPELL)
class gdirentry;
class MySpell;
class Hunspell;
class CMYSpellLang: public CSpellLang
{
friend class CSpellChecker;
private:
MySpell *mMSpell;
Hunspell *mMSpell;
public:
CMYSpellLang()
@ -263,7 +263,7 @@ public:
virtual void BuildSuggest(const char *text, CSpellSuggestV &suggest);
virtual bool SpellCheck(const char *text);
virtual bool AddWord(const char *) { return false; }
virtual bool AddWord(const char *);
};
#endif //#if !defined(GCFG_NO_MYSPELL)

View File

@ -10,7 +10,7 @@
#define HUHCAP 3
#define HUHINITCAP 4
#define MAXSUGGESTION 15
#define MAXSUGGESTION 100
#define MAXSHARPS 5
#ifdef W32