15 #ifndef TROPICALSPARSETUPLEWEIGHT_MAKEWEIGHT_H_ 16 #define TROPICALSPARSETUPLEWEIGHT_MAKEWEIGHT_H_ 28 template<
typename Arc = StdArc>
37 result.Push ( k + 1, w.Value() );
55 result.Push ( k + 1, w.Value1().Value() );
71 inline TupleArc32::Weight
operator () (
const float weight )
const {
73 result.Push ( k_ + 1, weight );
77 inline TupleArc32::Weight
operator () (
const TupleArc32::Weight& weight )
MakeSparseVectorWeight(int32_t k)
Templated Functor to generate a sparse vector weight from any other representation.
Implements Tropical Sparse tuple weight semiring, extending from openfst SparsePowerWeight class...
Templated functor that creates a weight given a float.
void update()
Increases index. Provides a way to do sequentially transparent operations, e.g. language model compos...
TropicalSparseTupleWeight< float > operator()(const typename Arc::Weight &w) const
LexicographicArc< StdArc::Weight, StdArc::Weight > LexStdArc
MakeSparseVectorWeight(int32_t k)
MakeWeight(int32_t k=0)
It is specially important that k defaults to 0 in this case, as MakeWeight is used by applylanguagemo...