diff options
Diffstat (limited to 'lib/form.h')
-rw-r--r-- | lib/form.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/form.h b/lib/form.h index e3e1185..479672f 100644 --- a/lib/form.h +++ b/lib/form.h | |||
@@ -73,6 +73,16 @@ namespace verbly { | |||
73 | return proper_; | 73 | return proper_; |
74 | } | 74 | } |
75 | 75 | ||
76 | int getLength() const | ||
77 | { | ||
78 | if (!valid_) | ||
79 | { | ||
80 | throw std::domain_error("Bad access to uninitialized form"); | ||
81 | } | ||
82 | |||
83 | return length_; | ||
84 | } | ||
85 | |||
76 | const std::vector<pronunciation>& getPronunciations() const; | 86 | const std::vector<pronunciation>& getPronunciations() const; |
77 | 87 | ||
78 | // Convenience | 88 | // Convenience |
@@ -91,6 +101,7 @@ namespace verbly { | |||
91 | static const field text; | 101 | static const field text; |
92 | static const field complexity; | 102 | static const field complexity; |
93 | static const field proper; | 103 | static const field proper; |
104 | static const field length; | ||
94 | 105 | ||
95 | operator filter() const | 106 | operator filter() const |
96 | { | 107 | { |
@@ -123,8 +134,9 @@ namespace verbly { | |||
123 | 134 | ||
124 | int id_; | 135 | int id_; |
125 | std::string text_; | 136 | std::string text_; |
126 | int complexity_ ; | 137 | int complexity_; |
127 | bool proper_; | 138 | bool proper_; |
139 | int length_; | ||
128 | 140 | ||
129 | const database* db_; | 141 | const database* db_; |
130 | 142 | ||