-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathlsx_processor.h
More file actions
59 lines (51 loc) · 1.25 KB
/
lsx_processor.h
File metadata and controls
59 lines (51 loc) · 1.25 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
#ifndef _LSX_PROCESSOR_H_
#define _LSX_PROCESSOR_H_
#include <lttoolbox/alphabet_exe.h>
#include <lttoolbox/input_file.h>
#include <lttoolbox/my_stdio.h>
#include <lttoolbox/state.h>
#include <lttoolbox/string_writer.h>
#include <lttoolbox/transducer_exe.h>
#include <unicode/ustdio.h>
#include <deque>
class LSXProcessor
{
private:
StringWriter str_write;
std::map<UString, TransducerExe> transducers;
State initial_state;
std::set<TransducerExe*> all_finals;
AlphabetExe alphabet;
bool mmapping = false;
void* mmap_pointer;
int mmap_len;
std::set<UChar32> escaped_chars;
std::set<UChar32> alphabetic_chars;
bool null_flush = true;
bool dictionary_case = false;
bool at_end = false;
bool at_null = false;
std::deque<UString> blank_queue;
std::deque<UString> bound_blank_queue;
std::deque<UString> lu_queue;
void readNextLU(InputFile& input);
void processWord(InputFile& input, UFILE* output);
int word_boundary;
int word_boundary_s;
int word_boundary_ns;
int any_char;
int any_tag;
public:
LSXProcessor();
void load(FILE* input);
void process(InputFile& input, UFILE* output);
void setNullFlush(bool val)
{
null_flush = val;
}
void setDictionaryCaseMode(bool val)
{
dictionary_case = val;
}
};
#endif