diff options
author | John Fultz <jfultz@wolfram.com> | 2015-10-13 12:00:13 -0500 |
---|---|---|
committer | John Fultz <jfultz@wolfram.com> | 2015-10-13 12:00:13 -0500 |
commit | ef4273ba47a2da9cea0aed59235e2d0a86bb8d7e (patch) | |
tree | ac58ba972ceee9f3c0079e17e8288a2d7eef8913 /quackleio/dawgfactory.h | |
parent | 6339dec22e2190fd341500206c80425593324bdc (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 'quackleio/dawgfactory.h')
-rw-r--r-- | quackleio/dawgfactory.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/quackleio/dawgfactory.h b/quackleio/dawgfactory.h index 5872dc3..efcc455 100644 --- a/quackleio/dawgfactory.h +++ b/quackleio/dawgfactory.h @@ -30,19 +30,18 @@ public: DawgFactory(const QString &alphabetFile); ~DawgFactory(); - void computeWordCount() const; - int wordCount() const { return m_wordCount; }; + int wordCount() const { return m_encodableWords; }; string letterCountString() const; int nodeCount() const { return m_nodelist.size(); }; int encodableWords() const { return m_encodableWords; }; int unencodableWords() const { return m_unencodableWords; }; int duplicateWords() const { return m_duplicateWords; }; - bool pushWord(const UVString& word, bool inSmaller, int playability); - bool pushWord(const Quackle::LetterString& word, bool inSmaller, int playability); + bool pushWord(const UVString &word, bool inSmaller, int playability); + bool pushWord(const Quackle::LetterString &word, bool inSmaller, int playability); void hashWord(const Quackle::LetterString &word); void generate(); - void writeIndex(const UVString& filename); + void writeIndex(const string &filename); const char* hashBytes() { return m_hash.charptr; }; @@ -50,10 +49,9 @@ private: class Node { public: bool pushWord(const Quackle::LetterString& word, bool inSmaller, int pb); - void print(vector< Node* >& m_nodelist); + void print(vector< Node* > &m_nodelist); int letterSum() const; - int wordCount(unsigned int depth, vector<unsigned int> &countsByLength) const; bool equals(const Node &n) const; Quackle::Letter c; @@ -67,7 +65,7 @@ private: bool lastchild; mutable bool sumexplored; - mutable int sum; + mutable unsigned int sum; mutable vector<int> counts; bool deleted; @@ -79,8 +77,7 @@ private: int m_unencodableWords; int m_duplicateWords; vector< Node* > m_nodelist; - mutable int m_wordCount; - mutable vector<unsigned int> m_countsByLength; + vector<unsigned int> m_countsByLength; Quackle::AlphabetParameters *m_alphas; Node m_root; union { |