diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-02-03 09:15:28 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-02-03 09:16:28 -0500 |
commit | 64f26d4a3b80969e08a607f80dde87d49ad5c2e3 (patch) | |
tree | 92ab69c6550d696ac6b15e1366b54222e773ada9 /generator/form.cpp | |
parent | f2aacc40f4c26b3f4d71d81090f05261f4969e29 (diff) | |
download | verbly-64f26d4a3b80969e08a607f80dde87d49ad5c2e3.tar.gz verbly-64f26d4a3b80969e08a607f80dde87d49ad5c2e3.tar.bz2 verbly-64f26d4a3b80969e08a607f80dde87d49ad5c2e3.zip |
Added word frequency information
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. |