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, Vocabs &vocabs, std::promise<Response> &&promise)

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] promise: promise to set with the constructed Response.

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.