diff options
Diffstat (limited to 'lib/word.h')
-rw-r--r-- | lib/word.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/word.h b/lib/word.h index dc6fac8..08797a3 100644 --- a/lib/word.h +++ b/lib/word.h | |||
@@ -3,6 +3,20 @@ | |||
3 | 3 | ||
4 | namespace verbly { | 4 | namespace verbly { |
5 | 5 | ||
6 | class rhyme { | ||
7 | public: | ||
8 | rhyme(std::string prerhyme, std::string phonemes); | ||
9 | |||
10 | std::string get_prerhyme() const; | ||
11 | std::string get_rhyme() const; | ||
12 | |||
13 | bool operator==(const rhyme& other) const; | ||
14 | |||
15 | private: | ||
16 | std::string _prerhyme; | ||
17 | std::string _rhyme; | ||
18 | }; | ||
19 | |||
6 | class word { | 20 | class word { |
7 | protected: | 21 | protected: |
8 | const data* _data; | 22 | const data* _data; |
@@ -10,6 +24,7 @@ namespace verbly { | |||
10 | bool _valid = false; | 24 | bool _valid = false; |
11 | 25 | ||
12 | std::list<std::list<std::string>> pronunciations; | 26 | std::list<std::list<std::string>> pronunciations; |
27 | std::list<rhyme> rhymes; | ||
13 | 28 | ||
14 | word(); | 29 | word(); |
15 | word(const data& _data, int _id); | 30 | word(const data& _data, int _id); |
@@ -24,7 +39,7 @@ namespace verbly { | |||
24 | public: | 39 | public: |
25 | virtual std::string base_form() const = 0; | 40 | virtual std::string base_form() const = 0; |
26 | 41 | ||
27 | std::list<std::string> rhyme_phonemes() const; | 42 | std::list<rhyme> get_rhymes() const; |
28 | bool starts_with_vowel_sound() const; | 43 | bool starts_with_vowel_sound() const; |
29 | }; | 44 | }; |
30 | 45 | ||