summaryrefslogtreecommitdiff
path: root/lexiconparameters.h
diff options
context:
space:
mode:
authorJohn Fultz <jfultz@wolfram.com>2015-08-24 00:51:48 -0500
committerJohn Fultz <jfultz@wolfram.com>2015-08-24 00:51:48 -0500
commitd1f5f768764d439f02520d9c6c017fcd3ae96b83 (patch)
treee54e047c16bbb0da22b3978cdbbe9b3f86f7add0 /lexiconparameters.h
parent5e5d414c57d5c7dd8a3037dda1555db5fb7eb486 (diff)
Add a new DAWG format.
Make reader and writer for the new format, while maintaing compatibility with the old. Things to note of the new format... * Now has a header, with version number, MD5, and word count. * No longer has terminator bit. Nodes are terminated by a non-zero playability. * Which means letters have one more bit. So we can now support more than 32 letters. Important for Slovak alphabet. Also, various cleanups and refactorings.
Diffstat (limited to 'lexiconparameters.h')
-rw-r--r--lexiconparameters.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/lexiconparameters.h b/lexiconparameters.h
index 4c77cd1..4b6369d 100644
--- a/lexiconparameters.h
+++ b/lexiconparameters.h
@@ -28,15 +28,20 @@ namespace Quackle
class DawgInterpreter
{
public:
- virtual void loadDawg(ifstream &file, unsigned char *dawg) = 0;
+ virtual void loadDawg(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() {};
};
+class V0DawgInterpreter;
+class V1DawgInterpreter;
class LexiconParameters
{
+ friend class Quackle::V0DawgInterpreter;
+ friend class Quackle::V1DawgInterpreter;
+
public:
LexiconParameters();
~LexiconParameters();
@@ -75,6 +80,8 @@ protected:
unsigned char *m_gaddag;
string m_lexiconName;
DawgInterpreter *m_interpreter;
+ char m_hash[16];
+ int m_wordcount;
};
}