-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathspelling.h
39 lines (29 loc) · 840 Bytes
/
spelling.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
38
39
//
// Copyright RIME Developers
// Distributed under the BSD License
//
// 2012-01-17 GONG Chen <chen.sst@gmail.com>
//
#ifndef RIME_SPELLING_H_
#define RIME_SPELLING_H_
#include "common.h"
namespace rime {
enum SpellingType { kNormalSpelling, kFuzzySpelling,
kAbbreviation, kCompletion, kAmbiguousSpelling,
kInvalidSpelling };
struct SpellingProperties {
SpellingType type = kNormalSpelling;
size_t end_pos = 0;
double credibility = 1.0;
string tips;
};
struct Spelling {
string str;
SpellingProperties properties;
Spelling() = default;
Spelling(const string& _str) : str(_str) {}
bool operator== (const Spelling& other) { return str == other.str; }
bool operator< (const Spelling& other) { return str < other.str; }
};
} // namespace rime
#endif // RIME_SPELLING_H_