about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2016-03-19 15:29:32 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2016-03-19 15:29:32 -0400
commitfd3ab7bfa89a4072a429d2159007e4d55896a78c (patch)
tree385a65db66a85c9b628f2523ce039af339fd12db
parenta3cda1bb70b791cdbbdf8236bd53274ed45354d8 (diff)
downloadnancy-fd3ab7bfa89a4072a429d2159007e4d55896a78c.tar.gz
nancy-fd3ab7bfa89a4072a429d2159007e4d55896a78c.tar.bz2
nancy-fd3ab7bfa89a4072a429d2159007e4d55896a78c.zip
An update to verbly makes the "genus" exception unnecessary
-rw-r--r--nancy.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/nancy.cpp b/nancy.cpp index 00c68c5..6a89061 100644 --- a/nancy.cpp +++ b/nancy.cpp
@@ -91,18 +91,8 @@ int main(int argc, char** argv)
91 // Nouns 91 // Nouns
92 while ((i = form.find("{noun}")) != std::string::npos) 92 while ((i = form.find("{noun}")) != std::string::npos)
93 { 93 {
94 std::string nf; 94 verbly::noun n = database.nouns().is_not_proper(true).random(true).limit(1).run().front();
95 for (;;) 95 form.replace(i, 6, capitalize(n.singular_form()));
96 {
97 verbly::noun n = database.nouns().is_not_proper(true).random(true).limit(1).run().front();
98 if (n.singular_form().find("genus") == std::string::npos)
99 {
100 nf = n.singular_form();
101 break;
102 }
103 }
104
105 form.replace(i, 6, capitalize(nf));
106 } 96 }
107 97
108 if (form.size() > 140) 98 if (form.size() > 140)