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:
authorUlrich Germann <ugermann@inf.ed.ac.uk>2015-06-08 14:07:01 +0300
committerUlrich Germann <ugermann@inf.ed.ac.uk>2015-06-08 14:07:01 +0300
commitb682a0663645ae5ccbf279ff72ac581d9ec28fb0 (patch)
treebfec6d2bc748c15f63f661a2bcb8ec53e7178e3f /moses/IOWrapper.h
parent2b7137b5480d0d5d4582cd8d30c6695b7a789a7b (diff)
New member functions to expose buffered input and context window size.
Diffstat (limited to 'moses/IOWrapper.h')
-rw-r--r--moses/IOWrapper.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/moses/IOWrapper.h b/moses/IOWrapper.h
index f1bcefa92..eb2deb729 100644
--- a/moses/IOWrapper.h
+++ b/moses/IOWrapper.h
@@ -45,6 +45,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <vector>
#include <list>
#include <iomanip>
+#include <limits>
#include "moses/TypeDef.h"
#include "moses/Sentence.h"
@@ -183,6 +184,21 @@ public:
// post editing
std::ifstream *spe_src, *spe_trg, *spe_aln;
+ std::list<boost::shared_ptr<InputType> > const& GetPastInput() const {
+ return m_past_input;
+ }
+
+ std::list<boost::shared_ptr<InputType> > const& GetFutureInput() const {
+ return m_future_input;
+ }
+ size_t GetLookAhead() const {
+ return m_look_ahead;
+ }
+
+ size_t GetLookBack() const {
+ return m_look_back;
+ }
+
private:
template<class itype>
boost::shared_ptr<InputType>
@@ -212,10 +228,10 @@ BufferInput()
return ret;
ret = source;
}
-
while (m_buffered_ahead < m_look_ahead) {
source.reset(new itype);
- if (!source->Read(*m_inputStream, *m_inputFactorOrder)) break;
+ if (!source->Read(*m_inputStream, *m_inputFactorOrder))
+ break;
m_future_input.push_back(source);
m_buffered_ahead += source->GetSize();
}