Blame view

morfeusz/InterpretedChunk.hpp 1.76 KB
Michał Lenart authored
1
2
3
4
5
6
7
8
9
10
/* 
 * File:   InterpretedChunk.hpp
 * Author: mlenart
 *
 * Created on 18 listopad 2013, 15:00
 */

#ifndef INTERPRETEDCHUNK_HPP
#define	INTERPRETEDCHUNK_HPP
Michał Lenart authored
11
#include <vector>
Michał Lenart authored
12
13
#include "InterpsGroup.hpp"
Michał Lenart authored
14
15
namespace morfeusz {
Michał Lenart authored
16
17
18
/**
 * Denotes a part of text that has some not-yet-deserialized interpretations attached to it.
 */
Michał Lenart authored
19
struct InterpretedChunk {
Michał Lenart authored
20
21
22
23

    /**
     * The type of segment for this chunk.
     */
Michał Lenart authored
24
    unsigned char segmentType;
Michał Lenart authored
25
26
27
28

    /**
     * Pointer to start of this chunks text
     */
Michał Lenart authored
29
    const char* textStartPtr;
Michał Lenart authored
30
31
32
33

    /**
     * Pointer to end of this chunks text (exclusive)
     */
Michał Lenart authored
34
    const char* textEndPtr;
Michał Lenart authored
35
36

    /**
Michał Lenart authored
37
38
39
40
41
42
     * Pointer to end of this chunks text (exclusive)
     * including following whitespaces if whitespace-handling set to APPEND
     */
    const char* chunkEndPtr;

    /**
Michał Lenart authored
43
44
     * Pointer to the start of this chunks binary data.
     */
Michał Lenart authored
45
    const unsigned char* interpsGroupPtr;
Michał Lenart authored
46
47
48
49

    /**
     * Pointer to the end of this chunks binary data (exclusive)
     */
Michał Lenart authored
50
    const unsigned char* interpsEndPtr;
Michał Lenart authored
51
52
53
54

    /**
     * true iff this chunk shifts orth to the one right to it (it is "A" in "A> B")
     */
Michał Lenart authored
55
    bool shiftOrth;
Michał Lenart authored
56
57
58
59

    /**
     * true iff this chunk has attached data from its prefix chunk (when it is "B" segment in "A> B" segmentation rule)
     */
Michał Lenart authored
60
    bool orthWasShifted;
Michał Lenart authored
61
62
63
64

    /**
     * Number of codepoints this chunks consists of.
     */
Michał Lenart authored
65
    int codepointsNum;
Michał Lenart authored
66
67
68
69

    /**
     * Chunks that are in the prefix segments (those with ">" in segmentation rules, ie. "dig>* dig")
     */
Michał Lenart authored
70
    std::vector<InterpretedChunk> prefixChunks;
Michał Lenart authored
71
72
73
74

    /**
     * Homonym id specified by the user.
     */
Michał Lenart authored
75
    std::string requiredHomonymId;
Michał Lenart authored
76
77

    bool forceIgnoreCase;
Michał Lenart authored
78
79
};
Michał Lenart authored
80
81
}
Michał Lenart authored
82
83
#endif	/* INTERPRETEDCHUNK_HPP */