diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2022-12-08 15:03:51 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2022-12-08 15:03:51 -0500 |
commit | 7ea3569e3894f19fbae6cfdb3406f2240570e3c1 (patch) | |
tree | e04caa4058baa9f0a9ff46771eef903be49ce3cb /generator/form.cpp | |
parent | 6816abc1e89fd955524d7c772477d6483d12cbf9 (diff) | |
download | verbly-7ea3569e3894f19fbae6cfdb3406f2240570e3c1.tar.gz verbly-7ea3569e3894f19fbae6cfdb3406f2240570e3c1.tar.bz2 verbly-7ea3569e3894f19fbae6cfdb3406f2240570e3c1.zip |
Added a bunch of stuff for making LINGO puzzles
Diffstat (limited to 'generator/form.cpp')
-rw-r--r-- | generator/form.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/generator/form.cpp b/generator/form.cpp index c66820c..a88363b 100644 --- a/generator/form.cpp +++ b/generator/form.cpp | |||
@@ -9,12 +9,13 @@ namespace verbly { | |||
9 | 9 | ||
10 | int form::nextId_ = 0; | 10 | int form::nextId_ = 0; |
11 | 11 | ||
12 | form::form(std::string text) : | 12 | form::form(std::string text, int anagram_set_id) : |
13 | id_(nextId_++), | 13 | id_(nextId_++), |
14 | text_(text), | 14 | text_(text), |
15 | complexity_(std::count(std::begin(text), std::end(text), ' ') + 1), | 15 | complexity_(std::count(std::begin(text), std::end(text), ' ') + 1), |
16 | proper_(std::any_of(std::begin(text), std::end(text), ::isupper)), | 16 | proper_(std::any_of(std::begin(text), std::end(text), ::isupper)), |
17 | length_(text.length()) | 17 | length_(text.length()), |
18 | anagram_set_id_(anagram_set_id) | ||
18 | { | 19 | { |
19 | } | 20 | } |
20 | 21 | ||
@@ -34,7 +35,9 @@ namespace verbly { | |||
34 | { "form", arg.getText() }, | 35 | { "form", arg.getText() }, |
35 | { "complexity", arg.getComplexity() }, | 36 | { "complexity", arg.getComplexity() }, |
36 | { "proper", arg.isProper() }, | 37 | { "proper", arg.isProper() }, |
37 | { "length", arg.getLength() } | 38 | { "length", arg.getLength() }, |
39 | { "anagram_set_id", arg.getAnagramSetId() }, | ||
40 | { "reverse_form_id", arg.getReverseId() } | ||
38 | }); | 41 | }); |
39 | } | 42 | } |
40 | 43 | ||