Environment.hpp
2.5 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
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
/*
* File: Environment.hpp
* Author: mlenart
*
* Created on 22 styczeń 2014, 12:08
*/
#ifndef ENVIRONMENT_HPP
#define ENVIRONMENT_HPP
#include <vector>
class InterpretedChunksDecoder;
#include "charset/CaseConverter.hpp"
#include "charset/CharsetConverter.hpp"
#include "fsa/fsa.hpp"
#include "segrules/segrules.hpp"
#include "const.hpp"
#include "Tagset.hpp"
//#include "InterpretedChunksDecoder.hpp"
#include "InterpsGroup.hpp"
#include "CasePatternHelper.hpp"
#include "Qualifiers.hpp"
struct InterpsGroup;
typedef FSA< std::vector<InterpsGroup > > FSAType;
class Environment {
public:
Environment(
MorfeuszCharset charset,
MorfeuszProcessorType morfeuszProcessor,
const unsigned char* fileStartPtr);
void setCharset(MorfeuszCharset charset);
void setCaseSensitive(bool caseSensitive);
const CharsetConverter& getCharsetConverter() const;
const CaseConverter& getCaseConverter() const;
void setTagset(const Tagset& tagset);
const Tagset& getTagset() const;
void setFSAFile(const std::string& filename);
void setSegrulesOption(const std::string& option, const std::string& value);
const SegrulesFSA& getCurrentSegrulesFSA() const;
const FSAType& getFSA() const;
const InterpretedChunksDecoder& getInterpretedChunksDecoder() const;
MorfeuszProcessorType getProcessorType() const;
const CasePatternHelper& getCasePatternHelper() const;
const Qualifiers& getQualifiersHelper() const;
bool isSeparator(uint32_t codepoint) const;
virtual ~Environment();
private:
const CharsetConverter* currentCharsetConverter;
const UTF8CharsetConverter utf8CharsetConverter;
const ISO8859_2_CharsetConverter isoCharsetConverter;
const Windows_1250_CharsetConverter cp1250CharsetConverter;
const CP852_CharsetConverter cp852CharsetConverter;
const CaseConverter caseConverter;
Tagset tagset;
Qualifiers qualifiers;
const unsigned char* fsaFileStartPtr;
const FSAType* fsa;
std::vector<uint32_t> separatorsList;
std::map<SegrulesOptions, SegrulesFSA*> segrulesFSAsMap;
SegrulesOptions currSegrulesOptions;
const SegrulesFSA* currSegrulesFSA;
bool isFromFile;
const InterpretedChunksDecoder* chunksDecoder;
MorfeuszProcessorType processorType;
CasePatternHelper casePatternHelper;
const CharsetConverter* getCharsetConverter(MorfeuszCharset charset) const;
};
#endif /* ENVIRONMENT_HPP */