librime 1.2
Rime Input Method Engine, the core library
speller.h
Go to the documentation of this file.
1//
2// Copyright RIME Developers
3// Distributed under the BSD License
4//
5// 2011-10-27 GONG Chen <chen.sst@gmail.com>
6//
7#ifndef RIME_SPELLER_H_
8#define RIME_SPELLER_H_
9
10#include <boost/regex.hpp>
11#include <rime/common.h>
12#include <rime/component.h>
13#include <rime/processor.h>
14
15namespace rime {
16
17class Context;
18struct Segment;
19
20class Speller : public Processor {
21 public:
22 Speller(const Ticket& ticket);
23
24 virtual ProcessResult ProcessKeyEvent(const KeyEvent& key_event);
25
26 protected:
32 };
33
36 bool AutoSelectPreviousMatch(Context* ctx, Segment* previous_segment);
37 bool FindEarlierMatch(Context* ctx, size_t start, size_t end);
38 bool AutoClear(Context* ctx);
39
40 string alphabet_;
42 string initials_;
43 string finals_;
45 bool auto_select_ = false;
46 bool use_space_ = false;
49};
50
51} // namespace rime
52
53#endif // RIME_SPELLER_H_
Definition algebra.cc:12
ProcessResult
Definition processor.h:18
Definition context.h:19
int max_code_length_
Definition speller.h:44
AutoClearMethod
Definition speller.h:27
@ kClearNone
Definition speller.h:28
@ kClearAuto
Definition speller.h:29
@ kClearManual
Definition speller.h:30
@ kClearMaxLength
Definition speller.h:31
bool use_space_
Definition speller.h:46
virtual ProcessResult ProcessKeyEvent(const KeyEvent &key_event)
Definition speller.cc:100
AutoClearMethod auto_clear_
Definition speller.h:48
bool AutoSelectAtMaxCodeLength(Context *ctx)
Definition speller.cc:148
boost::regex auto_select_pattern_
Definition speller.h:47
bool FindEarlierMatch(Context *ctx, size_t start, size_t end)
Definition speller.cc:229
string alphabet_
Definition speller.h:40
string finals_
Definition speller.h:43
string initials_
Definition speller.h:42
bool AutoSelectUniqueCandidate(Context *ctx)
Definition speller.cc:162
bool AutoClear(Context *ctx)
Definition speller.cc:219
string delimiters_
Definition speller.h:41
bool AutoSelectPreviousMatch(Context *ctx, Segment *previous_segment)
Definition speller.cc:189
bool auto_select_
Definition speller.h:45
Speller(const Ticket &ticket)
Definition speller.cc:71
Definition key_event.h:17
Processor(const Ticket &ticket)
Definition processor.h:26
Definition segmentation.h:18
Definition ticket.h:17