summary refs log tree commit diff stats
path: root/generator/notion.cpp
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2018-03-31 23:05:02 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2018-03-31 23:05:02 -0400
commit75e947fa0021547f460496d1c3aef5b61af4c669 (patch)
tree64559a5329b3e5983ffdfe7ee2ad65c7c938e98d /generator/notion.cpp
parent3554df2e34e63364eea3a7998e0dfb0e6be65ca4 (diff)
downloadverbly-75e947fa0021547f460496d1c3aef5b61af4c669.tar.gz
verbly-75e947fa0021547f460496d1c3aef5b61af4c669.tar.bz2
verbly-75e947fa0021547f460496d1c3aef5b61af4c669.zip
Migrated generator to hkutil
Diffstat (limited to 'generator/notion.cpp')
-rw-r--r--generator/notion.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/generator/notion.cpp b/generator/notion.cpp index 35ba7b1..f388767 100644 --- a/generator/notion.cpp +++ b/generator/notion.cpp
@@ -1,8 +1,4 @@
1#include "notion.h" 1#include "notion.h"
2#include <string>
3#include <list>
4#include "database.h"
5#include "field.h"
6 2
7namespace verbly { 3namespace verbly {
8 namespace generator { 4 namespace generator {
@@ -28,21 +24,25 @@ namespace verbly {
28 24
29 void notion::incrementNumOfImages() 25 void notion::incrementNumOfImages()
30 { 26 {
31 // Calling code should always call hasWnid and check that the notion is a noun first. 27 if (!hasWnid_ || (partOfSpeech_ != part_of_speech::noun))
32 assert(hasWnid_ && (partOfSpeech_ == part_of_speech::noun)); 28 {
29 throw std::domain_error("Notion is not a noun with wnid");
30 }
33 31
34 numOfImages_++; 32 numOfImages_++;
35 } 33 }
36 34
37 void notion::setPrepositionGroups(std::list<std::string> groups) 35 void notion::setPrepositionGroups(std::list<std::string> groups)
38 { 36 {
39 // Calling code should always check that the notion is a preposition first. 37 if (partOfSpeech_ != part_of_speech::preposition)
40 assert(partOfSpeech_ == part_of_speech::preposition); 38 {
39 throw std::domain_error("Notion is not a preposition");
40 }
41 41
42 prepositionGroups_ = groups; 42 prepositionGroups_ = groups;
43 } 43 }
44 44
45 database& operator<<(database& db, const notion& arg) 45 hatkirby::database& operator<<(hatkirby::database& db, const notion& arg)
46 { 46 {
47 // First, serialize the notion 47 // First, serialize the notion
48 { 48 {