librime 1.2
Rime Input Method Engine, the core library
unity_table_encoder.h
Go to the documentation of this file.
1//
2// Copyright RIME Developers
3// Distributed under the BSD License
4//
5// 2013-08-31 GONG Chen <chen.sst@gmail.com>
6//
7#ifndef RIME_UNITY_TABLE_ENCODER_H_
8#define RIME_UNITY_TABLE_ENCODER_H_
9
10#include <rime/common.h>
11#include <rime/algo/encoder.h>
12
13namespace rime {
14
15struct Ticket;
17class UserDictionary;
18
20 public:
23
24 bool Load(const Ticket& ticket);
25
26 void CreateEntry(const string& word,
27 const string& code_str,
28 const string& weight_str);
29 bool TranslateWord(const string& word, vector<string>* code);
30
32 const string& input,
33 bool predictive,
34 size_t limit = 0,
35 string* resume_key = NULL);
36
37 static bool HasPrefix(const string& key);
38 static bool AddPrefix(string* key);
39 static bool RemovePrefix(string* key);
40
41 protected:
44};
45
46} // namespace rime
47
48#endif // RIME_UNITY_TABLE_ENCODER_H_
Definition algebra.cc:12
std::unique_ptr< T > the
Definition common.h:58
TableEncoder(PhraseCollector *collector=NULL)
Definition encoder.cc:27
Definition reverse_lookup_dictionary.h:64
Definition user_dictionary.h:18
Definition user_dictionary.h:49
size_t LookupPhrases(UserDictEntryIterator *result, const string &input, bool predictive, size_t limit=0, string *resume_key=NULL)
Definition unity_table_encoder.cc:71
static bool AddPrefix(string *key)
Definition unity_table_encoder.cc:86
UserDictionary * user_dict_
Definition unity_table_encoder.h:42
static bool HasPrefix(const string &key)
Definition unity_table_encoder.cc:82
UnityTableEncoder(UserDictionary *user_dict)
Definition unity_table_encoder.cc:19
void CreateEntry(const string &word, const string &code_str, const string &weight_str)
Definition unity_table_encoder.cc:45
bool Load(const Ticket &ticket)
Definition unity_table_encoder.cc:26
bool TranslateWord(const string &word, vector< string > *code)
Definition unity_table_encoder.cc:57
the< ReverseLookupDictionary > rev_dict_
Definition unity_table_encoder.h:43
static bool RemovePrefix(string *key)
Definition unity_table_encoder.cc:91
Definition ticket.h:17