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

Search.h « CubePruningPerMiniStack « defer « moses2 - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2adb9631c9e2ac64c7bb0c9cbb30d498ff24b7bb (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
55
56
57
58
59
60
61
62
63
64
65
66
/*
 * Search.h
 *
 *  Created on: 16 Nov 2015
 *      Author: hieu
 */

#pragma once
#include <boost/pool/pool_alloc.hpp>
#include <boost/unordered_map.hpp>
#include "../Search.h"
#include "Misc.h"
#include "Stacks.h"
#include "../../legacy/Range.h"

namespace Moses2
{

class Bitmap;
class Hypothesis;
class InputPath;
class TargetPhrases;

namespace NSCubePruningMiniStack
{
class MiniStack;
}

namespace NSCubePruningPerMiniStack
{

class Search : public Moses2::Search
{
public:
  Search(Manager &mgr);
  virtual ~Search();

  virtual void Decode();
  const Hypothesis *GetBestHypo() const;

protected:
  Stacks m_stacks;

  CubeEdge::Queue m_queue;
  CubeEdge::SeenPositions m_seenPositions;

  // CUBE PRUNING VARIABLES
  // setup
  typedef std::vector<CubeEdge*> CubeEdges;
  boost::unordered_map<NSCubePruningMiniStack::MiniStack*, CubeEdges*> m_cubeEdges;

  std::deque<QueueItem*> m_queueItemRecycler;

  // CUBE PRUNING
  // decoding
  void CreateSearchGraph(size_t stackInd);
  void Decode(size_t stackInd);
  void Decode(NSCubePruningMiniStack::MiniStack &miniStack);

  void DebugCounts();
};

}

}