diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-02-10 11:48:58 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2017-02-10 11:48:58 -0500 |
commit | f625e90a0721483f7f44b94b9bb57cc9d59565e8 (patch) | |
tree | 6d8bfe0fb1f1bea9e9c1cc96805ffd77c32411e6 /lib/word.h | |
parent | 4208387c4a6b7ecf43d756a8bba96b9cfc5227b9 (diff) | |
download | verbly-f625e90a0721483f7f44b94b9bb57cc9d59565e8.tar.gz verbly-f625e90a0721483f7f44b94b9bb57cc9d59565e8.tar.bz2 verbly-f625e90a0721483f7f44b94b9bb57cc9d59565e8.zip |
Added negative filter conversions to objects
Diffstat (limited to 'lib/word.h')
-rw-r--r-- | lib/word.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/word.h b/lib/word.h index dd72c39..e866f09 100644 --- a/lib/word.h +++ b/lib/word.h | |||
@@ -105,8 +105,6 @@ namespace verbly { | |||
105 | 105 | ||
106 | const std::vector<form>& getInflections(inflection category) const; | 106 | const std::vector<form>& getInflections(inflection category) const; |
107 | 107 | ||
108 | |||
109 | |||
110 | // Type info | 108 | // Type info |
111 | 109 | ||
112 | static const object objectType; | 110 | static const object objectType; |
@@ -121,9 +119,24 @@ namespace verbly { | |||
121 | 119 | ||
122 | operator filter() const | 120 | operator filter() const |
123 | { | 121 | { |
122 | if (!valid_) | ||
123 | { | ||
124 | throw std::domain_error("Bad access to uninitialized word"); | ||
125 | } | ||
126 | |||
124 | return (id == id_); | 127 | return (id == id_); |
125 | } | 128 | } |
126 | 129 | ||
130 | filter operator!() const | ||
131 | { | ||
132 | if (!valid_) | ||
133 | { | ||
134 | throw std::domain_error("Bad access to uninitialized word"); | ||
135 | } | ||
136 | |||
137 | return (id != id_); | ||
138 | } | ||
139 | |||
127 | // Relationships with other objects | 140 | // Relationships with other objects |
128 | 141 | ||
129 | static const field notions; | 142 | static const field notions; |