2016-02-19 22:32:32 +03:00
|
|
|
#pragma once
|
|
|
|
#include "Phrase.h"
|
|
|
|
|
|
|
|
namespace Moses2
|
|
|
|
{
|
|
|
|
|
2016-03-31 23:00:16 +03:00
|
|
|
class SubPhrase: public Phrase
|
2016-02-19 22:32:32 +03:00
|
|
|
{
|
|
|
|
friend std::ostream& operator<<(std::ostream &, const SubPhrase &);
|
|
|
|
public:
|
2016-03-04 02:56:36 +03:00
|
|
|
SubPhrase(const Phrase &origPhrase, size_t start, size_t size);
|
2016-02-19 23:58:31 +03:00
|
|
|
virtual const Word& operator[](size_t pos) const;
|
2016-02-19 22:32:32 +03:00
|
|
|
|
|
|
|
virtual size_t GetSize() const
|
2016-03-31 23:00:16 +03:00
|
|
|
{
|
|
|
|
return m_size;
|
|
|
|
}
|
2016-02-19 22:32:32 +03:00
|
|
|
|
2016-03-04 02:56:36 +03:00
|
|
|
SubPhrase GetSubPhrase(size_t start, size_t size) const;
|
2016-02-19 22:32:32 +03:00
|
|
|
|
|
|
|
protected:
|
2016-02-22 20:33:08 +03:00
|
|
|
const Phrase *m_origPhrase;
|
2016-03-04 02:56:36 +03:00
|
|
|
size_t m_start, m_size;
|
2016-02-19 22:32:32 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|