FST  openfst-1.8.2
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 ()
 
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 SymbolTableTextOptions &opts=SymbolTableTextOptions()) const
 
bool WriteText (const std::string &source) 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 SymbolTableTextOptions &opts=SymbolTableTextOptions())
 
static SymbolTableReadText (const std::string &source, const SymbolTableTextOptions &opts=SymbolTableTextOptions())
 
static SymbolTableRead (std::istream &strm, const std::string &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 302 of file symbol-table.h.

Member Typedef Documentation

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

Constructor & Destructor Documentation

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

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

virtual fst::SymbolTable::~SymbolTable ( )
inlinevirtual

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

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

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

Member Function Documentation

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

static SymbolTable* fst::SymbolTable::ReadText ( std::istream &  strm,
std::string_view  name,
const SymbolTableTextOptions opts = SymbolTableTextOptions() 
)
inlinestatic

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

SymbolTable * fst::SymbolTable::ReadText ( const std::string &  source,
const SymbolTableTextOptions opts = SymbolTableTextOptions() 
)
static

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

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

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

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

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

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

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

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

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

bool fst::SymbolTable::WriteText ( std::ostream &  strm,
const SymbolTableTextOptions opts = SymbolTableTextOptions() 
) const

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

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

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


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