diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-02-04 10:32:55 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-02-04 10:32:55 -0500 |
commit | 8c2e7c646f2a549ea9b4db831d8088f57b3287ae (patch) | |
tree | fa9070e88a34284c6089b2939ea1d1ca6bef147e /sentence.h | |
parent | cb77fded0b9a8a9034ace592be04176c8778ddca (diff) | |
download | furries-8c2e7c646f2a549ea9b4db831d8088f57b3287ae.tar.gz furries-8c2e7c646f2a549ea9b4db831d8088f57b3287ae.tar.bz2 furries-8c2e7c646f2a549ea9b4db831d8088f57b3287ae.zip |
Updated verbly (new API)
Notably, the bot should not be able to use ethnic slurs now. sentence.cpp is basically just copied from advice.
Diffstat (limited to 'sentence.h')
-rw-r--r-- | sentence.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sentence.h b/sentence.h new file mode 100644 index 0000000..abf6860 --- /dev/null +++ b/sentence.h | |||
@@ -0,0 +1,39 @@ | |||
1 | #ifndef SENTENCE_H_81987F60 | ||
2 | #define SENTENCE_H_81987F60 | ||
3 | |||
4 | #include <verbly.h> | ||
5 | #include <random> | ||
6 | #include <string> | ||
7 | |||
8 | class sentence { | ||
9 | public: | ||
10 | |||
11 | sentence( | ||
12 | const verbly::database& database, | ||
13 | std::mt19937& rng); | ||
14 | |||
15 | std::string generate() const; | ||
16 | |||
17 | private: | ||
18 | |||
19 | verbly::filter parseSelrestrs(verbly::selrestr selrestr) const; | ||
20 | |||
21 | bool requiresSelrestr(std::string restriction, verbly::selrestr selrestr) const; | ||
22 | |||
23 | verbly::word generateStandardNoun(std::string role, verbly::selrestr selrestrs) const; | ||
24 | |||
25 | verbly::token generateStandardNounPhrase( | ||
26 | const verbly::word& noun, | ||
27 | std::string role, | ||
28 | bool plural, | ||
29 | bool definite) const; | ||
30 | |||
31 | verbly::token generateClause(const verbly::token& it) const; | ||
32 | |||
33 | void visit(verbly::token& it) const; | ||
34 | |||
35 | const verbly::database& database_; | ||
36 | std::mt19937& rng_; | ||
37 | }; | ||
38 | |||
39 | #endif /* end of include guard: SENTENCE_H_81987F60 */ | ||