summary refs log tree commit diff stats
path: root/generator/part.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2017-02-05 08:56:39 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2017-02-05 08:56:39 -0500
commite4fa0cb86d97c23c24cd7bdd62c23f03eed312da (patch)
tree70a20fdf684b1724659196a7de8d21a4a6ca194f /generator/part.h
parentbea3673ae1b3d19585dec56e96dbcd8a56b96e6d (diff)
downloadverbly-e4fa0cb86d97c23c24cd7bdd62c23f03eed312da.tar.gz
verbly-e4fa0cb86d97c23c24cd7bdd62c23f03eed312da.tar.bz2
verbly-e4fa0cb86d97c23c24cd7bdd62c23f03eed312da.zip
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.
Diffstat (limited to 'generator/part.h')
-rw-r--r--generator/part.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/generator/part.h b/generator/part.h index 39ba1e7..01791f5 100644 --- a/generator/part.h +++ b/generator/part.h
@@ -3,7 +3,6 @@
3 3
4#include <string> 4#include <string>
5#include <set> 5#include <set>
6#include "../lib/selrestr.h"
7#include "../lib/enums.h" 6#include "../lib/enums.h"
8 7
9namespace verbly { 8namespace verbly {
@@ -17,7 +16,7 @@ namespace verbly {
17 16
18 // Static factories 17 // Static factories
19 18
20 static part createNounPhrase(std::string role, selrestr selrestrs, std::set<std::string> synrestrs); 19 static part createNounPhrase(std::string role, std::set<std::string> selrestrs, std::set<std::string> synrestrs);
21 20
22 static part createVerb(); 21 static part createVerb();
23 22
@@ -67,7 +66,7 @@ namespace verbly {
67 66
68 std::string getNounRole() const; 67 std::string getNounRole() const;
69 68
70 selrestr getNounSelrestrs() const; 69 std::set<std::string> getNounSelrestrs() const;
71 70
72 std::set<std::string> getNounSynrestrs() const; 71 std::set<std::string> getNounSynrestrs() const;
73 72
@@ -104,7 +103,7 @@ namespace verbly {
104 union { 103 union {
105 struct { 104 struct {
106 std::string role; 105 std::string role;
107 selrestr selrestrs; 106 std::set<std::string> selrestrs;
108 std::set<std::string> synrestrs; 107 std::set<std::string> synrestrs;
109 } noun_phrase_; 108 } noun_phrase_;
110 struct { 109 struct {