Skip to main content
100%

A little playful XQuery

✓ Published0🌍 Public
CCliffordAnderson
Last edited Feb 10, 2017
Created on Feb 10, 2017

This playful XQuery example transforms a user’s phrase by replacing each word with a random antonym fetched from the Oxford Dictionaries API. It demonstrates a game-like text manipulation, showing the original sentiment inverted. The code uses XQuery 3.1, the `http:send-request` and `random:integer` functions, and the MarkLogic HTTP client to query the Oxford entry endpoint. For each word, it retrieves antonym sets, picks one randomly, and falls back to the original word when no antonym exists.

AI-generated description

Similar vizzes