diff options
author | John Fultz <jfultz@wolfram.com> | 2015-08-24 04:45:27 -0500 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2015-08-24 04:45:46 -0500 |
commit | 1f7b8ef6f96e1d5a2c50565a0f52cc633215e485 (patch) | |
tree | 11f406677824d20924748225ab7eb129ba929cd0 /lexiconparameters.h | |
parent | 8c7ffef1b6c669592e979fb6038dd634df7f95fc (diff) |
Version the GADDAGs.
Basically the same thing I just did to the DAWG files,
now done to GADDAGs. Also, add hashing, and
make sure GADDAGs only load if their hash matches
that of the DAWG files.
Diffstat (limited to 'lexiconparameters.h')
-rw-r--r-- | lexiconparameters.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lexiconparameters.h b/lexiconparameters.h index 4b6369d..04ad4e7 100644 --- a/lexiconparameters.h +++ b/lexiconparameters.h @@ -25,22 +25,23 @@ namespace Quackle { -class DawgInterpreter +class LexiconInterpreter { public: virtual void loadDawg(ifstream &file, LexiconParameters &lexparams) = 0; + virtual void loadGaddag(ifstream &file, LexiconParameters &lexparams) = 0; virtual void dawgAt(const unsigned char *dawg, int index, unsigned int &p, Letter &letter, bool &t, bool &lastchild, bool &british, int &playability) const = 0; virtual int versionNumber() const = 0; - virtual ~DawgInterpreter() {}; + virtual ~LexiconInterpreter() {}; }; -class V0DawgInterpreter; -class V1DawgInterpreter; +class V0LexiconInterpreter; +class V1LexiconInterpreter; class LexiconParameters { - friend class Quackle::V0DawgInterpreter; - friend class Quackle::V1DawgInterpreter; + friend class Quackle::V0LexiconInterpreter; + friend class Quackle::V1LexiconInterpreter; public: LexiconParameters(); @@ -79,7 +80,7 @@ protected: unsigned char *m_dawg; unsigned char *m_gaddag; string m_lexiconName; - DawgInterpreter *m_interpreter; + LexiconInterpreter *m_interpreter; char m_hash[16]; int m_wordcount; }; |