Generator.hpp
1.3 KB
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
/*
* File: Generator.hpp
* Author: mlenart
*
* Created on 21 styczeń 2014, 14:38
*/
#ifndef GENERATOR_HPP
#define GENERATOR_HPP
#include <string>
#include <vector>
#include "charset/CharsetConverter.hpp"
#include "MorphInterpretation.hpp"
#include "Tagset.hpp"
#include "GeneratorDeserializer.hpp"
typedef FSA< std::vector<EncodedGeneratorInterpretation > > SynthFSAType;
typedef State< std::vector<EncodedGeneratorInterpretation > > SynthStateType;
class Generator {
public:
Generator(
const unsigned char* ptr,
const Environment& env);
void generate(const std::string& lemma, std::vector<MorphInterpretation>& result) const;
virtual ~Generator();
private:
// Generator(const SynthDeserializer& deserializer);
GeneratorDeserializer deserializer;
const SynthFSAType* fsa;
const Environment& env;
std::string decodeOrth(
const EncodedOrth& orth,
const std::vector<uint32_t>& lemmaCodepoints) const;
void decodeRes(
const std::vector<EncodedGeneratorInterpretation>& encodedRes,
const std::string& lemma,
const std::vector<uint32_t>& lemmaCodepoints,
std::vector<MorphInterpretation>& result) const;
void appendString(const string& str, string& res) const;
};
#endif /* GENERATOR_HPP */