diff options
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 | ||
