File size: 969 Bytes
fd49381 |
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 |
#pragma once
#include <istream>
#include <string>
#include <vector>
#include "SplitPoint.h"
namespace MosesTraining
{
namespace Syntax
{
namespace PostprocessEgretForests
{
class SplitPointFileParser
{
public:
struct Entry {
std::vector<SplitPoint> splitPoints;
};
SplitPointFileParser();
SplitPointFileParser(std::istream &);
const Entry &operator*() const {
return m_entry;
}
const Entry *operator->() const {
return &m_entry;
}
SplitPointFileParser &operator++();
friend bool operator==(const SplitPointFileParser &,
const SplitPointFileParser &);
friend bool operator!=(const SplitPointFileParser &,
const SplitPointFileParser &);
private:
void ParseLine(const std::string &, std::vector<SplitPoint> &);
Entry m_entry;
std::istream *m_input;
std::string m_tmpLine;
};
} // namespace PostprocessEgretForests
} // namespace Syntax
} // namespace MosesTraining
|