diff --git a/Config.def b/Config.def index 7aeb713..4d76f95 100644 --- a/Config.def +++ b/Config.def @@ -76,4 +76,6 @@ # Uncomment to disable Synchronet BBS support #CPPFLAGS+=-DGCFG_NOSYNCHRONET # Uncomment to disable MS Office spellchecker support (win32 only) -CPPFLAGS+=-DGCFG_NOSPELLDLL +CPPFLAGS+=-DGCFG_NO_MSSPELL +# Uncomment to disable MySpell spellchecker support (multiplatform) +CPPFLAGS+=-DGCFG_NO_MYSPELL diff --git a/Makefile b/Makefile index 4eed327..19f0f2f 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ include GNUmakef.def .PHONY: all clean distclean dirs sourcelists deps docs -LIBS=gall gcfg gmb3 glibc uulib smblib msgidlib +LIBS=gall gcfg gmb3 glibc uulib smblib msgidlib myspell EXECUTABLES=golded3 goldnode rddt all: sourcelists diff --git a/golded.mak b/golded.mak index 0b9a5fd..0704c07 100644 --- a/golded.mak +++ b/golded.mak @@ -13,8 +13,8 @@ # to build debug binary -# Uncomment to disable MS Office spellchecker support (win32 only) -# CPP_EXTRA_FLAGS=$(CPP_EXTRA_FLAGS) /DDGCFG_NO_MSSPELL +# Uncomment to disable MS Office spellchecker support +# CPP_EXTRA_FLAGS=$(CPP_EXTRA_FLAGS) /DGCFG_NO_MSSPELL # Uncomment to disable MySpell spellchecker support # CPP_EXTRA_FLAGS=$(CPP_EXTRA_FLAGS) /DGCFG_NO_MYSPELL @@ -385,7 +385,7 @@ LNK_OBJS= \ $(OBJ_DIR)\gmarea.obj \ $(OBJ_DIR)\golded3.obj \ $(OBJ_DIR)\myspell.obj \ - $(OBJ_DIR)\suggestmgr.obj \ + $(OBJ_DIR)\suggest.obj \ $(OBJ_DIR)\hashmgr.obj \ $(OBJ_DIR)\dictmgr.obj \ $(OBJ_DIR)\csutil.obj \ diff --git a/goldlib/myspell/myspell.all b/goldlib/myspell/myspell.all new file mode 100644 index 0000000..99a6df7 --- /dev/null +++ b/goldlib/myspell/myspell.all @@ -0,0 +1,9 @@ +affentry cxx all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be sun +affixmgr cxx all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be sun +csutil cxx all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be sun +dictmgr cxx all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be sun +example cxx all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be sun +hashmgr cxx all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be sun +hashmgr hxx all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be sun +myspell cxx all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be sun +suggest cxx all ovl bcd bco bcx wcn wco wcx lnx emx djg rsx cyg be sun diff --git a/goldlib/myspell/myspell.hxx b/goldlib/myspell/myspell.hxx index 20b955c..586851d 100644 --- a/goldlib/myspell/myspell.hxx +++ b/goldlib/myspell/myspell.hxx @@ -1,6 +1,6 @@ #include "hashmgr.hxx" #include "affixmgr.hxx" -#include "suggestmgr.hxx" +#include "suggest.hxx" #include "csutil.hxx" #define NOCAP 0 diff --git a/goldlib/myspell/suggestmgr.cxx b/goldlib/myspell/suggest.cxx similarity index 96% rename from goldlib/myspell/suggestmgr.cxx rename to goldlib/myspell/suggest.cxx index 3f24f83..3c8951a 100644 --- a/goldlib/myspell/suggestmgr.cxx +++ b/goldlib/myspell/suggest.cxx @@ -5,7 +5,7 @@ #include #include -#include "suggestmgr.hxx" +#include "suggest.hxx" #if !defined(_MSC_VER) using namespace std; @@ -14,11 +14,11 @@ using namespace std; extern char * mystrdup(const char *); -SuggestMgr::SuggestMgr(const char * tryme, int maxn, +SuggestMgr::SuggestMgr(const char * tryme, int maxn, AffixMgr * aptr) { - // register affix manager and check in string of chars to + // register affix manager and check in string of chars to // try when building candidate suggestions pAMgr = aptr; ctry = mystrdup(tryme); @@ -47,7 +47,7 @@ SuggestMgr::~SuggestMgr() int SuggestMgr::suggest(char** wlst, int ns, const char * word) { - + int nsug = ns; // perhaps we made chose the wrong char from a related set @@ -69,7 +69,7 @@ int SuggestMgr::suggest(char** wlst, int ns, const char * word) // did we add a char that should not be there if ((nsug < maxSug) && (nsug > -1)) nsug = extrachar(wlst, word, nsug); - + // did we just hit the wrong key in place of a good char if ((nsug < maxSug) && (nsug > -1)) nsug = badchar(wlst, word, nsug); @@ -98,7 +98,7 @@ int SuggestMgr::mapchars(char** wlst, const char * word, int ns) } -int SuggestMgr::map_related(const char * word, int i, char** wlst, int ns, const mapentry* maptable, int nummap) +int SuggestMgr::map_related(const char * word, int i, char** wlst, int ns, const mapentry* maptable, int nummap) { char c = *(word + i); if (c == 0) { @@ -113,7 +113,7 @@ int SuggestMgr::map_related(const char * word, int i, char** wlst, int ns, const } } return ns; - } + } int in_map = 0; for (int j = 0; j < nummap; j++) { if (strchr(maptable[j].set,c) != 0) { @@ -212,7 +212,7 @@ int SuggestMgr::badchar(char ** wlst, const char * word, int ns) } -// error is word has an extra letter it does not need +// error is word has an extra letter it does not need int SuggestMgr::extrachar(char** wlst, const char * word, int ns) { char candidate[MAXSWL]; @@ -234,7 +234,7 @@ int SuggestMgr::extrachar(char** wlst, const char * word, int ns) wlst[ns] = mystrdup(candidate); if (wlst[ns] == NULL) return -1; ns++; - } else return ns; + } else return ns; } *r++ = *p++; } @@ -265,7 +265,7 @@ int SuggestMgr::forgotchar(char ** wlst, const char * word, int ns) wlst[ns] = mystrdup(candidate); if (wlst[ns] == NULL) return -1; ns++; - } else return ns; + } else return ns; } } *q++ = *p++; @@ -389,7 +389,7 @@ int SuggestMgr::ngsuggest(char** wlst, char * word, HashMgr* pHMgr) lp = j; lval = scores[j]; } - } + } } // find minimum threshhold for a passable suggestion @@ -443,9 +443,9 @@ int SuggestMgr::ngsuggest(char** wlst, char * word, HashMgr* pHMgr) lval = gscore[j]; } } else { - free (glst[k].word); + free (glst[k].word); } - } + } } } } @@ -453,14 +453,14 @@ int SuggestMgr::ngsuggest(char** wlst, char * word, HashMgr* pHMgr) // now we are done generating guesses // sort in order of decreasing score and copy over - + bubblesort(&guess[0], &gscore[0], MAX_GUESS); int ns = 0; for (i=0; i < MAX_GUESS; i++) { if (guess[i]) { int unique = 1; for (j=i+1; j < MAX_GUESS; j++) - if (guess[j]) + if (guess[j]) if (!strcmp(guess[i], guess[j])) unique = 0; if (unique) { wlst[ns++] = guess[i]; @@ -480,7 +480,7 @@ int SuggestMgr::ngsuggest(char** wlst, char * word, HashMgr* pHMgr) int SuggestMgr::check(const char * word, int len) { struct hentry * rv=NULL; - if (pAMgr) { + if (pAMgr) { rv = pAMgr->lookup(word); if (rv == NULL) rv = pAMgr->affix_check(word,len); } diff --git a/goldlib/myspell/suggestmgr.hxx b/goldlib/myspell/suggest.hxx similarity index 100% rename from goldlib/myspell/suggestmgr.hxx rename to goldlib/myspell/suggest.hxx