summaryrefslogtreecommitdiff
path: root/extractor/alignment.h
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2013-06-24 14:40:07 +0200
committerPatrick Simianer <p@simianer.de>2013-06-24 14:40:07 +0200
commite547ab5f765c72ad326b1d3a79f26bb221364d7d (patch)
treee205609de0adce98bdf4ec4e799cd776cebe8b72 /extractor/alignment.h
parentbecb1347773ebaae8cab2669afe4bad048cda992 (diff)
parent5794c0109902cf19a52cc8f1799353270ed9d85d (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'extractor/alignment.h')
-rw-r--r--extractor/alignment.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/extractor/alignment.h b/extractor/alignment.h
index 4596f92b..dc5a8b55 100644
--- a/extractor/alignment.h
+++ b/extractor/alignment.h
@@ -5,6 +5,10 @@
#include <vector>
#include <boost/filesystem.hpp>
+#include <boost/serialization/serialization.hpp>
+#include <boost/serialization/split_member.hpp>
+#include <boost/serialization/utility.hpp>
+#include <boost/serialization/vector.hpp>
namespace fs = boost::filesystem;
using namespace std;
@@ -19,18 +23,23 @@ class Alignment {
// Reads alignment from text file.
Alignment(const string& filename);
+ // Creates empty alignment.
+ Alignment();
+
// Returns the alignment for a given sentence.
virtual vector<pair<int, int>> GetLinks(int sentence_index) const;
- // Writes alignment to file in binary format.
- void WriteBinary(const fs::path& filepath);
-
virtual ~Alignment();
- protected:
- Alignment();
+ bool operator==(const Alignment& alignment) const;
private:
+ friend class boost::serialization::access;
+
+ template<class Archive> void serialize(Archive& ar, unsigned int) {
+ ar & alignments;
+ }
+
vector<vector<pair<int, int>>> alignments;
};