<commit_before>\subsection{JSON API documentation}

    Waysome is able to get and process messages via a JSON API. The following
    chapter documents the API.

    In the following chapter, "request" or "message" is used to name a message
    which is sent to waysome, containing a JSON object. "transaction" is used to
    name such a message which contains "commands" to the software.

    \subsubsection{Possible top-level keys}

        The top level keys of the JSON object are

        \begin{itemize}
            \item ``UID'', which is meant to be a \emph{unique} id (generated by
                the client) to identify the transaction. The client has to take
                care of his UIDs, so they do not appear several times. Each
                client has its own "namespace" here, so two clients will not
                collide if they use the same UID.  A UID is a number.

            \item ``type'', which describes the type of the message. This is
                currently only the string "transaction", more to come.

            \item ``CMDS'', which contains a JSON-Array of Commands.
        \end{itemize}

    \subsubsection{Commands}

        A command in the command array is a JSON object on its own. The key of
        the command is always the name of the command, whereas the value of the
        command are the arguments of the command:

        \begin{lstlisting}[language=json]
            { "add": [1, 2] }
        \end{lstlisting}

        The value can be a

        \begin{itemize}
            \item Integer, to tell waysome to use N positions from the stack

            \item Array, for arguments to the command, whereas

            \begin{itemize}
                \item "null" is NIL
                \item "true"/"false" as booleans
                \item Integers as integers
                \item Doubles as doubles (not supported yet)
                \item Strings as strings
                \item Arrays to specify a set
                \item An object: '{ "pos": 1 }' to refer to a position on the
                    stack (first in this case)
                \item An object: '{ "name": "a name", "value": <value> }' for a
                    named value, whereas the name is a string and the value can
                    be one out of this list.
            \end{itemize}
        \end{itemize}

        Of course you can mix objects and integers in the array, if the related
        command takes them.

        For example:
<commit_msg>Remove "double"-entry from user documentation of API<commit_after>\subsection{JSON API documentation}

    Waysome is able to get and process messages via a JSON API. The following
    chapter documents the API.

    In the following chapter, "request" or "message" is used to name a message
    which is sent to waysome, containing a JSON object. "transaction" is used to
    name such a message which contains "commands" to the software.

    \subsubsection{Possible top-level keys}

        The top level keys of the JSON object are

        \begin{itemize}
            \item ``UID'', which is meant to be a \emph{unique} id (generated by
                the client) to identify the transaction. The client has to take
                care of his UIDs, so they do not appear several times. Each
                client has its own "namespace" here, so two clients will not
                collide if they use the same UID.  A UID is a number.

            \item ``type'', which describes the type of the message. This is
                currently only the string "transaction", more to come.

            \item ``CMDS'', which contains a JSON-Array of Commands.
        \end{itemize}

    \subsubsection{Commands}

        A command in the command array is a JSON object on its own. The key of
        the command is always the name of the command, whereas the value of the
        command are the arguments of the command:

        \begin{lstlisting}[language=json]
            { "add": [1, 2] }
        \end{lstlisting}

        The value can be a

        \begin{itemize}
            \item Integer, to tell waysome to use N positions from the stack

            \item Array, for arguments to the command, whereas

            \begin{itemize}
                \item "null" is NIL
                \item "true"/"false" as booleans
                \item Integers as integers
                \item Strings as strings
                \item Arrays to specify a set
                \item An object: '{ "pos": 1 }' to refer to a position on the
                    stack (first in this case)
                \item An object: '{ "name": "a name", "value": <value> }' for a
                    named value, whereas the name is a string and the value can
                    be one out of this list.
            \end{itemize}
        \end{itemize}

        Of course you can mix objects and integers in the array, if the related
        command takes them.

        For example:

{'fraction_non_alphanumeric': 0.06285253827558421, 'fraction_numerical': 0.0012087026591458502, 'mean_word_length': 1.814625850340136, 'pattern_counts': {'":': 8, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '207443', 'n_tokens_mistral': 1266, 'n_tokens_neox': 1208, 'n_words': 641}