|
libime
|
This is a trie based on cedar<www.tkl.iis.u-tokyo.ac.jp/~ynaga/cedar/>. More...
#include <libime/core/datrie.h>
Public Member Functions | |
| DATrie (const char *filename) | |
| DATrie (std::istream &in) | |
| void | load (std::istream &in) |
| void | save (const char *filename) |
| void | save (std::ostream &stream) |
| size_t | size () const |
| bool | empty () const |
| void | suffix (std::string &s, size_t len, position_type pos) const |
| value_type | exactMatchSearch (const char *key, size_t len) const |
| value_type | exactMatchSearch (std::string_view key) const |
| int32_t | exactMatchSearchRaw (const char *key, size_t len) const |
| int32_t | exactMatchSearchRaw (std::string_view key) const |
| bool | hasExactMatch (std::string_view key) const |
| DATrie< T >::value_type | traverse (std::string_view key, position_type &from) const |
| DATrie< T >::value_type | traverse (const char *key, size_t len, position_type &from) const |
| int32_t | traverseRaw (std::string_view key, position_type &from) const |
| int32_t | traverseRaw (const char *key, size_t len, position_type &from) const |
| void | set (std::string_view key, value_type val) |
| void | set (const char *key, size_t len, value_type val) |
| void | update (std::string_view key, updater_type updater) |
| void | update (const char *key, size_t len, updater_type updater) |
| void | dump (value_type *data, std::size_t size) const |
| void | dump (std::vector< value_type > &data) const |
| void | dump (std::vector< std::tuple< value_type, size_t, position_type >> &data) const |
| bool | erase (std::string_view key, position_type from=0) |
| bool | erase (const char *key, size_t len, position_type from=0) |
| bool | erase (position_type from=0) |
| bool | foreach (callback_type func, position_type pos=0) const |
| bool | foreach (const char *prefix, size_t size, callback_type func, position_type pos=0) const |
| bool | foreach (std::string_view prefix, callback_type func, position_type pos=0) const |
| void | clear () |
| void | shrink_tail () |
| size_t | mem_size () const |
This is a trie based on cedar<www.tkl.iis.u-tokyo.ac.jp/~ynaga/cedar/>.
comparing with original version, this version takes care of endianness when doing serialization, and handle the possible unaligned memory access on some platform.
It also exploits the C++11 feature which can let you implement update easily with lambda, comparing with the original version's add/set.
1.8.13