mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-11-10 10:59:21 +03:00
Add a phrase default constructor, bypassing the array size increment
This commit is contained in:
parent
2e8c316aaa
commit
eb28ea26a8
@ -37,6 +37,8 @@ using namespace std;
|
||||
namespace Moses
|
||||
{
|
||||
|
||||
Phrase::Phrase() {}
|
||||
|
||||
Phrase::Phrase(size_t reserveSize)
|
||||
{
|
||||
m_words.reserve(reserveSize);
|
||||
|
@ -57,6 +57,7 @@ public:
|
||||
|
||||
/** create empty phrase
|
||||
*/
|
||||
Phrase();
|
||||
explicit Phrase(size_t reserveSize);
|
||||
/** create phrase from vectors of words */
|
||||
explicit Phrase(const std::vector< const Word* > &mergeWords);
|
||||
|
@ -53,9 +53,9 @@ TargetPhrase::TargetPhrase( std::string out_string)
|
||||
|
||||
|
||||
TargetPhrase::TargetPhrase()
|
||||
:Phrase(ARRAY_SIZE_INCR)
|
||||
:Phrase()
|
||||
, m_fullScore(0.0)
|
||||
,m_sourcePhrase(0)
|
||||
,m_sourcePhrase()
|
||||
, m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
|
||||
, m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
|
||||
{
|
||||
@ -64,7 +64,7 @@ TargetPhrase::TargetPhrase()
|
||||
TargetPhrase::TargetPhrase(const Phrase &phrase)
|
||||
: Phrase(phrase)
|
||||
, m_fullScore(0.0)
|
||||
, m_sourcePhrase(0)
|
||||
, m_sourcePhrase()
|
||||
, m_alignTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
|
||||
, m_alignNonTerm(&AlignmentInfoCollection::Instance().GetEmptyAlignmentInfo())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user