mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 04:27:53 +03:00
42 lines
634 B
C++
42 lines
634 B
C++
/*
|
|
* Weights.h
|
|
*
|
|
* Created on: 24 Oct 2015
|
|
* Author: hieu
|
|
*/
|
|
#pragma once
|
|
|
|
#include <iostream>
|
|
#include <vector>
|
|
#include "TypeDef.h"
|
|
|
|
namespace Moses2
|
|
{
|
|
|
|
class FeatureFunctions;
|
|
|
|
class Weights
|
|
{
|
|
public:
|
|
Weights();
|
|
virtual ~Weights();
|
|
void Init(const FeatureFunctions &ffs);
|
|
|
|
SCORE operator[](size_t ind) const
|
|
{
|
|
return m_weights[ind];
|
|
}
|
|
|
|
std::ostream &Debug(std::ostream &out, const System &system) const;
|
|
|
|
void CreateFromString(const FeatureFunctions &ffs, const std::string &line);
|
|
|
|
std::vector<SCORE> GetWeights(const FeatureFunction &ff) const;
|
|
|
|
protected:
|
|
std::vector<SCORE> m_weights;
|
|
};
|
|
|
|
}
|
|
|