File size: 855 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 38 39 40 41 42 43 44 |
//
// SentenceAlignment.h
// fuzzy-match
//
// Created by Hieu Hoang on 25/07/2012.
// Copyright 2012 __MyCompanyName__. All rights reserved.
//
#ifndef fuzzy_match_SentenceAlignment_h
#define fuzzy_match_SentenceAlignment_h
#include <sstream>
#include <vector>
#include "Vocabulary.h"
#include "util/string_stream.hh"
namespace tmmt
{
struct SentenceAlignment {
int count;
std::vector< WORD_ID > target;
std::vector< std::pair<int,int> > alignment;
SentenceAlignment() {
}
std::string getTargetString(const Vocabulary &vocab) const;
std::string getAlignmentString() const {
util::StringStream strme;
for (size_t i = 0; i < alignment.size(); ++i) {
const std::pair<int,int> &alignPair = alignment[i];
strme << alignPair.first << "-" << alignPair.second << " ";
}
return strme.str();
}
};
}
#endif
|