From e4fa0cb86d97c23c24cd7bdd62c23f03eed312da Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sun, 5 Feb 2017 08:56:39 -0500 Subject: Flattened selrestrs Now, selrestrs are, instead of logically being a tree of positive/negative restrictions that are ANDed/ORed together, they are a flat set of positive restrictions that are ORed together. They are stored as strings in a table called selrestrs, just like synrestrs, which makes them a lot more queryable now as well. This change required some changes to the VerbNet data, because we needed to consolidate any ANDed clauses into single selrestrs, as well as convert any negative selrestrs into positive ones. The changes made are detailed on the wiki. Preposition choices are now encoded as comma-separated lists instead of using JSON. This change, along with the selrestrs one, allows us to remove verbly's dependency on nlohmann::json. --- lib/selrestr.h | 90 ---------------------------------------------------------- 1 file changed, 90 deletions(-) delete mode 100644 lib/selrestr.h (limited to 'lib/selrestr.h') diff --git a/lib/selrestr.h b/lib/selrestr.h deleted file mode 100644 index a7cde0a..0000000 --- a/lib/selrestr.h +++ /dev/null @@ -1,90 +0,0 @@ -#ifndef SELRESTR_H_50652FB7 -#define SELRESTR_H_50652FB7 - -#include -#include -#include "../vendor/json/json.hpp" - -namespace verbly { - - class selrestr { - public: - enum class type { - empty, - singleton, - group - }; - - // Construct from json - - explicit selrestr(nlohmann::json json); - - // Copy and move constructors - - selrestr(const selrestr& other); - selrestr(selrestr&& other); - - // Assignment - - selrestr& operator=(selrestr other); - - // Swap - - friend void swap(selrestr& first, selrestr& second); - - // Destructor - - ~selrestr(); - - // Generic accessors - - type getType() const - { - return type_; - } - - // Empty - - selrestr(); - - // Singleton - - selrestr(std::string restriction, bool pos); - - std::string getRestriction() const; - - bool getPos() const; - - // Group - - selrestr(std::list children, bool orlogic); - - std::list getChildren() const; - - std::list::const_iterator begin() const; - - std::list::const_iterator end() const; - - bool getOrlogic() const; - - // Helpers - - nlohmann::json toJson() const; - - private: - union { - struct { - bool pos; - std::string restriction; - } singleton_; - struct { - std::list children; - bool orlogic; - } group_; - }; - type type_; - }; - -}; - -#endif /* end of include guard: SELRESTR_H_50652FB7 */ -- cgit 1.4.1