Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ChartTranslationOption.h « moses - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0b902f811c5a9aef08b28be7fb35d54b8adf2d13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#pragma once

#include "ScoreComponentCollection.h"

namespace Moses
{
class TargetPhrase;
class InputPath;
class InputType;
class StackVec;

class ChartTranslationOption
{
  friend std::ostream& operator<<(std::ostream&, const ChartTranslationOption&);

protected:
  const TargetPhrase &m_targetPhrase;
  ScoreComponentCollection m_scoreBreakdown;
  const InputPath *m_inputPath;
  const std::vector<const Word*> *m_ruleSourceFromInputPath; // used by placeholders

public:
  ChartTranslationOption(const TargetPhrase &targetPhrase);

  const TargetPhrase &GetPhrase() const {
    return m_targetPhrase;
  }

  const InputPath *GetInputPath() const {
    return m_inputPath;
  }

  void SetInputPath(const InputPath *inputPath) {
    m_inputPath = inputPath;
  }

  const std::vector<const Word*> *GetSourceRuleFromInputPath() const {
    return m_ruleSourceFromInputPath;
  }
  void SetSourceRuleFromInputPath(const std::vector<const Word*> *obj) {
    m_ruleSourceFromInputPath = obj;
  }

  const ScoreComponentCollection &GetScores() const {
    return m_scoreBreakdown;
  }

  void EvaluateWithSourceContext(const InputType &input,
                                 const InputPath &inputPath,
                                 const StackVec &stackVec);
};

}