-
Notifications
You must be signed in to change notification settings - Fork 0
/
adjdecloader.h
37 lines (28 loc) · 850 Bytes
/
adjdecloader.h
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
#include <QString>
#include <QHash>
#ifndef ADJACENTCHARACTERS_H
#define ADJACENTCHARACTERS_H
/**
* @brief loads adjacent or decompositions of characters and their defintions
*
* possible filenames ":AdjList.txt", ":decomp importable.txt"
*/
class AdjDecLoader
{
public:
enum Characters
{
Traditional,
Simplified
};
AdjDecLoader(const QString& fileName, QHash<QString,QString> charDef, Characters characters = Simplified);
QStringList getText(const QString& hanzi, bool colorIfSubAdj = false);
private:
private:
void loadData();
QHash<QString,QString> charDef; // characters -defnition
QHash<QString,QStringList> charAdj; // characters -adjacent characters
QString fileName;
Characters characters; // mode, simplified or traditional sorting
};
#endif // ADJACENTCHARACTERS_H