librime: rime::UserDictionary Class Reference

| librime 1.2 Rime Input Method Engine, the core library

Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
rime::UserDictionary Class Reference

`#include <user_dictionary.h>`

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

## Public Member Functions
| UserDictionary (const string &name, an< Db > db)
virtual | ~UserDictionary ()
void | Attach (const an< Table > &table, const an< Prism > &prism)
bool | Load ()
bool | loaded () const
bool | readonly () const
an< UserDictEntryCollector > | Lookup (const SyllableGraph &syllable_graph, size_t start_pos, size_t depth_limit=0, size_t predict_word_from_depth=0, double initial_credibility=0.0)
size_t | LookupWords (UserDictEntryIterator *result, const string &input, bool predictive, size_t limit=0, string *resume_key=NULL)
bool | UpdateEntry (const DictEntry &entry, int commits)
bool | UpdateEntry (const DictEntry &entry, int commits, const string &new_entry_prefix)
bool | UpdateTickCount (TickCount increment)
bool | NewTransaction ()
bool | RevertRecentTransaction ()
bool | CommitPendingTransaction ()
const string & | name () const
TickCount | tick () const

## Static Public Member Functions
static an< DictEntry > | CreateDictEntry (const string &key, const string &value, TickCount present_tick, double credibility=0.0, double quality_len=0.0, string *full_code=nullptr)
Static Public Member Functions inherited from rime::Class< UserDictionary, const Ticket & >
static Component * | Require (const string &name)

## Protected Member Functions
bool | Initialize ()
bool | FetchTickCount ()
bool | TranslateCodeToString (const Code &code, string *result)
void | DfsLookup (const SyllableGraph &syll_graph, size_t current_pos, const string &current_prefix, DfsState *state)

## Additional Inherited Members
Public Types inherited from rime::Class< UserDictionary, const Ticket & >
using | Initializer

## Constructor & Destructor Documentation

## ◆ UserDictionary()

rime::UserDictionary::UserDictionary | ( | const string & | name,
|  | an< Db > | db )

## ◆ ~UserDictionary()

rime::UserDictionary::~UserDictionary | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ Attach()

void rime::UserDictionary::Attach | ( | const an< Table > & | table,
|  | const an< Prism > & | prism )

## ◆ CommitPendingTransaction()

bool rime::UserDictionary::CommitPendingTransaction | ( |  | ) |

## ◆ CreateDictEntry()

an< DictEntry > rime::UserDictionary::CreateDictEntry | ( | const string & | key,
|  | const string & | value,
|  | TickCount | present_tick,
|  | double | credibility = 0.0,
|  | double | quality_len = 0.0,
|  | string * | full_code = nullptr )
| static

## ◆ DfsLookup()

void rime::UserDictionary::DfsLookup | ( | const SyllableGraph & | syll_graph,
|  | size_t | current_pos,
|  | const string & | current_prefix,
|  | DfsState * | state )
| protected

## ◆ FetchTickCount()

bool rime::UserDictionary::FetchTickCount | ( |  | ) |
| protected

## ◆ Initialize()

bool rime::UserDictionary::Initialize | ( |  | ) |
| protected

## ◆ Load()

bool rime::UserDictionary::Load | ( |  | ) |

## ◆ loaded()

bool rime::UserDictionary::loaded | ( |  | ) | const

## ◆ Lookup()

an< UserDictEntryCollector > rime::UserDictionary::Lookup | ( | const SyllableGraph & | syllable_graph,
|  | size_t | start_pos,
|  | size_t | depth_limit = 0,
|  | size_t | predict_word_from_depth = 0,
|  | double | initial_credibility = 0.0 )

## ◆ LookupWords()

size_t rime::UserDictionary::LookupWords | ( | UserDictEntryIterator * | result,
|  | const string & | input,
|  | bool | predictive,
|  | size_t | limit = 0,
|  | string * | resume_key = NULL )

## ◆ name()

const string & rime::UserDictionary::name | ( |  | ) | const
| inline

## ◆ NewTransaction()

bool rime::UserDictionary::NewTransaction | ( |  | ) |

## ◆ readonly()

bool rime::UserDictionary::readonly | ( |  | ) | const

## ◆ RevertRecentTransaction()

bool rime::UserDictionary::RevertRecentTransaction | ( |  | ) |

## ◆ tick()

TickCount rime::UserDictionary::tick | ( |  | ) | const
| inline

## ◆ TranslateCodeToString()

bool rime::UserDictionary::TranslateCodeToString | ( | const Code & | code,
|  | string * | result )
| protected

## ◆ UpdateEntry() [1/2]

bool rime::UserDictionary::UpdateEntry | ( | const DictEntry & | entry,
|  | int | commits )

## ◆ UpdateEntry() [2/2]

bool rime::UserDictionary::UpdateEntry | ( | const DictEntry & | entry,
|  | int | commits,
|  | const string & | new_entry_prefix )

## ◆ UpdateTickCount()

bool rime::UserDictionary::UpdateTickCount | ( | TickCount | increment | ) |

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

- user_dictionary.h
- user_dictionary.cc