2012-05-07 17:59:37 +04:00
|
|
|
#pragma once
|
|
|
|
|
2012-05-07 18:41:18 +04:00
|
|
|
#include <iosfwd>
|
2010-10-21 13:49:27 +04:00
|
|
|
|
2012-05-07 18:41:18 +04:00
|
|
|
class Alignment;
|
|
|
|
class SuffixArray;
|
|
|
|
class TargetCorpus;
|
2010-10-21 13:49:27 +04:00
|
|
|
|
|
|
|
class PhrasePair
|
|
|
|
{
|
|
|
|
public:
|
2011-02-24 16:57:11 +03:00
|
|
|
typedef unsigned int INDEX;
|
2010-10-21 13:49:27 +04:00
|
|
|
|
|
|
|
private:
|
2011-02-24 16:57:11 +03:00
|
|
|
SuffixArray *m_suffixArray;
|
|
|
|
TargetCorpus *m_targetCorpus;
|
|
|
|
Alignment *m_alignment;
|
|
|
|
INDEX m_sentence_id;
|
|
|
|
char m_target_length;
|
2012-05-07 18:41:18 +04:00
|
|
|
INDEX m_source_position;
|
2011-02-24 16:57:11 +03:00
|
|
|
char m_source_start, m_source_end;
|
|
|
|
char m_target_start, m_target_end;
|
|
|
|
char m_start_null, m_end_null;
|
|
|
|
char m_pre_null, m_post_null;
|
2010-10-21 13:49:27 +04:00
|
|
|
|
|
|
|
public:
|
2011-02-24 16:57:11 +03:00
|
|
|
PhrasePair( SuffixArray *sa, TargetCorpus *tc, Alignment *a, INDEX sentence_id, char target_length, INDEX position, char source_start, char source_end, char target_start, char target_end, char start_null, char end_null, char pre_null, char post_null)
|
|
|
|
:m_suffixArray(sa)
|
|
|
|
,m_targetCorpus(tc)
|
|
|
|
,m_alignment(a)
|
|
|
|
,m_sentence_id(sentence_id)
|
|
|
|
,m_target_length(target_length)
|
2012-05-07 16:45:30 +04:00
|
|
|
,m_source_position(position)
|
2011-02-24 16:57:11 +03:00
|
|
|
,m_source_start(source_start)
|
|
|
|
,m_source_end(source_end)
|
|
|
|
,m_target_start(target_start)
|
|
|
|
,m_target_end(target_end)
|
|
|
|
,m_start_null(start_null)
|
|
|
|
,m_end_null(end_null)
|
|
|
|
,m_pre_null(pre_null)
|
2013-06-10 21:11:55 +04:00
|
|
|
,m_post_null(post_null) {
|
|
|
|
}
|
2011-02-24 16:57:11 +03:00
|
|
|
~PhrasePair () {}
|
|
|
|
|
2012-05-07 19:58:44 +04:00
|
|
|
void PrintTarget( std::ostream* out ) const;
|
2013-04-05 14:26:00 +04:00
|
|
|
void Print( std::ostream* out ) const;
|
|
|
|
void PrintPretty( std::ostream* out, int width ) const;
|
2012-05-07 19:58:44 +04:00
|
|
|
void PrintHTML( std::ostream* out ) const;
|
|
|
|
void PrintClippedHTML( std::ostream* out, int width ) const;
|
2010-10-21 13:49:27 +04:00
|
|
|
};
|