mosesdecoder/contrib/other-builds/moses2/TargetPhrases.h

47 lines
894 B
C
Raw Normal View History

2015-10-24 01:19:31 +03:00
/*
* TargetPhrases.h
*
* Created on: 23 Oct 2015
* Author: hieu
*/
#pragma once
2015-10-24 14:39:15 +03:00
#include <vector>
#include "TargetPhrase.h"
2015-10-24 01:19:31 +03:00
class TargetPhrases {
2015-10-26 21:42:42 +03:00
friend std::ostream& operator<<(std::ostream &, const TargetPhrases &);
2015-10-25 22:55:22 +03:00
typedef std::vector<const TargetPhrase*> Coll;
2015-10-24 01:19:31 +03:00
public:
typedef boost::shared_ptr<TargetPhrases> shared_ptr;
typedef boost::shared_ptr<TargetPhrases const> shared_const_ptr;
2015-10-25 22:55:22 +03:00
typedef Coll::iterator iterator;
typedef Coll::const_iterator const_iterator;
//! iterators
const_iterator begin() const {
return m_coll.begin();
}
const_iterator end() const {
return m_coll.end();
}
2015-10-24 01:19:31 +03:00
TargetPhrases();
virtual ~TargetPhrases();
2015-10-24 14:39:15 +03:00
void AddTargetPhrase(const TargetPhrase &targetPhrase)
{
m_coll.push_back(&targetPhrase);
}
2015-10-30 22:10:04 +03:00
size_t GetSize() const
{ return m_coll.size(); }
2015-11-06 13:55:04 +03:00
void SortAndPrune(size_t tableLimit);
2015-10-24 01:19:31 +03:00
protected:
2015-10-25 22:55:22 +03:00
Coll m_coll;
2015-10-24 01:19:31 +03:00
};