diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2012-08-12 23:33:21 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2012-08-12 23:33:21 -0400 |
commit | b6e70b420ed993ee73f71058d04b382147896068 (patch) | |
tree | f46854c2cf037df209ca5dc9064a67c35db25acd /extools/sentence_pair.h | |
parent | 8294cf0992815ffd791a5ef9e74f32fea6efeb9a (diff) |
use new union api
Diffstat (limited to 'extools/sentence_pair.h')
-rw-r--r-- | extools/sentence_pair.h | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/extools/sentence_pair.h b/extools/sentence_pair.h deleted file mode 100644 index a05275e7..00000000 --- a/extools/sentence_pair.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef _SENTENCE_PAIR_H_ -#define _SENTENCE_PAIR_H_ - -#include <map> -#include <utility> -#include <vector> -#include <boost/tuple/tuple.hpp> -#include "wordid.h" -#include "array2d.h" - -// represents a parallel sentence with a word alignment and category -// annotations over subspans (currently in terms of f) -// you should read one using ParseInputLine and then use the public -// member variables to query things about it -struct AnnotatedParallelSentence { - // read annotated parallel sentence from string - void ParseInputLine(const char* buf); - - std::vector<WordID> f, e; // words in f and e - - // word alignment information - std::vector<int> e_aligned, f_aligned; // counts the number of times column/row x is aligned - Array2D<bool> aligned; - std::vector<std::vector<std::pair<short, short> > > aligns_by_fword; - - // span type information - std::map< boost::tuple<short,short,short,short>, std::vector<WordID> > span_types; - // span_types(i,j,k,l) is the list of category span (i,j) in source and (k,l) in the target language. - - int f_len, e_len; - - void Align(const short a, const short b); - void AllocateForAlignment(); - - static int ReadAlignmentPoint(const char* buf, int start, int end, bool permit_col, short* a, short* b, short* c, short* d); - - private: - void Reset(); - void ParseAlignmentPoint(const char* buf, int start, int end); - void ParseSpanLabel(const char* buf, int start, int end); -}; - -#endif |