summary refs log tree commit diff stats
path: root/generator/lemma.h
blob: f7d549114133ec667c63800d72ea2b82f99f501f (plain) (blame)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef LEMMA_H_D73105A7
#define LEMMA_H_D73105A7

#include <string>
#include <map>
#include <set>
#include <hkutil/database.h>
#include "../lib/enums.h"

namespace verbly {
  namespace generator {

    class form;

    class lemma {
    public:

      // Constructors

      explicit lemma(const form& baseForm);

      // Mutators

      void addInflection(inflection type, const form& f);

      // Accessors

      int getId() const
      {
        return id_;
      }

      const form& getBaseForm() const
      {
        return baseForm_;
      }

      std::set<const form*> getInflections(inflection type) const;

    private:

      static int nextId_;

      const int id_;
      const form& baseForm_;

      std::map<inflection, std::set<const form*>> inflections_;

    };

    // Serializer

    hatkirby::database& operator<<(hatkirby::database& db, const lemma& arg);

  };
};

#endif /* end of include guard: LEMMA_H_D73105A7 */