summaryrefslogtreecommitdiff
path: root/klm/lm/lm_exception.hh
diff options
context:
space:
mode:
Diffstat (limited to 'klm/lm/lm_exception.hh')
-rw-r--r--klm/lm/lm_exception.hh42
1 files changed, 42 insertions, 0 deletions
diff --git a/klm/lm/lm_exception.hh b/klm/lm/lm_exception.hh
new file mode 100644
index 00000000..1216c4c7
--- /dev/null
+++ b/klm/lm/lm_exception.hh
@@ -0,0 +1,42 @@
+#ifndef LM_LM_EXCEPTION__
+#define LM_LM_EXCEPTION__
+
+// Named to avoid conflict with util/exception.hh.
+
+#include "util/exception.hh"
+#include "util/string_piece.hh"
+
+#include <exception>
+#include <string>
+
+namespace lm {
+
+class LoadException : public util::Exception {
+ public:
+ virtual ~LoadException() throw();
+
+ protected:
+ LoadException() throw();
+};
+
+class VocabLoadException : public LoadException {
+ public:
+ virtual ~VocabLoadException() throw();
+ VocabLoadException() throw();
+};
+
+class FormatLoadException : public LoadException {
+ public:
+ FormatLoadException() throw();
+ ~FormatLoadException() throw();
+};
+
+class SpecialWordMissingException : public VocabLoadException {
+ public:
+ explicit SpecialWordMissingException(StringPiece which) throw();
+ ~SpecialWordMissingException() throw();
+};
+
+} // namespace lm
+
+#endif // LM_LM_EXCEPTION