summaryrefslogtreecommitdiff
path: root/decoder/aligner.h
blob: 970c72f286a6efd8fc54887815404351348b5a45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef _ALIGNER_H_

#include <string>
#include <iostream>
#include <boost/shared_ptr.hpp>
#include "array2d.h"
#include "lattice.h"

class Hypergraph;

struct AlignerTools {
  static boost::shared_ptr<Array2D<bool> > ReadPharaohAlignmentGrid(const std::string& al);
  static void SerializePharaohFormat(const Array2D<bool>& alignment, std::ostream* out);

  // assumption: g contains derivations of input/ref and
  // ONLY input/ref.
  static void WriteAlignment(const std::string& input,
                             const Lattice& ref,
                             const Hypergraph& g,
                             bool map_instead_of_viterbi = true);
};

#endif