Download tools/mosesdecoder/moses/ChartTranslationOption.cpp from Quagmire1/wiki-cased: direct link, hf CLI and curl.
- Browser
- Download file 869 Bytes
-
https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/moses/ChartTranslationOption.cpp
- Command line
-
hf download hf://Quagmire1/wiki-cased/tools/mosesdecoder/moses/ChartTranslationOption.cpp
-
curl -L -o ChartTranslationOption.cpp https://huggingface.co/Quagmire1/wiki-cased/resolve/main/tools/mosesdecoder/moses/ChartTranslationOption.cpp
869 Bytes
| namespace Moses | |
| { | |
| ChartTranslationOption::ChartTranslationOption(const TargetPhrase &targetPhrase) | |
| :m_targetPhrase(targetPhrase) | |
| ,m_scoreBreakdown(targetPhrase.GetScoreBreakdown()) | |
| { | |
| } | |
| void ChartTranslationOption::EvaluateWithSourceContext(const InputType &input, | |
| const InputPath &inputPath, | |
| const StackVec &stackVec) | |
| { | |
| const std::vector<FeatureFunction*> &ffs = FeatureFunction::GetFeatureFunctions(); | |
| for (size_t i = 0; i < ffs.size(); ++i) { | |
| const FeatureFunction &ff = *ffs[i]; | |
| ff.EvaluateWithSourceContext(input, inputPath, m_targetPhrase, &stackVec, m_scoreBreakdown); | |
| } | |
| } | |
| std::ostream& operator<<(std::ostream &out, const ChartTranslationOption &transOpt) | |
| { | |
| out << transOpt.m_targetPhrase << " " << transOpt.m_scoreBreakdown; | |
| return out; | |
| } | |
| } | |