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

NBests.h « nbest « SCFG « moses2 - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7cddec1be5110a351dbed183f69a52b21a9af200 (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
54
/*
 * NBests.h
 *
 *  Created on: 24 Aug 2016
 *      Author: hieu
 */

#pragma once
#include <unordered_set>
#include "NBest.h"

namespace Moses2
{
namespace SCFG
{

class NBests
{
public:
  Contenders contenders;
  std::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);
  }

};


}
}