|
1
2
3
4
5
6
7
8
9
10
|
/*
* File: Environment.hpp
* Author: mlenart
*
* Created on 22 styczeń 2014, 12:08
*/
#ifndef ENVIRONMENT_HPP
#define ENVIRONMENT_HPP
|
|
11
12
13
|
#include <vector>
class InterpretedChunksDecoder;
|
|
14
|
class CasePatternHelper;
|
|
15
|
|
|
16
17
|
#include "charset/CaseConverter.hpp"
#include "charset/CharsetConverter.hpp"
|
|
18
19
|
#include "fsa/fsa.hpp"
#include "segrules/segrules.hpp"
|
|
20
21
|
#include "const.hpp"
#include "Tagset.hpp"
|
|
22
23
|
//#include "InterpretedChunksDecoder.hpp"
#include "InterpsGroup.hpp"
|
|
24
|
#include "CasePatternHelper.hpp"
|
|
25
|
#include "Qualifiers.hpp"
|
|
26
|
#include "deserializer/InterpsGroupsReader.hpp"
|
|
27
|
|
|
28
|
struct InterpsGroup;
|
|
29
30
|
typedef FSA<InterpsGroupsReader> FSAType;
//typedef FSA< std::vector<InterpsGroup > > FSAType;
|
|
31
32
33
34
|
class Environment {
public:
Environment(
|
|
35
36
|
MorfeuszCharset charset,
MorfeuszProcessorType morfeuszProcessor,
|
|
37
38
|
const unsigned char* fileStartPtr);
|
|
39
|
void setCharset(MorfeuszCharset charset);
|
|
40
|
|
|
41
42
|
void setCaseSensitive(bool caseSensitive);
|
|
43
44
|
const CharsetConverter& getCharsetConverter() const;
|
|
45
|
const CaseConverter& getCaseConverter() const;
|
|
46
|
|
|
47
48
|
void setTagset(const Tagset& tagset);
const Tagset& getTagset() const;
|
|
49
|
|
|
50
51
|
void setFSAFile(const std::string& filename);
|
|
52
53
|
void setSegrulesOption(const std::string& option, const std::string& value);
|
|
54
55
56
57
58
|
const SegrulesFSA& getCurrentSegrulesFSA() const;
const FSAType& getFSA() const;
const InterpretedChunksDecoder& getInterpretedChunksDecoder() const;
|
|
59
|
|
|
60
61
|
MorfeuszProcessorType getProcessorType() const;
|
|
62
63
|
const CasePatternHelper& getCasePatternHelper() const;
|
|
64
65
|
const Qualifiers& getQualifiersHelper() const;
|
|
66
67
|
bool isSeparator(uint32_t codepoint) const;
|
|
68
69
70
71
|
virtual ~Environment();
private:
const CharsetConverter* currentCharsetConverter;
const CaseConverter caseConverter;
|
|
72
|
Tagset tagset;
|
|
73
|
Qualifiers qualifiers;
|
|
74
75
76
|
const unsigned char* fsaFileStartPtr;
const FSAType* fsa;
|
|
77
|
std::vector<uint32_t> separatorsList;
|
|
78
|
std::map<SegrulesOptions, SegrulesFSA*> segrulesFSAsMap;
|
|
79
|
SegrulesOptions currSegrulesOptions;
|
|
80
81
82
83
|
const SegrulesFSA* currSegrulesFSA;
bool isFromFile;
const InterpretedChunksDecoder* chunksDecoder;
|
|
84
|
MorfeuszProcessorType processorType;
|
|
85
|
CasePatternHelper* casePatternHelper;
|
|
86
87
88
89
90
91
|
const CharsetConverter* getCharsetConverter(MorfeuszCharset charset) const;
};
#endif /* ENVIRONMENT_HPP */
|