libime
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
libime::TrieDictionary Class Reference
Inheritance diagram for libime::TrieDictionary:
Inheritance graph
[legend]
Collaboration diagram for libime::TrieDictionary:
Collaboration graph
[legend]

Public Types

using TrieType = DATrie< float >
 

Public Member Functions

void addEmptyDict ()
 
void removeAll ()
 
void removeFrom (size_t idx)
 Remove all dictionary from given index. More...
 
void clear (size_t idx)
 
const TrieTypetrie (size_t idx) const
 
void setTrie (size_t idx, TrieType trie)
 Set trie from external source. More...
 
size_t dictSize () const
 
 FCITX_DECLARE_SIGNAL (TrieDictionary, dictionaryChanged, void(size_t))
 
 FCITX_DECLARE_SIGNAL (TrieDictionary, dictSizeChanged, void(size_t))
 
- Public Member Functions inherited from libime::Dictionary
void matchPrefix (const SegmentGraph &graph, const GraphMatchCallback &callback, const std::unordered_set< const SegmentGraphNode *> &ignore={}, void *helper=nullptr) const
 

Static Public Attributes

static const size_t SystemDict = 0
 
static const size_t UserDict = 1
 

Protected Member Functions

TrieTypemutableTrie (size_t idx)
 
void addWord (size_t idx, std::string_view key, float cost=0.0F)
 
bool removeWord (size_t idx, std::string_view key)
 
 FCITX_DECLARE_PRIVATE (TrieDictionary)
 
- Protected Member Functions inherited from libime::Dictionary
virtual void matchPrefixImpl (const SegmentGraph &graph, const GraphMatchCallback &callback, const std::unordered_set< const SegmentGraphNode *> &ignore, void *helper) const =0
 

Protected Attributes

std::unique_ptr< TrieDictionaryPrivated_ptr
 

Detailed Description

Definition at line 23 of file triedictionary.h.

Member Function Documentation

◆ removeFrom()

void libime::TrieDictionary::removeFrom ( size_t  idx)

Remove all dictionary from given index.

Parameters
idxthe index need to be within [UserDict + 1, dictSize())
Since
1.0.10

Definition at line 43 of file triedictionary.cpp.

◆ setTrie()

void libime::TrieDictionary::setTrie ( size_t  idx,
TrieType  trie 
)

Set trie from external source.

There is no validation on the data within it, subclass may expect a certain way of organize the key and value.

Parameters
idxthe index need to be within [0, dictSize())
trienew trie.
Since
1.1.7

Definition at line 69 of file triedictionary.cpp.


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