Erlang 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.
Erlang
/api/v1/edits
ssl:start(),
application:start(inets),
httpc:request(post,
{"https://api.sapling.ai/api/v1/edits", [],
"application/json",
"{'key':'API_KEY', 'text':'Lets get started!', 'session_id':'Test Document UUID'}"
}, [], []).
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 Erlang
Erlang is a programming language for the Erlang virtual machine. It is designed for distributed, fault-tolerant, and highly concurrent/parallelizable systems. Applications of Erlang include WhatsApp and telephony switches.