librime 1.2
Rime Input Method Engine, the core library
rime::Prism Class Reference

#include <prism.h>

Inheritance diagram for rime::Prism:
Collaboration diagram for rime::Prism:

Public Types

using Match = Darts::DoubleArray::result_pair_type

Public Member Functions

RIME_DLL Prism (const path &file_path)
RIME_DLL bool Load ()
RIME_DLL bool Save ()
RIME_DLL bool Build (const Syllabary &syllabary, const Script *script=nullptr, uint32_t dict_file_checksum=0, uint32_t schema_file_checksum=0)
RIME_DLL bool HasKey (const string &key)
RIME_DLL bool GetValue (const string &key, int *value) const
RIME_DLL void CommonPrefixSearch (const string &key, vector< Match > *result)
RIME_DLL void ExpandSearch (const string &key, vector< Match > *result, size_t limit)
SpellingAccessor QuerySpelling (SyllableId spelling_id)
RIME_DLL size_t array_size () const
uint32_t dict_file_checksum () const
uint32_t schema_file_checksum () const
Darts::DoubleArraytrie () const
Public Member Functions inherited from rime::MappedFile
 MappedFile (const MappedFile &)=delete
MappedFileoperator= (const MappedFile &)=delete
bool Exists () const
bool IsOpen () const
void Close ()
bool Remove ()
template<class T>
T * Find (size_t offset)
const pathfile_path () const
size_t file_size () const

Protected Attributes

the< Darts::DoubleArraytrie_
prism::Metadatametadata_ = nullptr
prism::SpellingMapspelling_map_ = nullptr
double format_ = 0.0

Additional Inherited Members

Protected Member Functions inherited from rime::MappedFile
 MappedFile (const path &file_path)
virtual ~MappedFile ()
bool Create (size_t capacity)
bool OpenReadOnly ()
bool OpenReadWrite ()
bool Flush ()
bool Resize (size_t capacity)
bool ShrinkToFit ()
template<class T>
T * Allocate (size_t count=1)
template<class T>
Array< T > * CreateArray (size_t array_size)
StringCreateString (const string &str)
bool CopyString (const string &src, String *dest)
size_t capacity () const
char * address () const

Member Typedef Documentation

◆ Match

using rime::Prism::Match = Darts::DoubleArray::result_pair_type

Constructor & Destructor Documentation

◆ Prism()

rime::Prism::Prism ( const path & file_path)
explicit

Member Function Documentation

◆ array_size()

size_t rime::Prism::array_size ( ) const

◆ Build()

bool rime::Prism::Build ( const Syllabary & syllabary,
const Script * script = nullptr,
uint32_t dict_file_checksum = 0,
uint32_t schema_file_checksum = 0 )

◆ CommonPrefixSearch()

void rime::Prism::CommonPrefixSearch ( const string & key,
vector< Match > * result )

◆ dict_file_checksum()

uint32_t rime::Prism::dict_file_checksum ( ) const

◆ ExpandSearch()

void rime::Prism::ExpandSearch ( const string & key,
vector< Match > * result,
size_t limit )

◆ GetValue()

bool rime::Prism::GetValue ( const string & key,
int * value ) const

◆ HasKey()

bool rime::Prism::HasKey ( const string & key)

◆ Load()

bool rime::Prism::Load ( )

◆ QuerySpelling()

SpellingAccessor rime::Prism::QuerySpelling ( SyllableId spelling_id)

◆ Save()

bool rime::Prism::Save ( )

◆ schema_file_checksum()

uint32_t rime::Prism::schema_file_checksum ( ) const

◆ trie()

Darts::DoubleArray & rime::Prism::trie ( ) const
inline

Member Data Documentation

◆ format_

double rime::Prism::format_ = 0.0
protected

◆ metadata_

prism::Metadata* rime::Prism::metadata_ = nullptr
protected

◆ spelling_map_

prism::SpellingMap* rime::Prism::spelling_map_ = nullptr
protected

◆ trie_

the<Darts::DoubleArray> rime::Prism::trie_
protected

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