FST  openfst-1.8.1
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 (const std::string &name="<unspecified>")
 
virtual ~SymbolTable ()
 
virtual SymbolTableCopy () const
 
void AddTable (const SymbolTable &table)
 
int64 AddSymbol (std::string_view symbol, int64 key)
 
int64 AddSymbol (std::string_view symbol)
 
int64 AvailableKey () const
 
const std::string & CheckSum () const
 
int64 GetNthKey (ssize_t pos) const
 
std::string Find (int64 key) const
 
int64 Find (std::string_view symbol) const
 
const std::string & LabeledCheckSum () const
 
bool Member (int64 key) const
 
bool Member (std::string_view symbol) const
 
const std::string & Name () const
 
size_t NumSymbols () const
 
void RemoveSymbol (int64 key)
 
void SetName (const std::string &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, const std::string &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 299 of file symbol-table.h.

Member Typedef Documentation

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

Constructor & Destructor Documentation

fst::SymbolTable::SymbolTable ( const std::string &  name = "<unspecified>")
inlineexplicit

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

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

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

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

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

Member Function Documentation

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

void fst::SymbolTable::SetName ( const std::string &  new_name)
inline

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

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

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

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

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

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

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

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

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


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