Class Utterances


  • public class Utterances
    extends APIRequestHandler
    /api/utterances : Starts a task to identify targeted utterances for given participants.

    Input HTTP parameters:

    • participant_expression - AGQL expression for defining which participants to search the utterances of, e.g. first('participant_gender').label == 'NB'
    • id - A list of participant IDs, as an alternative to the participant_expression parameter.
    • transcript_expression - Optional AGQL expression for defining which transcript to search, e.g. ['CC','IA'].includesAny(labels('corpus'))
    • only_main_speaker - Optional: "true" if only main-participant utterances should be searched, absent otherwise.
    • redirect - Optional: "true" if the request should redirect to the user-interface for monitoring the task, rather than returning a JSON body.
    • speaker_number - For backwards compatibility, a list of participant speaker_numbers as an alternative to the participant_expression parameter.
    • transcript_type - For backwards compatibility, a list of transcript_types as an alternative to the transcript_expression parameter.

    Output: a JSON-encoded response object of the usual structure for which the "model" is an object with a "threadId" attribute, which is the ID of the server task to monitor for results. e.g.
    {
        "title":"utterances",
        "version" : "20230502.0924",
        "code" : 0,
        "errors" : [],
        "messages" : [],
        "model" : {
            "threadId" : "80"
        }
     }

    The task, when finished, will output a URL for accessing the matches of the search.
    Author:
    Robert Fromont
    • Constructor Detail

      • Utterances

        public Utterances()
        Constructor
    • Method Detail

      • post

        public javax.json.JsonObject post​(RequestParameters parameters,
                                          Consumer<String> fileName,
                                          Consumer<Integer> httpStatus,
                                          Consumer<String> redirectUrl)
        The POST method for the servlet.
        Parameters:
        parameters - Request parameter map.
        fileName - Receives the filename for specification in the response headers.
        httpStatus - Receives the response status code, in case or error.
        redirectUrl - Receives a URL for the request to be redirected to.
        Returns:
        JSON-encoded object representing the response