From 75e947fa0021547f460496d1c3aef5b61af4c669 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 31 Mar 2018 23:05:02 -0400 Subject: Migrated generator to hkutil --- generator/notion.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'generator/notion.cpp') 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 @@ #include "notion.h" -#include -#include -#include "database.h" -#include "field.h" namespace verbly { namespace generator { @@ -28,21 +24,25 @@ namespace verbly { void notion::incrementNumOfImages() { - // Calling code should always call hasWnid and check that the notion is a noun first. - assert(hasWnid_ && (partOfSpeech_ == part_of_speech::noun)); + if (!hasWnid_ || (partOfSpeech_ != part_of_speech::noun)) + { + throw std::domain_error("Notion is not a noun with wnid"); + } numOfImages_++; } void notion::setPrepositionGroups(std::list groups) { - // Calling code should always check that the notion is a preposition first. - assert(partOfSpeech_ == part_of_speech::preposition); + if (partOfSpeech_ != part_of_speech::preposition) + { + throw std::domain_error("Notion is not a preposition"); + } prepositionGroups_ = groups; } - database& operator<<(database& db, const notion& arg) + hatkirby::database& operator<<(hatkirby::database& db, const notion& arg) { // First, serialize the notion { -- cgit 1.4.1