2012-05-07 17:59:37 +04:00
|
|
|
#pragma once
|
|
|
|
|
2012-05-07 19:03:56 +04:00
|
|
|
#include <iosfwd>
|
2011-06-22 01:52:13 +04:00
|
|
|
|
2012-05-07 19:03:56 +04:00
|
|
|
class Alignment;
|
|
|
|
class SuffixArray;
|
|
|
|
class TargetCorpus;
|
2011-06-22 01:52:13 +04:00
|
|
|
|
|
|
|
class Mismatch
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef unsigned int INDEX;
|
|
|
|
|
|
|
|
private:
|
|
|
|
SuffixArray *m_suffixArray;
|
|
|
|
TargetCorpus *m_targetCorpus;
|
|
|
|
Alignment *m_alignment;
|
|
|
|
INDEX m_sentence_id;
|
2012-05-07 19:03:56 +04:00
|
|
|
INDEX m_num_alignment_points;
|
2012-05-07 21:01:23 +04:00
|
|
|
int m_source_length;
|
|
|
|
int m_target_length;
|
2012-05-07 19:03:56 +04:00
|
|
|
INDEX m_source_position;
|
2012-05-07 21:01:23 +04:00
|
|
|
int m_source_start;
|
|
|
|
int m_source_end;
|
2012-05-07 19:03:56 +04:00
|
|
|
bool m_source_unaligned[ 256 ];
|
|
|
|
bool m_target_unaligned[ 256 ];
|
|
|
|
bool m_unaligned;
|
2011-06-22 01:52:13 +04:00
|
|
|
|
2012-05-07 20:13:31 +04:00
|
|
|
// No copying allowed.
|
|
|
|
Mismatch(const Mismatch&);
|
|
|
|
void operator=(const Mismatch&);
|
|
|
|
|
2011-06-22 01:52:13 +04:00
|
|
|
public:
|
2012-05-07 21:01:23 +04:00
|
|
|
Mismatch( SuffixArray *sa, TargetCorpus *tc, Alignment *a, INDEX sentence_id, INDEX position, int source_length, int target_length, int source_start, int source_end );
|
2012-05-07 19:03:56 +04:00
|
|
|
~Mismatch();
|
2011-06-22 01:52:13 +04:00
|
|
|
|
2013-05-29 21:16:15 +04:00
|
|
|
bool Unaligned() const {
|
|
|
|
return m_unaligned;
|
|
|
|
}
|
2012-05-07 19:03:56 +04:00
|
|
|
void PrintClippedHTML(std::ostream* out, int width );
|
2012-05-07 21:01:23 +04:00
|
|
|
void LabelSourceMatches(int *source_annotation, int *target_annotation, int source_id, int label );
|
2011-06-22 01:52:13 +04:00
|
|
|
};
|