diff options
Diffstat (limited to 'generator/pronunciation.h')
-rw-r--r-- | generator/pronunciation.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/generator/pronunciation.h b/generator/pronunciation.h index 163e55e..3190e6d 100644 --- a/generator/pronunciation.h +++ b/generator/pronunciation.h | |||
@@ -2,8 +2,8 @@ | |||
2 | #define PRONUNCIATION_H_584A08DD | 2 | #define PRONUNCIATION_H_584A08DD |
3 | 3 | ||
4 | #include <string> | 4 | #include <string> |
5 | #include <cassert> | ||
6 | #include <hkutil/database.h> | 5 | #include <hkutil/database.h> |
6 | #include <stdexcept> | ||
7 | 7 | ||
8 | namespace verbly { | 8 | namespace verbly { |
9 | namespace generator { | 9 | namespace generator { |
@@ -34,16 +34,20 @@ namespace verbly { | |||
34 | 34 | ||
35 | std::string getRhymePhonemes() const | 35 | std::string getRhymePhonemes() const |
36 | { | 36 | { |
37 | // Calling code should always call hasRhyme first. | 37 | if (rhyme_.empty()) |
38 | assert(!rhyme_.empty()); | 38 | { |
39 | throw std::domain_error("Pronunciation does not have a rhyme"); | ||
40 | } | ||
39 | 41 | ||
40 | return rhyme_; | 42 | return rhyme_; |
41 | } | 43 | } |
42 | 44 | ||
43 | std::string getPrerhyme() const | 45 | std::string getPrerhyme() const |
44 | { | 46 | { |
45 | // Calling code should always call hasRhyme first. | 47 | if (rhyme_.empty()) |
46 | assert(!rhyme_.empty()); | 48 | { |
49 | throw std::domain_error("Pronunciation does not have a rhyme"); | ||
50 | } | ||
47 | 51 | ||
48 | return prerhyme_; | 52 | return prerhyme_; |
49 | } | 53 | } |