Class Intervals
- java.lang.Object
-
- nzilbb.labbcat.server.api.APIRequestHandler
-
- nzilbb.labbcat.server.api.annotation.Intervals
-
public class Intervals extends APIRequestHandler
/api/annotation/intervals : Concatenates annotation labels for given labels contained in given time intervals.A given CSV file, with given column indices identifying the transcript, participant, start, and end columns, is traversed, and for each row, annotations contained by the intervals are identified, their labels are concatinated and returned with the overall time boundaries added to a copy of the original CSV file.
The request method must be POST
The multipart-encoded parameters are:
- csv
- CSV results file containing tokens to measure.
- csvFieldDelimiter
- Optional character for delimiting the CSV field. If not specified, the delimiter will be inferred from the first line of the file.
- transcriptColumn
- CSV column index of the transcript name.
- participantColumn
- CSV column index of the participant name.
- startTimeColumn
- CSV column index of the start time.
- endTimeColumn
- CSV column index of the end time name.
- containment
- "entire" if the annotations must be entirely between the start and end times, "partial" if they can extend before the start or after the end.
- labelDelimiter
- Delimiter to use between labels. Defaults to a space " ".
- passThroughData or copyColumns
- Whether to include all CSV columns from the input file in the output file - "false" if not.
- layerId
- One or more layer IDs to extract.
Output: A JSON-encoded response containing the threadId of a task that is processing the request. The task, when finished, will output a CSV files with one line for each line of the input file, and fields containing the selected layers' labels and boundaries. The input file data will be passed through into the output file, with new columns appended to each line.
- Author:
- Robert Fromont
-
-
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 Intervals()
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)
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)
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 of error.- Returns:
- JSON-encoded object representing the response
-
-