Welcome to mirror list, hosted at ThFree Co, Russian Federation.

NBests.h « nbest « SCFG « moses2 « contrib - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a9cb93a5d9e6f10305893df802605ee33013b6cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 * NBests.h
 *
 *  Created on: 24 Aug 2016
 *      Author: hieu
 */

#pragma once
#include <boost/unordered_set.hpp>
#include "NBest.h"

namespace Moses2
{
namespace SCFG
{

class NBests
{
public:
	Contenders contenders;
	boost::unordered_set<size_t> distinctHypos;

	NBests(const SCFG::Manager &mgr,
			const ArcList &arcList,
			NBestColl &nbestColl);

	virtual ~NBests();

	size_t GetSize() const
	{ return m_coll.size(); }

	const NBest &Get(size_t ind) const
	{ return *m_coll[ind]; }

	bool Extend(const SCFG::Manager &mgr,
			NBestColl &nbestColl,
			size_t ind);

protected:
	std::vector<const NBest*> m_coll;
	size_t indIter;

	void Add(const NBest *nbest)
	{
		m_coll.push_back(nbest);
	}

};


}
}