diff options
Diffstat (limited to 'lib/pronunciation.h')
| -rw-r--r-- | lib/pronunciation.h | 22 |
1 files changed, 9 insertions, 13 deletions
| diff --git a/lib/pronunciation.h b/lib/pronunciation.h index 73329e4..cd241bd 100644 --- a/lib/pronunciation.h +++ b/lib/pronunciation.h | |||
| @@ -4,11 +4,10 @@ | |||
| 4 | #include <stdexcept> | 4 | #include <stdexcept> |
| 5 | #include <vector> | 5 | #include <vector> |
| 6 | #include <string> | 6 | #include <string> |
| 7 | #include <hkutil/database.h> | ||
| 7 | #include "field.h" | 8 | #include "field.h" |
| 8 | #include "filter.h" | 9 | #include "filter.h" |
| 9 | 10 | ||
| 10 | struct sqlite3_stmt; | ||
| 11 | |||
| 12 | namespace verbly { | 11 | namespace verbly { |
| 13 | 12 | ||
| 14 | class form; | 13 | class form; |
| @@ -24,7 +23,7 @@ namespace verbly { | |||
| 24 | 23 | ||
| 25 | // Construct from database | 24 | // Construct from database |
| 26 | 25 | ||
| 27 | pronunciation(const database& db, sqlite3_stmt* row); | 26 | pronunciation(const database& db, hatkirby::row row); |
| 28 | 27 | ||
| 29 | // Accessors | 28 | // Accessors |
| 30 | 29 | ||
| @@ -63,7 +62,7 @@ namespace verbly { | |||
| 63 | return syllables_; | 62 | return syllables_; |
| 64 | } | 63 | } |
| 65 | 64 | ||
| 66 | std::string getStress() const | 65 | const std::string& getStress() const |
| 67 | { | 66 | { |
| 68 | if (!valid_) | 67 | if (!valid_) |
| 69 | { | 68 | { |
| @@ -83,7 +82,7 @@ namespace verbly { | |||
| 83 | return hasRhyme_; | 82 | return hasRhyme_; |
| 84 | } | 83 | } |
| 85 | 84 | ||
| 86 | std::string getPrerhyme() const | 85 | const std::string& getPrerhyme() const |
| 87 | { | 86 | { |
| 88 | if (!valid_) | 87 | if (!valid_) |
| 89 | { | 88 | { |
| @@ -98,7 +97,7 @@ namespace verbly { | |||
| 98 | return prerhyme_; | 97 | return prerhyme_; |
| 99 | } | 98 | } |
| 100 | 99 | ||
| 101 | std::string getRhyme() const | 100 | const std::string& getRhyme() const |
| 102 | { | 101 | { |
| 103 | if (!valid_) | 102 | if (!valid_) |
| 104 | { | 103 | { |
| @@ -167,8 +166,11 @@ namespace verbly { | |||
| 167 | static const rhymes_field rhymes; | 166 | static const rhymes_field rhymes; |
| 168 | 167 | ||
| 169 | private: | 168 | private: |
| 170 | bool valid_ = false; | ||
| 171 | 169 | ||
| 170 | static const field prerhyme; | ||
| 171 | static const field rhyme; | ||
| 172 | |||
| 173 | bool valid_ = false; | ||
| 172 | int id_; | 174 | int id_; |
| 173 | std::vector<std::string> phonemes_; | 175 | std::vector<std::string> phonemes_; |
| 174 | int syllables_; | 176 | int syllables_; |
| @@ -176,12 +178,6 @@ namespace verbly { | |||
| 176 | bool hasRhyme_ = false; | 178 | bool hasRhyme_ = false; |
| 177 | std::string prerhyme_; | 179 | std::string prerhyme_; |
| 178 | std::string rhyme_; | 180 | std::string rhyme_; |
| 179 | |||
| 180 | const database* db_; | ||
| 181 | |||
| 182 | static const field prerhyme; | ||
| 183 | static const field rhyme; | ||
| 184 | |||
| 185 | }; | 181 | }; |
| 186 | 182 | ||
| 187 | }; | 183 | }; |
