librime: reverse_lookup_translator.h Source File

| librime 1.2 Rime Input Method Engine, the core library

reverse_lookup_translator.h
Go to the documentation of this file.
1//
2// Copyright RIME Developers
3// Distributed under the BSD License
4//
5// 2012-01-03 GONG Chen <chen.sst@gmail.com>
6//
7#ifndef RIME_REVERSE_LOOKUP_TRANSLATOR_H_
8#define RIME_REVERSE_LOOKUP_TRANSLATOR_H_
9
10#include <rime/common.h>
11#include <rime/translator.h>
12#include <rime/algo/algebra.h>
13
14namespace rime {
15
16class Dictionary;
17class ReverseLookupDictionary;
18class TranslatorOptions;
19
20 class ReverseLookupTranslator : public Translator {
21 public:
22 ReverseLookupTranslator(const Ticket& ticket);
23
24 virtual an<Translation> Query(const string& input, const Segment& segment);
25
26 protected:
27 void Initialize();
28
29 string tag_;
30 bool initialized_ = false;
31 the<Dictionary> dict_;
32 the<ReverseLookupDictionary> rev_dict_;
33 the<TranslatorOptions> options_;
34 string prefix_;
35 string suffix_;
36 string tips_;
37};
38
39} // namespace rime
40
41#endif // RIME_REVERSE_LOOKUP_TRANSLATOR_H_
algebra.h
common.h
translator.h
rime
Definition algebra.cc:12
rime::an
std::shared_ptr< T > an
Definition common.h:60
rime::the
std::unique_ptr< T > the
Definition common.h:58
rime::Dictionary
Definition dictionary.h:62
rime::ReverseLookupDictionary
Definition reverse_lookup_dictionary.h:64
rime::ReverseLookupTranslator::ReverseLookupTranslator
ReverseLookupTranslator(const Ticket &ticket)
Definition reverse_lookup_translator.cc:92
rime::ReverseLookupTranslator::initialized_
bool initialized_
Definition reverse_lookup_translator.h:30
rime::ReverseLookupTranslator::suffix_
string suffix_
Definition reverse_lookup_translator.h:35
rime::ReverseLookupTranslator::options_
the< TranslatorOptions > options_
Definition reverse_lookup_translator.h:33
rime::ReverseLookupTranslator::dict_
the< Dictionary > dict_
Definition reverse_lookup_translator.h:31
rime::ReverseLookupTranslator::tips_
string tips_
Definition reverse_lookup_translator.h:36
rime::ReverseLookupTranslator::tag_
string tag_
Definition reverse_lookup_translator.h:29
rime::ReverseLookupTranslator::prefix_
string prefix_
Definition reverse_lookup_translator.h:34
rime::ReverseLookupTranslator::Query
virtual an< Translation > Query(const string &input, const Segment &segment)
Definition reverse_lookup_translator.cc:143
rime::ReverseLookupTranslator::Initialize
void Initialize()
Definition reverse_lookup_translator.cc:103
rime::ReverseLookupTranslator::rev_dict_
the< ReverseLookupDictionary > rev_dict_
Definition reverse_lookup_translator.h:32
rime::TranslatorOptions
Definition translator_commons.h:143
rime::Segment
Definition segmentation.h:18
rime::Ticket
Definition ticket.h:17
rime::Translator::Translator
Translator(const Ticket &ticket)
Definition translator.h:24