summaryrefslogtreecommitdiff
path: root/klm/lm/lm_exception.hh
blob: 1216c4c75a2c10958d158fa21446e002d90a4f71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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