FST  openfst-1.8.3
OpenFst Library
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
fst::script::WeightClass Class Reference

#include <weight-class.h>

Public Member Functions

 WeightClass ()=default
 
template<class W >
 WeightClass (const W &weight)
 
template<class W >
 WeightClass (const WeightClassImpl< W > &impl)
 
 WeightClass (std::string_view weight_type, std::string_view weight_str)
 
 WeightClass (const WeightClass &other)
 
WeightClassoperator= (const WeightClass &other)
 
template<class W >
const W * GetWeight () const
 
std::string ToString () const
 
const std::string & Type () const
 
bool Member () const
 

Static Public Member Functions

static WeightClass Zero (std::string_view weight_type)
 
static WeightClass One (std::string_view weight_type)
 
static WeightClass NoWeight (std::string_view weight_type)
 
static bool WeightTypesMatch (const WeightClass &lhs, const WeightClass &rhs, std::string_view op_name)
 

Static Public Attributes

static constexpr std::string_view __ZERO__ = "__ZERO__"
 
static constexpr std::string_view __ONE__ = "__ONE__"
 
static constexpr std::string_view __NOWEIGHT__ = "__NOWEIGHT__"
 

Friends

bool operator== (const WeightClass &lhs, const WeightClass &rhs)
 
WeightClass Plus (const WeightClass &lhs, const WeightClass &rhs)
 
WeightClass Times (const WeightClass &lhs, const WeightClass &rhs)
 
WeightClass Divide (const WeightClass &lhs, const WeightClass &rhs)
 
WeightClass Power (const WeightClass &w, size_t n)
 
std::ostream & operator<< (std::ostream &o, const WeightClass &c)
 

Detailed Description

Definition at line 111 of file weight-class.h.

Constructor & Destructor Documentation

fst::script::WeightClass::WeightClass ( )
default
template<class W >
fst::script::WeightClass::WeightClass ( const W &  weight)
inlineexplicit

Definition at line 116 of file weight-class.h.

template<class W >
fst::script::WeightClass::WeightClass ( const WeightClassImpl< W > &  impl)
inlineexplicit

Definition at line 120 of file weight-class.h.

fst::script::WeightClass::WeightClass ( std::string_view  weight_type,
std::string_view  weight_str 
)

Definition at line 37 of file weight-class.cc.

fst::script::WeightClass::WeightClass ( const WeightClass other)
inline

Definition at line 125 of file weight-class.h.

Member Function Documentation

template<class W >
const W* fst::script::WeightClass::GetWeight ( ) const
inline

Definition at line 144 of file weight-class.h.

bool fst::script::WeightClass::Member ( ) const
inline

Definition at line 161 of file weight-class.h.

WeightClass fst::script::WeightClass::NoWeight ( std::string_view  weight_type)
static

Definition at line 57 of file weight-class.cc.

WeightClass fst::script::WeightClass::One ( std::string_view  weight_type)
static

Definition at line 53 of file weight-class.cc.

WeightClass& fst::script::WeightClass::operator= ( const WeightClass other)
inline

Definition at line 128 of file weight-class.h.

std::string fst::script::WeightClass::ToString ( ) const
inline

Definition at line 153 of file weight-class.h.

const std::string& fst::script::WeightClass::Type ( ) const
inline

Definition at line 155 of file weight-class.h.

bool fst::script::WeightClass::WeightTypesMatch ( const WeightClass lhs,
const WeightClass rhs,
std::string_view  op_name 
)
static

Definition at line 61 of file weight-class.cc.

WeightClass fst::script::WeightClass::Zero ( std::string_view  weight_type)
static

Definition at line 49 of file weight-class.cc.

Friends And Related Function Documentation

WeightClass Divide ( const WeightClass lhs,
const WeightClass rhs 
)
friend

Definition at line 108 of file weight-class.cc.

std::ostream& operator<< ( std::ostream &  o,
const WeightClass c 
)
friend

Definition at line 126 of file weight-class.cc.

bool operator== ( const WeightClass lhs,
const WeightClass rhs 
)
friend

Definition at line 72 of file weight-class.cc.

WeightClass Plus ( const WeightClass lhs,
const WeightClass rhs 
)
friend

Definition at line 86 of file weight-class.cc.

WeightClass Power ( const WeightClass w,
size_t  n 
)
friend

Definition at line 119 of file weight-class.cc.

WeightClass Times ( const WeightClass lhs,
const WeightClass rhs 
)
friend

Definition at line 97 of file weight-class.cc.

Member Data Documentation

constexpr std::string_view fst::script::WeightClass::__NOWEIGHT__ = "__NOWEIGHT__"
static

Definition at line 135 of file weight-class.h.

constexpr std::string_view fst::script::WeightClass::__ONE__ = "__ONE__"
static

Definition at line 134 of file weight-class.h.

constexpr std::string_view fst::script::WeightClass::__ZERO__ = "__ZERO__"
static

Definition at line 133 of file weight-class.h.


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