mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2025-01-08 04:27:53 +03:00
50 lines
876 B
C++
50 lines
876 B
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <stddef.h>
|
|
#include "util/exception.hh"
|
|
|
|
namespace Moses2
|
|
{
|
|
|
|
class FFState
|
|
{
|
|
public:
|
|
virtual ~FFState() {}
|
|
virtual size_t hash() const = 0;
|
|
virtual bool operator==(const FFState& other) const = 0;
|
|
|
|
virtual bool operator!=(const FFState& other) const {
|
|
return !(*this == other);
|
|
}
|
|
|
|
virtual std::string ToString() const = 0;
|
|
};
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////
|
|
inline std::ostream& operator<<(std::ostream& out, const FFState& obj)
|
|
{
|
|
out << obj.ToString();
|
|
return out;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////
|
|
class DummyState : public FFState
|
|
{
|
|
public:
|
|
DummyState() {}
|
|
|
|
virtual size_t hash() const {
|
|
return 0;
|
|
}
|
|
|
|
virtual bool operator==(const FFState& other) const {
|
|
return true;
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|