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

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/moses2/PhraseBased/CubePruningMiniStack/Search.h')
-rw-r--r--contrib/moses2/PhraseBased/CubePruningMiniStack/Search.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/contrib/moses2/PhraseBased/CubePruningMiniStack/Search.h b/contrib/moses2/PhraseBased/CubePruningMiniStack/Search.h
new file mode 100644
index 000000000..0dfe9dfb2
--- /dev/null
+++ b/contrib/moses2/PhraseBased/CubePruningMiniStack/Search.h
@@ -0,0 +1,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);
+};
+
+}
+
+}
+