LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
deeplima::TStringIndex< S, U, I > Class Template Reference

#include <deeplima/utils/str_index.h>

Public Types

typedef S string_t
 
typedef U ustring_t
 
typedef I idx_t
 

Public Member Functions

idx_t get_idx (const char *p, size_t len)
 
idx_t get_idx (const string_t &str)
 
idx_t get_idx (const ustring_t &ustr)
 
const S & get_str (const idx_t idx) const
 
const U & get_ustr (const idx_t idx)
 accessor with side effect.
 
const U & get_ustr (const idx_t idx) const
 
size_t size () const
 

Protected Attributes

std::unordered_map< string_t, idx_t > m_str2idx
 
std::unordered_map< idx_t, string_t > m_idx2str
 
std::unordered_map< idx_t, ustring_t > m_idx2ustr
 
std::wstring_convert< std::codecvt_utf8< char32_t >, char32_t > m_cvt
 

Detailed Description

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
class deeplima::TStringIndex< S, U, I >

Definition at line 17 of file str_index.h.

Member Typedef Documentation

◆ idx_t

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
typedef I deeplima::TStringIndex< S, U, I >::idx_t

Definition at line 22 of file str_index.h.

◆ string_t

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
typedef S deeplima::TStringIndex< S, U, I >::string_t

Definition at line 20 of file str_index.h.

◆ ustring_t

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
typedef U deeplima::TStringIndex< S, U, I >::ustring_t

Definition at line 21 of file str_index.h.

Member Function Documentation

◆ get_idx() [1/3]

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
idx_t deeplima::TStringIndex< S, U, I >::get_idx ( const char *  p,
size_t  len 
)
inline

Definition at line 24 of file str_index.h.

◆ get_idx() [2/3]

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
idx_t deeplima::TStringIndex< S, U, I >::get_idx ( const string_t &  str)
inline

Definition at line 30 of file str_index.h.

◆ get_idx() [3/3]

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
idx_t deeplima::TStringIndex< S, U, I >::get_idx ( const ustring_t &  ustr)
inline

Definition at line 52 of file str_index.h.

◆ get_str()

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
const S & deeplima::TStringIndex< S, U, I >::get_str ( const idx_t  idx) const
inline

Definition at line 59 of file str_index.h.

◆ get_ustr() [1/2]

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
const U & deeplima::TStringIndex< S, U, I >::get_ustr ( const idx_t  idx)
inline

accessor with side effect.

Gets its result from an index or store it there before returning it

Definition at line 76 of file str_index.h.

◆ get_ustr() [2/2]

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
const U & deeplima::TStringIndex< S, U, I >::get_ustr ( const idx_t  idx) const
inline

Definition at line 95 of file str_index.h.

◆ size()

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
size_t deeplima::TStringIndex< S, U, I >::size ( ) const
inline

Definition at line 106 of file str_index.h.

Member Data Documentation

◆ m_cvt

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
std::wstring_convert<std::codecvt_utf8<char32_t>, char32_t> deeplima::TStringIndex< S, U, I >::m_cvt
protected

Definition at line 116 of file str_index.h.

◆ m_idx2str

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
std::unordered_map<idx_t, string_t> deeplima::TStringIndex< S, U, I >::m_idx2str
protected

Definition at line 113 of file str_index.h.

◆ m_idx2ustr

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
std::unordered_map<idx_t, ustring_t> deeplima::TStringIndex< S, U, I >::m_idx2ustr
mutableprotected

Definition at line 114 of file str_index.h.

◆ m_str2idx

template<typename S = std::string, typename U = std::u32string, typename I = uint32_t>
std::unordered_map<string_t, idx_t> deeplima::TStringIndex< S, U, I >::m_str2idx
protected

Definition at line 112 of file str_index.h.


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