librime: rime::ScriptTranslation Class Reference

| librime 1.2 Rime Input Method Engine, the core library

Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
rime::ScriptTranslation Class Reference
Inheritance diagram for rime::ScriptTranslation:
[legend]
Collaboration diagram for rime::ScriptTranslation:
[legend]

## Public Member Functions
| ScriptTranslation (ScriptTranslator *translator, Corrector *corrector, Poet *poet, const string &input, size_t start, size_t end_of_input, int max_sentences, double sentence_cutoff_threshold)
bool | Evaluate (Dictionary *dict, UserDictionary *user_dict)
virtual bool | Next ()
virtual an< Candidate > | Peek ()
Public Member Functions inherited from rime::Translation
| Translation ()=default
virtual | ~Translation ()=default
virtual int | Compare (an< Translation > other, const CandidateList &candidates)
bool | exhausted () const

## Protected Types
enum | CandidateSource { kUninitialized , kUserPhrase , kSysPhrase , kSentence }

## Protected Member Functions
bool | CheckEmpty ()
bool | IsNormalSpelling () const
bool | PrepareCandidate ()
template<class QueryResult>
void | EnrollEntries (map< int, DictEntryList > &entries_by_end_pos, const an< QueryResult > &query_result)
WordGraph | PrepareForMakingSentence (Dictionary *dict, UserDictionary *user_dict)
an< Sentence > | MakeSentence (Dictionary *dict, UserDictionary *user_dict)
deque< an< Sentence > > | MakeSentences (Dictionary *dict, UserDictionary *user_dict)
Protected Member Functions inherited from rime::Translation
void | set_exhausted (bool exhausted)

## Protected Attributes
ScriptTranslator * | translator_
Poet * | poet_
size_t | start_
size_t | end_of_input_
an< ScriptSyllabifier > | syllabifier_
an< DictEntryCollector > | phrase_
an< UserDictEntryCollector > | user_phrase_
deque< an< Sentence > > | sentences_
an< Phrase > | candidate_ = nullptr
size_t | candidate_index_ = 0
CandidateSource | candidate_source_ = kUninitialized
DictEntryCollector::reverse_iterator | phrase_iter_
UserDictEntryCollector::reverse_iterator | user_phrase_iter_
const size_t | max_corrections_ = 4
size_t | correction_count_ = 0
int | max_sentences_ = 1
double | sentence_cutoff_threshold_ = 0.1
bool | enable_correction_

## Member Enumeration Documentation

## ◆ CandidateSource

enum rime::ScriptTranslation::CandidateSource
| protected

Enumerator
kUninitialized |
kUserPhrase |
kSysPhrase |
kSentence |

## Constructor & Destructor Documentation

## ◆ ScriptTranslation()

rime::ScriptTranslation::ScriptTranslation | ( | ScriptTranslator * | translator,
|  | Corrector * | corrector,
|  | Poet * | poet,
|  | const string & | input,
|  | size_t | start,
|  | size_t | end_of_input,
|  | int | max_sentences,
|  | double | sentence_cutoff_threshold )
| inline

## Member Function Documentation

## ◆ CheckEmpty()

bool rime::ScriptTranslation::CheckEmpty | ( |  | ) |
| protected

## ◆ EnrollEntries()

template<class QueryResult>

void rime::ScriptTranslation::EnrollEntries | ( | map< int, DictEntryList > & | entries_by_end_pos,
|  | const an< QueryResult > & | query_result )
| protected

## ◆ Evaluate()

bool rime::ScriptTranslation::Evaluate | ( | Dictionary * | dict,
|  | UserDictionary * | user_dict )

## ◆ IsNormalSpelling()

bool rime::ScriptTranslation::IsNormalSpelling | ( |  | ) | const
| protected

## ◆ MakeSentence()

an< Sentence > rime::ScriptTranslation::MakeSentence | ( | Dictionary * | dict,
|  | UserDictionary * | user_dict )
| protected

## ◆ MakeSentences()

deque< an< Sentence > > rime::ScriptTranslation::MakeSentences | ( | Dictionary * | dict,
|  | UserDictionary * | user_dict )
| protected

## ◆ Next()

bool rime::ScriptTranslation::Next | ( |  | ) |
| virtual

Implements rime::Translation.

## ◆ Peek()

an< Candidate > rime::ScriptTranslation::Peek | ( |  | ) |
| virtual

Implements rime::Translation.

## ◆ PrepareCandidate()

bool rime::ScriptTranslation::PrepareCandidate | ( |  | ) |
| protected

## ◆ PrepareForMakingSentence()

WordGraph rime::ScriptTranslation::PrepareForMakingSentence | ( | Dictionary * | dict,
|  | UserDictionary * | user_dict )
| protected

## Member Data Documentation

## ◆ candidate_

an<Phrase> rime::ScriptTranslation::candidate_ = nullptr
| protected

## ◆ candidate_index_

size_t rime::ScriptTranslation::candidate_index_ = 0
| protected

## ◆ candidate_source_

CandidateSource rime::ScriptTranslation::candidate_source_ = kUninitialized
| protected

## ◆ correction_count_

size_t rime::ScriptTranslation::correction_count_ = 0
| protected

## ◆ enable_correction_

bool rime::ScriptTranslation::enable_correction_
| protected

## ◆ end_of_input_

size_t rime::ScriptTranslation::end_of_input_
| protected

## ◆ max_corrections_

const size_t rime::ScriptTranslation::max_corrections_ = 4
| protected

## ◆ max_sentences_

int rime::ScriptTranslation::max_sentences_ = 1
| protected

## ◆ phrase_

an<DictEntryCollector> rime::ScriptTranslation::phrase_
| protected

## ◆ phrase_iter_

DictEntryCollector::reverse_iterator rime::ScriptTranslation::phrase_iter_
| protected

## ◆ poet_

Poet* rime::ScriptTranslation::poet_
| protected

## ◆ sentence_cutoff_threshold_

double rime::ScriptTranslation::sentence_cutoff_threshold_ = 0.1
| protected

## ◆ sentences_

deque<an<Sentence> > rime::ScriptTranslation::sentences_
| protected

## ◆ start_

size_t rime::ScriptTranslation::start_
| protected

## ◆ syllabifier_

an<ScriptSyllabifier> rime::ScriptTranslation::syllabifier_
| protected

## ◆ translator_

ScriptTranslator* rime::ScriptTranslation::translator_
| protected

## ◆ user_phrase_

an<UserDictEntryCollector> rime::ScriptTranslation::user_phrase_
| protected

## ◆ user_phrase_iter_

UserDictEntryCollector::reverse_iterator rime::ScriptTranslation::user_phrase_iter_
| protected

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

- script_translator.cc