Class SentenceTuple

Class Documentation

class SentenceTuple

Public Types

typedef Words value_type

Public Functions


Creates an empty tuple with no associated future.

SentenceTuple(const SentenceTupleImpl &tupImpl)
SentenceTuple(std::future<SentenceTupleImpl> &&fImpl)
SentenceTupleImpl &get() const
size_t getId() const

Returns the sentence’s ID.

bool isAltered() const

Returns whether this Tuple was altered or augmented from what was provided to Marian in input.

size_t size() const

The size of the tuple, e.g.

two for parallel data with a source and target sentences.

bool valid() const

confirms that the tuple has been populated with data

Words &operator[](size_t i)

The i-th tuple sentence.

  • i: Tuple’s index.

const Words &operator[](size_t i) const
Words &back()

The last tuple sentence, i.e.

the target sentence.

const Words &back() const
bool empty() const

Checks whether the tuple is empty.

auto begin() const
auto end() const
auto rbegin() const
auto rend() const
const std::vector<float> &getWeights() const

Get sentence weights.

For sentence-level weights the vector contains only one element.

const WordAlignment &getAlignment() const