summary refs log tree commit diff stats
path: root/lib/word.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/word.h')
-rw-r--r--lib/word.h17
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;