about summary refs log tree commit diff stats
path: root/vendor/apclientpp
Commit message (Expand)AuthorAgeFilesLines
* Updated apclientpp+asio+wswrapStar Rauchenberger2024-06-041-0/+0
* Tracker connects to AP nowStar Rauchenberger2023-05-021-0/+0
a> 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
#ifndef WORD_H_91F99D46
#define WORD_H_91F99D46

#include <cassert>
#include "../lib/enums.h"

namespace verbly {
  namespace generator {

    class notion;
    class lemma;
    class database;
    class group;

    class word {
    public:

      // Constructors

      word(notion& n, lemma& l);

      word(notion& n, lemma& l, int tagCount);

      // Mutators

      void setAdjectivePosition(positioning adjectivePosition);

      void setVerbGroup(const group& verbGroup);

      // Accessors

      int getId() const
      {
        return id_;
      }

      notion& getNotion()
      {
        return notion_;
      }

      const notion& getNotion() const
      {
        return notion_;
      }

      lemma& getLemma()
      {
        return lemma_;
      }

      const lemma& getLemma() const
      {
        return lemma_;
      }

      bool hasTagCount() const
      {
        return hasTagCount_;
      }

      int getTagCount() const
      {
        // Calling code should always call hasTagCount first.
        assert(hasTagCount_);

        return tagCount_;
      }

      positioning getAdjectivePosition() const
      {
        return adjectivePosition_;
      }

      bool hasVerbGroup() const
      {
        return (verbGroup_ != nullptr);
      }

      const group& getVerbGroup() const
      {
        // Calling code should always call hasVerbGroup first.
        assert(verbGroup_ != nullptr);

        return *verbGroup_;
      }

    private:

      static int nextId_;

      const int id_;
      notion& notion_;
      lemma& lemma_;
      const int tagCount_ = 0;
      const bool hasTagCount_ = false;

      positioning adjectivePosition_ = positioning::undefined;
      const group* verbGroup_ = nullptr;

    };

    // Serializer

    database& operator<<(database& db, const word& arg);

  };
};

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