Clojure grammar checker quickstart
Send text to the edits endpoint. Sapling returns suggested replacements with character offsets so your application can review or apply each correction.
No language-specific SDK is required. The example uses a standard or commonly used HTTP client to call Sapling's JSON API.
Clojure
/api/v1/edits
This is a sample in Clojure that uses the clj-http HTTP library.
(require '[clj-http.client :as client])
(client/post "https://api.sapling.ai/api/v1/edits" {:form-params {:key "API_KEY" :text "Lets get started" :session_id "Test Document UUID"} :content-type :json})
Example response
application/json
{
"edits": [
{
"start": 0,
"end": 4,
"replacement": "Let's",
"sentence": "Lets get started!",
"error_type": "R:OTHER"
}
]
}
Each edit identifies the source range and replacement text. Preserve the original offsets when applying more than one edit.
About Clojure
Clojure is a dialect of Lisp, a class of programming languages that provide a macro system that treats code as mutable data. Clojure runs on the Java platform.