librime: rime::Prism Class Reference

| librime 1.2 Rime Input Method Engine, the core library

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

`#include <prism.h>`

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

## 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::DoubleArray & | trie () const
Public Member Functions inherited from rime::MappedFile
| MappedFile (const MappedFile &)=delete
MappedFile & | operator= (const MappedFile &)=delete
bool | Exists () const
bool | IsOpen () const
void | Close ()
bool | Remove ()
template<class T>
T * | Find (size_t offset)
const path & | file_path () const
size_t | file_size () const

## Protected Attributes
the< Darts::DoubleArray > | trie_
prism::Metadata * | metadata_ = nullptr
prism::SpellingMap * | spelling_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)
String * | CreateString (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:

- prism.h
- prism.cc