Package nzilbb.labbcat.server.api
Class Utterances
- java.lang.Object
-
- nzilbb.labbcat.server.api.APIRequestHandler
-
- nzilbb.labbcat.server.api.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
- participant_expression - AGQL expression for defining which
participants to search the utterances of,
e.g.
-
-
Field Summary
-
Fields inherited from class nzilbb.labbcat.server.api.APIRequestHandler
SC_BAD_REQUEST, SC_CONFLICT, SC_FORBIDDEN, SC_INTERNAL_SERVER_ERROR, SC_METHOD_NOT_ALLOWED, SC_NOT_FOUND, SC_OK, SC_UNPROCESSABLE_CONTENT, SC_UNSUPPORTED_MEDIA_TYPE
-
-
Constructor Summary
Constructors Constructor Description Utterances()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.json.JsonObject
post(RequestParameters parameters, Consumer<String> fileName, Consumer<Integer> httpStatus, Consumer<String> redirectUrl)
The POST method for the servlet.-
Methods inherited from class nzilbb.labbcat.server.api.APIRequestHandler
GetSystemAttribute, init, writeResponse
-
-
-
-
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
-
-