File size: 808 Bytes
158b61b |
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 |
#pragma once
#include <ostream>
#include "moses/Syntax/KBestExtractor.h"
#include "moses/Word.h"
namespace Moses
{
namespace Syntax
{
struct SHyperedge;
namespace F2S
{
// Writes a string representation of a derivation to a std::ostream. This is
// used by the -translation-details / -T option.
// TODO Merge this with S2T::DerivationWriter.
class DerivationWriter
{
public:
// 1-best version.
static void Write(const SHyperedge&, std::size_t, std::ostream &);
// k-best version.
static void Write(const KBestExtractor::Derivation &, std::size_t,
std::ostream &);
private:
static void WriteLine(const SHyperedge &, std::size_t, std::ostream &);
static void WriteSymbol(const Word &, std::ostream &);
};
} // namespace F2S
} // namespace Syntax
} // namespace Moses
|