From b6eede632af4fa58a6f5325ee0d059c02a898b9f Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Sat, 24 Mar 2012 23:04:46 -0400 Subject: rename aligner, add support for distinguishing translation / transliteration --- utils/alignment_io.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 utils/alignment_io.h (limited to 'utils/alignment_io.h') diff --git a/utils/alignment_io.h b/utils/alignment_io.h new file mode 100644 index 00000000..36bcecd7 --- /dev/null +++ b/utils/alignment_io.h @@ -0,0 +1,42 @@ +#ifndef _ALIGNMENT_IO_H_ +#define _ALIGNMENT_IO_H_ + +#include +#include +#include +#include "array2d.h" + +struct AlignmentIO { + enum AlignmentType { kNONE = 0, kTRANSLATION = 1, kTRANSLITERATION = 2 }; + + static boost::shared_ptr > ReadPharaohAlignmentGrid(const std::string& al); + static void SerializePharaohFormat(const Array2D& alignment, std::ostream* out); + static void SerializeTypedAlignment(const Array2D& alignment, std::ostream* out); +}; + +inline std::ostream& operator<<(std::ostream& os, const Array2D& m) { + os << ' '; + for (int j=0; j