LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder > Class Template Reference

#include <deeplima/segmentation/impl/char_ngram_encoder.h>

Inheritance diagram for deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >:

Public Member Functions

 CharNgramEncoder ()
 
 CharNgramEncoder (const std::vector< ngram_descr_t > &ngram_descr)
 
void init (const std::vector< ngram_descr_t > &ngram_descr)
 
void reset ()
 
size_t size () const
 
uint64_t get_feat (size_t idx) const
 
uint8_t get_len () const
 
uint8_t get_len (uint8_t idx) const
 
uint8_t get_lookahead () const
 
bool ready_to_generate () const
 
bool allow_unk (uint8_t idx) const
 
uint8_t warmup (const uint8_t *str, int32_t *pos, int32_t len)
 

Protected Member Functions

void init ()
 

Protected Attributes

std::vector< ngram_descr_t > m_ngram_descr
 
uint8_t m_lookahead
 
uint8_t m_chars_to_consume
 
std::vector< typename StreamDecoder::buffer_t > m_mask
 
std::vector< uint8_t > m_shift
 

Detailed Description

template<class StreamDecoder>
class deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >

Definition at line 34 of file char_ngram_encoder.h.

Constructor & Destructor Documentation

◆ CharNgramEncoder() [1/2]

template<class StreamDecoder >
deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::CharNgramEncoder ( )
inline

Definition at line 37 of file char_ngram_encoder.h.

◆ CharNgramEncoder() [2/2]

template<class StreamDecoder >
deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::CharNgramEncoder ( const std::vector< ngram_descr_t > &  ngram_descr)
inlineexplicit

Definition at line 42 of file char_ngram_encoder.h.

Member Function Documentation

◆ allow_unk()

template<class StreamDecoder >
bool deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::allow_unk ( uint8_t  idx) const
inline

Definition at line 94 of file char_ngram_encoder.h.

◆ get_feat()

template<class StreamDecoder >
uint64_t deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::get_feat ( size_t  idx) const
inline

Definition at line 68 of file char_ngram_encoder.h.

◆ get_len() [1/2]

template<class StreamDecoder >
uint8_t deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::get_len ( ) const
inline

Definition at line 74 of file char_ngram_encoder.h.

◆ get_len() [2/2]

template<class StreamDecoder >
uint8_t deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::get_len ( uint8_t  idx) const
inline

Definition at line 79 of file char_ngram_encoder.h.

◆ get_lookahead()

template<class StreamDecoder >
uint8_t deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::get_lookahead ( ) const
inline

Definition at line 84 of file char_ngram_encoder.h.

◆ init() [1/2]

template<class StreamDecoder >
void deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::init ( )
inlineprotected

Definition at line 114 of file char_ngram_encoder.h.

◆ init() [2/2]

template<class StreamDecoder >
void deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::init ( const std::vector< ngram_descr_t > &  ngram_descr)
inline

Definition at line 50 of file char_ngram_encoder.h.

◆ ready_to_generate()

template<class StreamDecoder >
bool deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::ready_to_generate ( ) const
inline

Definition at line 89 of file char_ngram_encoder.h.

◆ reset()

template<class StreamDecoder >
void deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::reset ( )
inline

Definition at line 57 of file char_ngram_encoder.h.

◆ size()

template<class StreamDecoder >
size_t deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::size ( ) const
inline

Definition at line 63 of file char_ngram_encoder.h.

◆ warmup()

template<class StreamDecoder >
uint8_t deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::warmup ( const uint8_t *  str,
int32_t *  pos,
int32_t  len 
)
inline

Definition at line 100 of file char_ngram_encoder.h.

Member Data Documentation

◆ m_chars_to_consume

template<class StreamDecoder >
uint8_t deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::m_chars_to_consume
protected

Definition at line 171 of file char_ngram_encoder.h.

◆ m_lookahead

template<class StreamDecoder >
uint8_t deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::m_lookahead
protected

Definition at line 170 of file char_ngram_encoder.h.

◆ m_mask

template<class StreamDecoder >
std::vector<typename StreamDecoder::buffer_t> deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::m_mask
protected

Definition at line 173 of file char_ngram_encoder.h.

◆ m_ngram_descr

template<class StreamDecoder >
std::vector<ngram_descr_t> deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::m_ngram_descr
protected

Definition at line 169 of file char_ngram_encoder.h.

◆ m_shift

template<class StreamDecoder >
std::vector<uint8_t> deeplima::segmentation::impl::CharNgramEncoder< StreamDecoder >::m_shift
protected

Definition at line 174 of file char_ngram_encoder.h.


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