summary refs log tree commit diff stats
path: root/generator/generator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'generator/generator.cpp')
-rw-r--r--generator/generator.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/generator/generator.cpp b/generator/generator.cpp index faef5f7..de369a4 100644 --- a/generator/generator.cpp +++ b/generator/generator.cpp
@@ -10,6 +10,7 @@
10#include <sstream> 10#include <sstream>
11#include <regex> 11#include <regex>
12#include <list> 12#include <list>
13#include <algorithm>
13#include "progress.h" 14#include "progress.h"
14 15
15struct verb { 16struct verb {
@@ -525,9 +526,9 @@ int main(int argc, char** argv)
525 { 526 {
526 if (nouns.count(word) == 1) 527 if (nouns.count(word) == 1)
527 { 528 {
528 query = "INSERT INTO nouns (singular, plural) VALUES (?, ?)"; 529 query = "INSERT INTO nouns (singular, proper, plural) VALUES (?, ?, ?)";
529 } else { 530 } else {
530 query = "INSERT INTO nouns (singular) VALUES (?)"; 531 query = "INSERT INTO nouns (singular, proper) VALUES (?, ?)";
531 } 532 }
532 533
533 break; 534 break;
@@ -576,9 +577,14 @@ int main(int argc, char** argv)
576 { 577 {
577 case 1: // Noun 578 case 1: // Noun
578 { 579 {
580 auto sing = nouns[word].singular;
581 sqlite3_bind_int(ppstmt, 2, (std::any_of(std::begin(sing), std::end(sing), [] (char ch) {
582 return isupper(ch);
583 }) ? 1 : 0));
584
579 if (nouns.count(word) == 1) 585 if (nouns.count(word) == 1)
580 { 586 {
581 sqlite3_bind_text(ppstmt, 2, nouns[word].plural.c_str(), nouns[word].plural.length(), SQLITE_STATIC); 587 sqlite3_bind_text(ppstmt, 3, nouns[word].plural.c_str(), nouns[word].plural.length(), SQLITE_STATIC);
582 } 588 }
583 589
584 break; 590 break;