Public Types | Public Member Functions | Static Public Member Functions | Friends

fst::StringWeight< L, S > Class Template Reference

String semiring: (longest_common_prefix/suffix, ., Infinity, Epsilon). More...

#include <fst/string-weight.h>

Collaboration diagram for fst::StringWeight< L, S >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef L Label
typedef StringWeight< L,
REVERSE_STRING_TYPE(S)> 
ReverseWeight

Public Member Functions

 StringWeight ()
template<typename Iter >
 StringWeight (const Iter &begin, const Iter &end)
 StringWeight (L l)
bool Member () const
istream & Read (istream &strm)
ostream & Write (ostream &strm) const
size_t Hash () const
StringWeight< L, S > Quantize (float delta=kDelta) const
ReverseWeight Reverse () const
void Init ()
 Common initializer among constructors.
void Clear ()
 Clear existing StringWeight.
size_t Size () const
void PushFront (L l)
void PushBack (L l)

Static Public Member Functions

static const StringWeight< L, S > & Zero ()
static const StringWeight< L, S > & One ()
static const string & Type ()
static uint64 Properties ()

Friends

class StringWeightIterator< L, S >
class StringWeightReverseIterator< L, S >
bool operator== (const StringWeight< L, S > &, const StringWeight< L, S > &)

Detailed Description

template<typename L, StringType S>
class fst::StringWeight< L, S >

String semiring: (longest_common_prefix/suffix, ., Infinity, Epsilon).

Definition at line 65 of file string-weight.h.


Member Typedef Documentation

template<typename L, StringType S>
typedef L fst::StringWeight< L, S >::Label

Definition at line 67 of file string-weight.h.

template<typename L, StringType S>
typedef StringWeight<L, REVERSE_STRING_TYPE(S)> fst::StringWeight< L, S >::ReverseWeight

Definition at line 68 of file string-weight.h.


Constructor & Destructor Documentation

template<typename L, StringType S>
fst::StringWeight< L, S >::StringWeight (  )  [inline]

Definition at line 75 of file string-weight.h.

template<typename L, StringType S>
template<typename Iter >
fst::StringWeight< L, S >::StringWeight ( const Iter &  begin,
const Iter &  end 
) [inline]

Definition at line 78 of file string-weight.h.

template<typename L, StringType S>
fst::StringWeight< L, S >::StringWeight ( l  )  [inline, explicit]

Definition at line 84 of file string-weight.h.


Member Function Documentation

template<typename L, StringType S>
void fst::StringWeight< L, S >::Clear (  )  [inline]

Clear existing StringWeight.

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

template<typename L , StringType S>
size_t fst::StringWeight< L, S >::Hash (  )  const [inline]

Definition at line 270 of file string-weight.h.

template<typename L, StringType S>
void fst::StringWeight< L, S >::Init (  )  [inline]

Common initializer among constructors.

NB: This needs to be uncommented only if default fails for this impl. StringWeight<L, S> &operator=(const StringWeight<L, S> &w); These operations combined with the StringWeightIterator and StringWeightReverseIterator provide the access and mutation of the string internal elements.

Definition at line 132 of file string-weight.h.

template<typename L , StringType S>
bool fst::StringWeight< L, S >::Member (  )  const [inline]

Definition at line 253 of file string-weight.h.

template<typename L, StringType S>
static const StringWeight<L, S>& fst::StringWeight< L, S >::One (  )  [inline, static]

Definition at line 91 of file string-weight.h.

template<typename L, StringType S>
static uint64 fst::StringWeight< L, S >::Properties (  )  [inline, static]

Definition at line 119 of file string-weight.h.

template<typename L, StringType S>
void fst::StringWeight< L, S >::PushBack ( l  )  [inline]

Definition at line 145 of file string-weight.h.

template<typename L, StringType S>
void fst::StringWeight< L, S >::PushFront ( l  )  [inline]

Definition at line 139 of file string-weight.h.

template<typename L, StringType S>
StringWeight<L, S> fst::StringWeight< L, S >::Quantize ( float  delta = kDelta  )  const [inline]

Definition at line 113 of file string-weight.h.

template<typename L , StringType S>
istream & fst::StringWeight< L, S >::Read ( istream &  strm  )  [inline]

StringWeight member functions follow that require StringWeightIterator or StringWeightReverseIterator.

Definition at line 229 of file string-weight.h.

template<typename L , StringType S>
StringWeight< L, S >::ReverseWeight fst::StringWeight< L, S >::Reverse (  )  const [inline]

Definition at line 262 of file string-weight.h.

template<typename L, StringType S>
size_t fst::StringWeight< L, S >::Size (  )  const [inline]

Definition at line 137 of file string-weight.h.

template<typename L, StringType S>
static const string& fst::StringWeight< L, S >::Type ( void   )  [inline, static]

Definition at line 96 of file string-weight.h.

template<typename L , StringType S>
ostream & fst::StringWeight< L, S >::Write ( ostream &  strm  )  const [inline]

Definition at line 242 of file string-weight.h.

template<typename L, StringType S>
static const StringWeight<L, S>& fst::StringWeight< L, S >::Zero (  )  [inline, static]

Definition at line 86 of file string-weight.h.


Friends And Related Function Documentation

template<typename L, StringType S>
bool operator== ( const StringWeight< L, S > &  w1,
const StringWeight< L, S > &  w2 
) [friend]

NB: This needs to be uncommented only if default fails for this the impl.

template <typename L, StringType S> inline StringWeight<L, S> &StringWeight<L, S>::operator=(const StringWeight<L, S> &w) { if (this != &w) { Clear(); for (StringWeightIterator<L, S> iter(w); !iter.Done(); iter.Next()) PushBack(iter.Value()); } return *this; }

Definition at line 291 of file string-weight.h.

template<typename L, StringType S>
friend class StringWeightIterator< L, S > [friend]

Definition at line 70 of file string-weight.h.

template<typename L, StringType S>
friend class StringWeightReverseIterator< L, S > [friend]

Definition at line 71 of file string-weight.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines