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

Search.h « CubePruningMiniStack « PhraseBased « moses2 « contrib - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0dfe9dfb2fe4f6b72e2ba16730dc6a7676a1ef20 (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
/*
 * Search.h
 *
 *  Created on: 16 Nov 2015
 *      Author: hieu
 */

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

namespace Moses2
{

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

namespace NSCubePruningMiniStack
{

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

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

  void AddInitialTrellisPaths(TrellisPaths<TrellisPath> &paths) const;

protected:
  Stack m_stack;

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

  // CUBE PRUNING VARIABLES
  // setup
  MemPoolAllocator<CubeEdge*> m_cubeEdgeAlloc;
  typedef std::vector<CubeEdge*, MemPoolAllocator<CubeEdge*> > CubeEdges;
  std::vector<CubeEdges*> m_cubeEdges;

  QueueItemRecycler m_queueItemRecycler;

  // CUBE PRUNING
  // decoding
  void Decode(size_t stackInd);
  void PostDecode(size_t stackInd);
};

}

}