summaryrefslogtreecommitdiff
path: root/lexiconparameters.cpp
diff options
context:
space:
mode:
authorJohn Fultz <jfultz@wolfram.com>2015-10-13 12:00:13 -0500
committerJohn Fultz <jfultz@wolfram.com>2015-10-13 12:00:13 -0500
commitef4273ba47a2da9cea0aed59235e2d0a86bb8d7e (patch)
treeac58ba972ceee9f3c0079e17e8288a2d7eef8913 /lexiconparameters.cpp
parent6339dec22e2190fd341500206c80425593324bdc (diff)
Saving custom dictionaries now really works.
* Fix a number of remaining bugs in the lexicon dialog. * Fix an error reading the v1 DAWG. * Improve the word counting mechanism. * Make sure the lexicn dialog properly selects and loads its dictionary after it's done. * Implement deleting of user dictionaries. * Clean up dictionary info text in lexicon dialog. * Disable gaddag generation...still have to fix that up to happen at sensible times and with user notification.
Diffstat (limited to 'lexiconparameters.cpp')
-rw-r--r--lexiconparameters.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lexiconparameters.cpp b/lexiconparameters.cpp
index bc10773..74de78f 100644
--- a/lexiconparameters.cpp
+++ b/lexiconparameters.cpp
@@ -82,8 +82,6 @@ class Quackle::V1LexiconInterpreter : public LexiconInterpreter
file >> lexparams.m_utf8Alphabet[i];
file.get(); // separator space
}
- file.get(); // whitespace separator
- lexparams.m_wordcount = (bytes[0] << 16) | (bytes[1] << 8) | bytes[2];
while (!file.eof())
{
file.read((char*)(lexparams.m_dawg) + i, 7);
@@ -123,18 +121,18 @@ class Quackle::V1LexiconInterpreter : public LexiconInterpreter
p = (dawg[index] << 16) + (dawg[index + 1] << 8) + (dawg[index + 2]);
letter = dawg[index + 3];
- t = (p != 0);
lastchild = ((letter & 64) != 0);
british = !(letter & 128);
letter = (letter & 63) + QUACKLE_FIRST_LETTER;
playability = (dawg[index + 4] << 16) + (dawg[index + 5] << 8) + (dawg[index + 6]);
+ t = (playability != 0);
}
virtual int versionNumber() const { return 1; }
};
LexiconParameters::LexiconParameters()
- : m_dawg(NULL), m_gaddag(NULL), m_interpreter(NULL), m_wordcount(0)
+ : m_dawg(NULL), m_gaddag(NULL), m_interpreter(NULL), m_wordCount(0)
{
memset(m_hash, 0, sizeof(m_hash));
}
@@ -155,6 +153,7 @@ void LexiconParameters::unloadDawg()
delete[] m_dawg;
m_dawg = NULL;
delete m_interpreter;
+ m_interpreter = NULL;
}
void LexiconParameters::unloadGaddag()