Class Tokens


  • @RequiredRole("edit")
    public class Tokens
    extends APIRequestHandler
    /api/edit/annotations/tokens : Handler for receiving and processing token labels in an annotated CSV results file.

    /api/edit/annotations/tokens

    POST uploads an annotated CSV results file and imports the specified column(s) of annotation labels.

    The multipart-encoded parameters are:

    csv
    CSV file containing the attribute values to import.
    idColumn
    The (zero based) index of the column that contains the MatchId or other ID, which may identify a single word token, multiple consecutive tokens (e.g. matches from searches spanning multiple tokens) or a segment token. If the token exists, it will be annotated on the layers specified by columnLayer. If the token can't be identified, the row is ignored.
    columnLayer
    Multiple values, where the index of the value corresponds to the (zero based) CSV column index, and the value is blank to ignore the column, or the layer ID of a layer to update with an annotation labelled with the CSV cell's content.

    Output: A JSON-encoded response containing the threadId of a task that is processing the request.

    Author:
    Robert Fromont robert@fromont.net.nz
    • Constructor Detail

      • Tokens

        public Tokens()
        Default constructor.
    • Method Detail

      • post

        public javax.json.JsonObject post​(RequestParameters requestParameters,
                                          Consumer<Integer> httpStatus)
        The POST method for the servlet.
        Parameters:
        requestParameters - Request parameter map.
        httpStatus - Receives the response status code, in case of error.
        Returns:
        JSON-encoded object representing the response