diff options
-rw-r--r-- | nancy.cpp | 16 | ||||
m--------- | vendor/libtwittercpp | 0 | ||||
m--------- | vendor/verbly | 0 |
3 files changed, 11 insertions, 5 deletions
diff --git a/nancy.cpp b/nancy.cpp index a5a1433..523db57 100644 --- a/nancy.cpp +++ b/nancy.cpp | |||
@@ -74,7 +74,7 @@ int main(int argc, char** argv) | |||
74 | } | 74 | } |
75 | 75 | ||
76 | // verbly | 76 | // verbly |
77 | verbly::data database(config["verbly_datafile"].as<std::string>()); | 77 | verbly::database database(config["verbly_datafile"].as<std::string>()); |
78 | 78 | ||
79 | 79 | ||
80 | twitter::auth auth; | 80 | twitter::auth auth; |
@@ -96,15 +96,21 @@ int main(int argc, char** argv) | |||
96 | int i; | 96 | int i; |
97 | while ((i = form.find("{adj}")) != std::string::npos) | 97 | while ((i = form.find("{adj}")) != std::string::npos) |
98 | { | 98 | { |
99 | verbly::adjective adj = database.adjectives().random().limit(1).run().front(); | 99 | verbly::word adj = database.words(verbly::notion::partOfSpeech == verbly::part_of_speech::adjective).first(); |
100 | form.replace(i, 5, capitalize(adj.base_form())); | 100 | |
101 | form.replace(i, 5, capitalize(adj.getBaseForm())); | ||
101 | } | 102 | } |
102 | 103 | ||
103 | // Nouns | 104 | // Nouns |
104 | while ((i = form.find("{noun}")) != std::string::npos) | 105 | while ((i = form.find("{noun}")) != std::string::npos) |
105 | { | 106 | { |
106 | verbly::noun n = database.nouns().is_not_proper().random().limit(1).run().front(); | 107 | verbly::word n = database.words( |
107 | form.replace(i, 6, capitalize(n.singular_form())); | 108 | (verbly::notion::partOfSpeech == verbly::part_of_speech::noun) |
109 | && (verbly::form::proper == false) | ||
110 | && !(verbly::word::usageDomains %= (verbly::notion::wnid == 106718862)) // Blacklist ethnic slurs | ||
111 | ).first(); | ||
112 | |||
113 | form.replace(i, 6, capitalize(n.getBaseForm())); | ||
108 | } | 114 | } |
109 | 115 | ||
110 | if (form.size() > 140) | 116 | if (form.size() > 140) |
diff --git a/vendor/libtwittercpp b/vendor/libtwittercpp | |||
Subproject d90a1e74c77ba67f25a812609fd49d479bc464d | Subproject df906121dd862c0f704e44f28ee079158c431c4 | ||
diff --git a/vendor/verbly b/vendor/verbly | |||
Subproject 1f898f3bd66c29672275c2c884b17ba662ced62 | Subproject a3a033c730a2eb4242076f5b34823190aa441cd | ||