diff options
Diffstat (limited to 'generator/form.cpp')
-rw-r--r-- | generator/form.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/generator/form.cpp b/generator/form.cpp index a88363b..460469f 100644 --- a/generator/form.cpp +++ b/generator/form.cpp | |||
@@ -28,17 +28,22 @@ namespace verbly { | |||
28 | { | 28 | { |
29 | // Serialize the form first. | 29 | // Serialize the form first. |
30 | { | 30 | { |
31 | db.insertIntoTable( | 31 | std::list<hatkirby::column> fields = { |
32 | "forms", | 32 | { "form_id", arg.getId() }, |
33 | { | 33 | { "form", arg.getText() }, |
34 | { "form_id", arg.getId() }, | 34 | { "complexity", arg.getComplexity() }, |
35 | { "form", arg.getText() }, | 35 | { "proper", arg.isProper() }, |
36 | { "complexity", arg.getComplexity() }, | 36 | { "length", arg.getLength() }, |
37 | { "proper", arg.isProper() }, | 37 | { "anagram_set_id", arg.getAnagramSetId() }, |
38 | { "length", arg.getLength() }, | 38 | { "reverse_form_id", arg.getReverseId() } |
39 | { "anagram_set_id", arg.getAnagramSetId() }, | 39 | }; |
40 | { "reverse_form_id", arg.getReverseId() } | 40 | |
41 | }); | 41 | if (arg.getFrequency() > 0) |
42 | { | ||
43 | fields.emplace_back("frequency", arg.getFrequency()); | ||
44 | } | ||
45 | |||
46 | db.insertIntoTable("forms", std::move(fields)); | ||
42 | } | 47 | } |
43 | 48 | ||
44 | // Then, serialize the form/pronunciation relationship. | 49 | // Then, serialize the form/pronunciation relationship. |