FST  openfst-1.8.3
OpenFst Library
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
fst::SymbolTable Class Reference

#include <symbol-table.h>

Classes

class  iterator
 

Public Types

using const_iterator = iterator
 

Public Member Functions

 SymbolTable (std::string_view name="<unspecified>")
 
virtual ~SymbolTable ()=default
 
virtual SymbolTableCopy () const
 
void AddTable (const SymbolTable &table)
 
int64_t AddSymbol (std::string_view symbol, int64_t key)
 
int64_t AddSymbol (std::string_view symbol)
 
int64_t AvailableKey () const
 
const std::string & CheckSum () const
 
int64_t GetNthKey (ssize_t pos) const
 
std::string Find (int64_t key) const
 
int64_t Find (std::string_view symbol) const
 
const std::string & LabeledCheckSum () const
 
bool Member (int64_t key) const
 
bool Member (std::string_view symbol) const
 
const std::string & Name () const
 
size_t NumSymbols () const
 
void RemoveSymbol (int64_t key)
 
void SetName (std::string_view new_name)
 
bool Write (std::ostream &strm) const
 
bool Write (const std::string &source) const
 
bool WriteText (std::ostream &strm, const std::string &sep=FST_FLAGS_fst_field_separator) const
 
bool WriteText (const std::string &sink, const std::string &sep=FST_FLAGS_fst_field_separator) const
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 

Static Public Member Functions

static SymbolTableReadText (std::istream &strm, std::string_view name, const std::string &sep=FST_FLAGS_fst_field_separator)
 
static SymbolTableReadText (const std::string &source, const std::string &sep=FST_FLAGS_fst_field_separator)
 
static SymbolTableRead (std::istream &strm, std::string_view source)
 
static SymbolTableRead (const std::string &source)
 

Protected Member Functions

 SymbolTable (std::shared_ptr< internal::SymbolTableImplBase > impl)
 
template<class T = internal::SymbolTableImplBase>
const T * Impl () const
 
template<class T = internal::SymbolTableImplBase>
T * MutableImpl ()
 

Detailed Description

Definition at line 306 of file symbol-table.h.

Member Typedef Documentation

Definition at line 371 of file symbol-table.h.

Constructor & Destructor Documentation

fst::SymbolTable::SymbolTable ( std::string_view  name = "<unspecified>")
inlineexplicit

Definition at line 374 of file symbol-table.h.

virtual fst::SymbolTable::~SymbolTable ( )
virtualdefault
fst::SymbolTable::SymbolTable ( std::shared_ptr< internal::SymbolTableImplBase impl)
inlineexplicitprotected

Definition at line 509 of file symbol-table.h.

Member Function Documentation

int64_t fst::SymbolTable::AddSymbol ( std::string_view  symbol,
int64_t  key 
)
inline

Definition at line 425 of file symbol-table.h.

int64_t fst::SymbolTable::AddSymbol ( std::string_view  symbol)
inline

Definition at line 432 of file symbol-table.h.

void fst::SymbolTable::AddTable ( const SymbolTable table)
inline

Definition at line 418 of file symbol-table.h.

int64_t fst::SymbolTable::AvailableKey ( ) const
inline

Definition at line 439 of file symbol-table.h.

const_iterator fst::SymbolTable::begin ( ) const
inline

Definition at line 500 of file symbol-table.h.

const_iterator fst::SymbolTable::cbegin ( ) const
inline

Definition at line 504 of file symbol-table.h.

const_iterator fst::SymbolTable::cend ( ) const
inline

Definition at line 506 of file symbol-table.h.

const std::string& fst::SymbolTable::CheckSum ( ) const
inline

Definition at line 444 of file symbol-table.h.

virtual SymbolTable* fst::SymbolTable::Copy ( ) const
inlinevirtual

Definition at line 411 of file symbol-table.h.

const_iterator fst::SymbolTable::end ( ) const
inline

Definition at line 502 of file symbol-table.h.

std::string fst::SymbolTable::Find ( int64_t  key) const
inline

Definition at line 450 of file symbol-table.h.

int64_t fst::SymbolTable::Find ( std::string_view  symbol) const
inline

Definition at line 454 of file symbol-table.h.

int64_t fst::SymbolTable::GetNthKey ( ssize_t  pos) const
inline

Definition at line 446 of file symbol-table.h.

template<class T = internal::SymbolTableImplBase>
const T* fst::SymbolTable::Impl ( ) const
inlineprotected

Definition at line 513 of file symbol-table.h.

const std::string& fst::SymbolTable::LabeledCheckSum ( ) const
inline

Definition at line 457 of file symbol-table.h.

bool fst::SymbolTable::Member ( int64_t  key) const
inline

Definition at line 461 of file symbol-table.h.

bool fst::SymbolTable::Member ( std::string_view  symbol) const
inline

Definition at line 463 of file symbol-table.h.

template<class T = internal::SymbolTableImplBase>
T* fst::SymbolTable::MutableImpl ( )
inlineprotected

Definition at line 518 of file symbol-table.h.

const std::string& fst::SymbolTable::Name ( ) const
inline

Definition at line 466 of file symbol-table.h.

size_t fst::SymbolTable::NumSymbols ( ) const
inline

Definition at line 470 of file symbol-table.h.

static SymbolTable* fst::SymbolTable::Read ( std::istream &  strm,
std::string_view  source 
)
inlinestatic

Definition at line 395 of file symbol-table.h.

static SymbolTable* fst::SymbolTable::Read ( const std::string &  source)
inlinestatic

Definition at line 401 of file symbol-table.h.

static SymbolTable* fst::SymbolTable::ReadText ( std::istream &  strm,
std::string_view  name,
const std::string &  sep = FST_FLAGS_fst_field_separator 
)
inlinestatic

Definition at line 381 of file symbol-table.h.

SymbolTable * fst::SymbolTable::ReadText ( const std::string &  source,
const std::string &  sep = FST_FLAGS_fst_field_separator 
)
static

Definition at line 346 of file symbol-table.cc.

void fst::SymbolTable::RemoveSymbol ( int64_t  key)
inline

Definition at line 472 of file symbol-table.h.

void fst::SymbolTable::SetName ( std::string_view  new_name)
inline

Definition at line 478 of file symbol-table.h.

bool fst::SymbolTable::Write ( std::ostream &  strm) const
inline

Definition at line 483 of file symbol-table.h.

bool fst::SymbolTable::Write ( const std::string &  source) const

Definition at line 356 of file symbol-table.cc.

bool fst::SymbolTable::WriteText ( std::ostream &  strm,
const std::string &  sep = FST_FLAGS_fst_field_separator 
) const

Definition at line 374 of file symbol-table.cc.

bool fst::SymbolTable::WriteText ( const std::string &  sink,
const std::string &  sep = FST_FLAGS_fst_field_separator 
) const

Definition at line 383 of file symbol-table.cc.


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