|
libime
|
Input context for table input method. More...
#include <libime/table/tablecontext.h>


Public Types | |
| using | CandidateRange = boost::any_range< const SentenceResult, boost::random_access_traversal_tag > |
Public Member Functions | |
| TableContext (TableBasedDictionary &dict, UserLanguageModel &model) | |
| void | erase (size_t from, size_t to) override |
| void | select (size_t idx) |
| bool | isValidInput (uint32_t c) const |
| CandidateRange | candidates () const |
| std::string | candidateHint (size_t idx, bool custom=false) const |
| bool | selected () const |
| size_t | selectedSize () const |
| std::tuple< std::string, bool > | selectedSegment (size_t idx) const |
| std::string | selectedCode (size_t idx) const |
| size_t | selectedSegmentLength (size_t idx) const |
| std::string | preedit () const |
| A simple preedit implementation. More... | |
| const std::string & | currentCode () const |
| Current unselected code. | |
| std::string | selectedSentence () const |
| The concatenation of all selectedSegment where bool == true. | |
| size_t | selectedLength () const |
| void | learn () |
| Save the current selected text. | |
| void | learnLast () |
| Save the last selected text. | |
| void | learnAutoPhrase (std::string_view history) |
| Learn auto word from string. More... | |
| void | learnAutoPhrase (std::string_view history, const std::vector< std::string > &hints) |
| Learn auto word from string. More... | |
| const TableBasedDictionary & | dict () const |
| TableBasedDictionary & | mutableDict () |
| const UserLanguageModel & | model () const |
| UserLanguageModel & | mutableModel () |
| void | autoSelect () |
| void | setAutoSelectIndex (size_t index) |
| Set the auto select index, usually, this is the candidate cursor index. More... | |
Public Member Functions inherited from libime::InputBuffer | |
| bool | type (std::string_view s) |
| std::string_view | at (size_t i) const |
| std::string_view | operator[] (size_t i) const |
| iterator | begin () |
| iterator | end () |
Static Public Member Functions | |
| static std::string | code (const SentenceResult &sentence) |
| static PhraseFlag | flag (const SentenceResult &sentence) |
| static bool | isPinyin (const SentenceResult &sentence) |
| static bool | isAuto (const SentenceResult &sentence) |
Protected Member Functions | |
| bool | typeImpl (const char *s, size_t length) override |
Input context for table input method.
Definition at line 37 of file tablecontext.h.
| void libime::TableContext::learnAutoPhrase | ( | std::string_view | history | ) |
Learn auto word from string.
Depending on the tableOptions, it will try to learn the word in history.
Definition at line 823 of file tablecontext.cpp.
| void libime::TableContext::learnAutoPhrase | ( | std::string_view | history, |
| const std::vector< std::string > & | hints | ||
| ) |
Learn auto word from string.
Similar to its overload, but with hint of given code.
Definition at line 827 of file tablecontext.cpp.
| std::string libime::TableContext::preedit | ( | ) | const |
A simple preedit implementation.
The value is derived from function selectedSegment and currentCode.
Definition at line 724 of file tablecontext.cpp.
| void libime::TableContext::setAutoSelectIndex | ( | size_t | index | ) |
Set the auto select index, usually, this is the candidate cursor index.
Definition at line 467 of file tablecontext.cpp.
1.8.13