1 #ifndef TASK_HIFST_MAKEWEIGHTS_HPP 2 #define TASK_HIFST_MAKEWEIGHTS_HPP 13 LERROR(
"MakeWeightHifst not implemented for this semiring");
22 inline Weight
operator () (
float const weight,
unsigned)
const {
40 return Weight ( weight, weight);
43 return Weight( weight.Value2(), weight.Value2() );
45 inline Weight
operator () (
float const weight,
unsigned)
const {
46 return Weight(weight, weight);
72 result.Push ( k_, weight);
76 inline Weight
operator () (
float const weight,
unsigned spi )
const {
78 result.Push ( k_ , weight);
80 result.Push( -spi - 2, 1);
97 LERROR(
"MakeWeightHifstLocalLm not implemented for this semiring");
125 return Weight ( weight, StdWeight::One());
128 return Weight(weight, StdWeight::One() );
133 return Weight( weight.Value2(), weight.Value2() );
164 LERROR(
"MakeWeightHifstLocalLm -- Index has to be bigger than 0 (constr)");
175 LERROR(
"MakeWeightHifstLocalLm -- Index has to be bigger than 0 (op)");
179 result.Push ( k_, weight);
186 LERROR(
"MakeWeightHifstLocalLm -- Index has to be bigger than 0! (op 2)");
191 result.SetDefaultValue(weight.DefaultValue());
192 for (SparseTupleWeightIterator<StdArc::Weight, int> it(weight); !it.Done(); it.Next()) {
193 if (it.Value().first != k_)
194 result.Push(it.Value());
MakeWeightHifst(const ucam::util::RegistryPO &rg)
fst::StdArc::Weight StdWeight
const std::string kHifstDisableRuleFeatures
int getLocalLmIndex(ucam::util::RegistryPO const *rg=NULL)
MakeWeightHifstLocalLm(const ucam::util::RegistryPO &rg)
Weight operator()(float const weight) const
std::string const kLmFeatureweights
MakeWeightHifstLocalLm(const ucam::util::RegistryPO &rg)
LexicographicArc< StdArc::Weight, StdArc::Weight > LexStdArc
MakeWeightHifstLocalLm(const ucam::util::RegistryPO &rg)
MakeWeightHifst(const ucam::util::RegistryPO &rg)
MakeWeightHifst(const ucam::util::RegistryPO &rg)