#pragma once /* * PhraseAlignment.h * extract * * Created by Hieu Hoang on 28/07/2010. * Copyright 2010 __MyCompanyName__. All rights reserved. * */ #include "tables-core.h" #include #include #include // data structure for a single phrase pair class PhraseAlignment { protected: PHRASE phraseS; PHRASE phraseT; std::map > m_ntLengths; void createAlignVec(size_t sourceSize, size_t targetSize); void addNTLength(const std::string &tok); public: float pcfgSum; float count; std::vector< std::set > alignedToT; std::vector< std::set > alignedToS; void create( char*, int ); void clear(); bool equals( const PhraseAlignment& ); bool match( const PhraseAlignment& ); int Compare(const PhraseAlignment &compare) const; inline bool operator<(const PhraseAlignment &compare) const { return Compare(compare) < 0; } const PHRASE &GetSource() const { return phraseS; } const PHRASE &GetTarget() const { return phraseT; } const std::map > &GetNTLengths() const { return m_ntLengths; } };