librime: rime::ScriptTranslator Class Reference

| librime 1.2 Rime Input Method Engine, the core library

Public Member Functions | Protected Attributes | List of all members
rime::ScriptTranslator Class Reference

`#include <script_translator.h>`

Inheritance diagram for rime::ScriptTranslator:
[legend]
Collaboration diagram for rime::ScriptTranslator:
[legend]

## Public Member Functions
| ScriptTranslator (const Ticket &ticket)
virtual an< Translation > | Query (const string &input, const Segment &segment) override
virtual bool | Memorize (const CommitEntry &commit_entry) override
virtual bool | ProcessSegmentOnCommit (CommitEntry &commit_entry, const Segment &seg) override
string | FormatPreedit (const string &preedit)
string | Spell (const Code &code)
string | GetPrecedingText (size_t start) const
bool | UpdateElements (const CommitEntry &commit_entry)
bool | ConcatenatePhrases (CommitEntry &commit_entry, const vector< an< Phrase > > &phrases)
bool | SaveCommitEntry (CommitEntry &commit_entry)
int | max_homophones () const
int | spelling_hints () const
bool | always_show_comments () const
bool | enable_word_completion () const
int | max_word_length () const
int | core_word_length () const
Public Member Functions inherited from rime::Translator
| Translator (const Ticket &ticket)
virtual | ~Translator ()=default
string | name_space () const
Public Member Functions inherited from rime::Memory
| Memory (const Ticket &ticket)
virtual | ~Memory ()
bool | StartSession ()
bool | FinishSession ()
bool | DiscardSession ()
Dictionary * | dict () const
UserDictionary * | user_dict () const
const Language * | language () const
Public Member Functions inherited from rime::TranslatorOptions
| TranslatorOptions (const Ticket &ticket)
bool | IsUserDictDisabledFor (const string &input) const
const string & | delimiters () const
vector< string > | tags () const
void | set_tags (const vector< string > &tags)
const string & | tag () const
void | set_tag (const string &tag)
bool | contextual_suggestions () const
void | set_contextual_suggestions (bool enabled)
bool | enable_completion () const
void | set_enable_completion (bool enabled)
bool | strict_spelling () const
void | set_strict_spelling (bool is_strict)
double | initial_quality () const
void | set_initial_quality (double quality)
Projection & | preedit_formatter ()
Projection & | comment_formatter ()
const hash_set< string > & | blacklist ()

## Protected Attributes
int | max_homophones_ = 1
int | spelling_hints_ = 0
int | max_word_length_ = 0
int | core_word_length_ = 0
bool | always_show_comments_ = false
bool | enable_correction_ = false
bool | enable_word_completion_ = false
the< Corrector > | corrector_
the< Poet > | poet_
vector< an< Phrase > > | queue_
Protected Attributes inherited from rime::Translator
Engine * | engine_
string | name_space_
Protected Attributes inherited from rime::Memory
the< Dictionary > | dict_
the< UserDictionary > | user_dict_
the< Language > | language_
Protected Attributes inherited from rime::TranslatorOptions
string | delimiters_
vector< string > | tags_ {"abc"}
bool | contextual_suggestions_ = false
bool | enable_completion_ = true
bool | strict_spelling_ = false
double | initial_quality_ = 0.
int | max_sentences_ = 1
double | sentence_cutoff_threshold_ = 0.1
Projection | preedit_formatter_
Projection | comment_formatter_
Patterns | user_dict_disabling_patterns_
hash_set< string > | blacklist_

## Additional Inherited Members
Public Types inherited from rime::Class< Translator, const Ticket & >
using | Initializer
Static Public Member Functions inherited from rime::Class< Translator, const Ticket & >
static Component * | Require (const string &name)
Protected Member Functions inherited from rime::Memory
void | OnCommit (Context *ctx)
void | OnDeleteEntry (Context *ctx)
void | OnUnhandledKey (Context *ctx, const KeyEvent &key)

## Constructor & Destructor Documentation

## ◆ ScriptTranslator()

rime::ScriptTranslator::ScriptTranslator | ( | const Ticket & | ticket | ) |

## Member Function Documentation

## ◆ always_show_comments()

bool rime::ScriptTranslator::always_show_comments | ( |  | ) | const
| inline

## ◆ ConcatenatePhrases()

bool rime::ScriptTranslator::ConcatenatePhrases | ( | CommitEntry & | commit_entry,
|  | const vector< an< Phrase > > & | phrases )

## ◆ core_word_length()

int rime::ScriptTranslator::core_word_length | ( |  | ) | const

## ◆ enable_word_completion()

bool rime::ScriptTranslator::enable_word_completion | ( |  | ) | const
| inline

## ◆ FormatPreedit()

string rime::ScriptTranslator::FormatPreedit | ( | const string & | preedit | ) |

## ◆ GetPrecedingText()

string rime::ScriptTranslator::GetPrecedingText | ( | size_t | start | ) | const

## ◆ max_homophones()

int rime::ScriptTranslator::max_homophones | ( |  | ) | const
| inline

## ◆ max_word_length()

int rime::ScriptTranslator::max_word_length | ( |  | ) | const
| inline

## ◆ Memorize()

bool rime::ScriptTranslator::Memorize | ( | const CommitEntry & | commit_entry | ) |
| overridevirtual

Implements rime::Memory.

## ◆ ProcessSegmentOnCommit()

bool rime::ScriptTranslator::ProcessSegmentOnCommit | ( | CommitEntry & | commit_entry,
|  | const Segment & | seg )
| overridevirtual

Reimplemented from rime::Memory.

## ◆ Query()

an< Translation > rime::ScriptTranslator::Query | ( | const string & | input,
|  | const Segment & | segment )
| overridevirtual

Implements rime::Translator.

## ◆ SaveCommitEntry()

bool rime::ScriptTranslator::SaveCommitEntry | ( | CommitEntry & | commit_entry | ) |

## ◆ Spell()

string rime::ScriptTranslator::Spell | ( | const Code & | code | ) |

## ◆ spelling_hints()

int rime::ScriptTranslator::spelling_hints | ( |  | ) | const
| inline

## ◆ UpdateElements()

bool rime::ScriptTranslator::UpdateElements | ( | const CommitEntry & | commit_entry | ) |

## Member Data Documentation

## ◆ always_show_comments_

bool rime::ScriptTranslator::always_show_comments_ = false
| protected

## ◆ core_word_length_

int rime::ScriptTranslator::core_word_length_ = 0
| protected

## ◆ corrector_

the<Corrector> rime::ScriptTranslator::corrector_
| protected

## ◆ enable_correction_

bool rime::ScriptTranslator::enable_correction_ = false
| protected

## ◆ enable_word_completion_

bool rime::ScriptTranslator::enable_word_completion_ = false
| protected

## ◆ max_homophones_

int rime::ScriptTranslator::max_homophones_ = 1
| protected

## ◆ max_word_length_

int rime::ScriptTranslator::max_word_length_ = 0
| protected

## ◆ poet_

the<Poet> rime::ScriptTranslator::poet_
| protected

## ◆ queue_

vector<an<Phrase> > rime::ScriptTranslator::queue_
| protected

## ◆ spelling_hints_

int rime::ScriptTranslator::spelling_hints_ = 0
| protected

The documentation for this class was generated from the following files:

- script_translator.h
- script_translator.cc