Class ResponseBuilder

Class Documentation

class ResponseBuilder

ResponseBuilder is a callback functor.

It is expected to be bound to a Request after giving it the context of options, vocabs and promise to set. It constructs the Response and it’s members based on options (quality=on|off, alignments=on|off, mappings=on|off, splitmode=sentence | paragraph).

Public Functions

ResponseBuilder(ResponseOptions responseOptions, AnnotatedText &&source, const Vocabs &vocabs, std::function<void(Response&&)> callback, const QualityEstimator &qualityEstimator, )

Parameters
  • [in] responseOptions: ResponseOptions, indicating what to include or not in the response and any additional configurable parameters.

  • [in] vocabs: marian vocab object (used in decoding)

  • [in] callback: callback with operates on the constructed Response.

  • [in] qualityEstimator: the QualityEstimator model that can be used to provide translation quality probability.

void operator()(Histories &&histories)

Constructs and sets the promise of a Response object from obtained histories after translating.

Parameters
  • [in] histories: Histories obtained after translating the Request from which this functor is called.