Sapling Logo

Grammar Checking in HTML

HTML

HTML, the HyperText Markup Language is used to design web pages to be rendered in browsers. Typically it is combined with CSS for styling and presentation and JavaScript for dynamic functionality.

Sapling: AI Writing Assistant

With Sapling, you can add grammar or spell checking functionality to an existing HTML application.

This page demonstrates a quick way to integrate grammar and spell checking functionality into a HTML application using Sapling's API. If you are not looking for a HTML guide, click here for guides for other programming languages.

Sapling maintains a HTML specific SDK that you can view documentation for here, but you can also access the Sapling Grammar Checking HTTP API using any programming language that supports HTTP POST requests.

Setup Steps

HTML Grammar Check Quickstart

<script src="https://sapling.ai/static/js/sapling-sdk-v1.0.6.min.js"></script>
<div contenteditable="true" id="check-space"></div>

<script type="text/javascript">
Sapling.init({
  endpointHostname: "https://api.sapling.ai",
  editPathname: "/api/edits",
  completePathname: "/api/complete",
  autocomplete: true,
  statusBadge: true,
});

const contentEditable = document.getElementById('check-space');
Sapling.observe(contentEditable);
</script>

Returned result:

{
    "edits":[
      {
          "end":4,
          "error_type":"R:OTHER",
          "general_error_type":"Other",
          "id":"aa5ee291-a073-5146-8ebc-c9c899d01278",
          "replacement":"Let's",
          "sentence":"Lets get started!",
          "sentence_start":0,
          "start":0
      }
    ]
}

Documentation

Addtional parameters and Sapling's full API documentation can be accessed here: https://sapling.ai/docs