Thursday, June 6, 2024
HomeLanguage LearningThe Syntax: What’s New in Grammarly for Builders | Grammarly

The Syntax: What’s New in Grammarly for Builders | Grammarly


OMG, y’all, it’s June! 4 months have flown by since I posted the final version of The Syntax, and I’m excited to share with you the options and fixes our engineering workforce has applied since then. Here’s what I’ll cowl on this submit:

Video overview

Dictionaries 📖

Emoji autocomplete 😲

suggestion-card-action ➡️

Efficiency enhancements for long-form textual content 📈

Wrapping up

Video overview

Final week I hosted a stay stream the place members of the Grammarly for Builders workforce joined me to point out off the newest options and fixes. A recording of the stream is out there under:

Dictionaries 📖

TL;DR: You may create an app dictionary so Grammarly will acknowledge the phrases and jargon that your customers steadily write.

Grammarly acknowledges all kinds of phrases, however we’ve heard from lots of you that your customers embody industry-specific jargon and phrases of their textual content. When Grammarly doesn’t acknowledge the jargon and phrases, Grammarly flags them as being misspelled.

In case your app is on the Plus plan, you possibly can create app dictionaries and configure which of your textual content editors use them starting in model 2.5.0. For instance, you may wish to configure some textual content editors to make use of authorized and medical dictionaries when you may wish to configure others to make use of a dictionary of tech jargon.

A user adds the words prebirds, sandoozles, and youie to a new app dictionary.

I constructed a dictionary of phrases from the TV present Parks and Recreation as a result of, in my view, it’s one of the best present ever created. And that could be a truth. 😉

On the Dictionaries web page within the App Console, you possibly can add phrases to a dictionary individually, or you possibly can add a CSV file containing a line-separated listing of phrases. When you’ve added phrases to a dictionary and configured your textual content editor to make use of it, Grammarly will now not flag the phrases within the dictionary as being misspelled.

Aspect notice for these of you who’re questioning how this performance differs from the private dictionary I described within the February version of The Syntax:

  • Particular person customers of your app can add phrases to their very own private dictionaries. Solely they’ve entry to that dictionary.
  • App house owners and collaborators can create app dictionaries. Upon getting configured a textual content editor to make use of an app dictionary, Grammarly will use the app dictionary for any person who writes textual content in that editor.

In case you create a dictionary that others might discover useful, I encourage you to add the CSV file to GitHub or one other location of your alternative and share the hyperlink in this dialogue thread within the Grammarly for Builders GitHub repo. To get the enjoyable began, I’ve created a dictionary for phrases from the TV present Parks and Recreation and shared it in the thread.

Emoji autocomplete 😲

TL;DR: Your customers can insert emojis by typing a colon adopted by a letter.

I really like emojis, and chances are high good that lots of your customers do as properly. We’ve made it simpler on your customers so as to add emojis to their textual content by implementing emoji autocomplete in model 2.4.0 of the SDK.

In case your app is on the Plus plan, you possibly can activate emoji autocomplete utilizing the autocomplete config possibility. You may select between 4 attainable values for autocomplete:

  • on: Textual content phrase autocomplete and emoji autocomplete
  • textual content: Solely textual content phrase autocomplete
  • emoji: Solely emoji autocomplete
  • off: No autocomplete of any sort. That is the default possibility.

When emoji autocomplete is turned on, your customers will have the ability to add an emoji by typing a colon adopted by a letter.

A user types text that ends with ‘:smile.’ An emoji selection menu appears, and the user selects the ‘smile-cat’ emoji.

suggestion-card-action ➡️

TL;DR: Your app can hear for the suggestion-card-action occasion to know when a person has accepted a suggestion, dismissed a suggestion, or closed an open suggestion card.

We all know that lots of you should programmatically take an motion when your customers work together with the Grammarly Textual content Editor Plugin. We obtained a request for the plugin to emit an occasion each time a person interacts with an open suggestion card, so we created the suggestion-card-action occasion in model 2.3.14.

The suggestion-card-action occasion is emitted each time a person interacts with an open suggestion card by accepting a suggestion, dismissing a suggestion, or closing the cardboard.

A user accepts a suggestion, dismisses a suggestion, and closes a suggestion box. As they do, information about each event appears on the page.

For instance, in JavaScript you possibly can add an occasion listener to your editor:

Then you possibly can create a operate to deal with the occasion. The instance operate under solely logs the occasion, however your operate may do one thing extra helpful with the occasion information.

The suggestion-card-action occasion consists of quite a lot of data. You’ll seemingly be most within the kind and element properties.

The Textual content Editor Plugin exposes a number of customized occasions, together with document-stats (which supplies data just like the readability rating, phrase depend, and studying time) and session-stats (which supplies data just like the variety of accepted recommendations and the variety of phrases analyzed throughout the present session). Be taught extra about the entire occasions on the brand new Customized Occasions web page within the docs. It’s also possible to discover the occasions in this instance hosted on CodeSandbox.

Efficiency enhancements for long-form textual content 📈

TL;DR: We fastened efficiency points for long-form textual content.

I feel the need: the need for speed!

 

 

 

 

 

 

We made efficiency enhancements for editors containing massive quantities of textual content (textual content >1500 phrases) in model 2.3.15. (An enormous shout out to Gnohz Gniy for reporting the efficiency subject!) Be looking out for an upcoming submit on the Grammarly for Builders weblog the place we’ll present a behind-the-scenes take a look at how we optimize SDK efficiency.

In case you encounter any efficiency points after upgrading to model 2.3.15 or later, please report a problem within the Grammarly for Builders GitHub repo.

Wrapping up

Our workforce has delivered enjoyable and helpful options and fixes over the previous few months:

  • You may create an app dictionary in order that Grammarly gained’t flag phrases which can be frequent in your app as misspelled phrases.
  • Your customers can insert emojis by typing a colon adopted by a letter.
  • Your app can programmatically take an motion each time a person accepts a suggestion, dismisses a suggestion, or closes an open suggestion card by listening for the suggestion-card-action occasion.
  • You’ll discover a efficiency enchancment when utilizing the SDK with long-form textual content.

For an in depth listing of what was included in every launch, try the changelog.

As all the time, we’d love to listen to from you! If in case you have any questions or recommendations for enchancment, please begin a dialogue within the Grammarly for Builders GitHub repo. I look ahead to chatting with you there!

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments