diff options
Diffstat (limited to 'generator/notion.cpp')
-rw-r--r-- | generator/notion.cpp | 18 |
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 | ||
7 | namespace verbly { | 3 | namespace 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 | { |