Naviga Writer
8.1.7
8.1.7
  • Naviga Writer
  • Release notes
    • 8.1.7
    • 8.1.6
    • 8.1.5
    • 8.1.4
    • 8.1.3
    • 8.1.2
    • 8.1.1
    • 8.1
    • 8.0
    • 7.2
    • 7.1.0
    • 7.0.0
    • 6.5.x
    • 6.5.0
    • 6.4.1
    • 6.4.0
    • 6.3.5
    • 6.3.4
    • 6.3.3
    • 6.3.2
    • 6.3.1
    • 6.2.2
    • 6.2.1
    • 6.2.0
    • 6.1.2
    • 6.1.1
    • 6.1.0
    • 6.0.0
    • 5.3.0
  • Introduction
    • Authoring
    • Developing
    • Publishing
    • History
  • User Guide
    • Writer User Guide
      • Create a new article
      • Top bar
        • Setting menu
        • Article name
        • Search and replace words
        • Version history of an article
          • List of versions
          • Changes in each version
          • Restore to an older version
        • Locked article
        • Active Users
        • Copy article url
        • Save and publish flow
        • History Button
      • Content area
        • Image gallery
        • Embed map
        • Table
        • Teaser
        • Content part
        • HTML embed
        • Upload image
        • Upload PDF
        • Textstyles
        • Lists
        • Special character
        • Marker tool
      • Right Sidebar
        • Meta
          • Author
          • Channels
        • Integrations
        • Image and Article search
      • Bottom bar
        • Article information
        • Edit metadata on linked images
        • Article size
        • Text information
        • Language menu
      • Images User Guide
        • Upload images
        • Metadata of the image
        • Cropping images
        • Download
      • Personal Writer Template
      • Writer Keyboard Shortcuts
      • Text Management
      • Common questions when starting using Writer
  • Admin Guide
    • Configuration Files
    • Configurations Guide
      • Right Sidebar
      • Text Information
      • Content menu
    • Article Templates Configuration
    • Byline configuration
    • Language Configuration
    • Publish Flow
      • Default configuration definitions
      • Publish flow config details
      • Preconditions for roles in the publish flow
    • Generic Properties
      • Configuration
    • Image Services
      • ImEngine
      • Imgix
    • Plugins
      • Naviga developed plugins
        • Plugins in earlier versions of Writer
      • Deprecated Plugins
      • Third-party plugins
  • Developer guide
    • Upgrade Guides
      • 8.0 - Image/PDF upload changes
      • 8.0 - Opening an Article
    • Writer Plugin Development
      • Quickstart
      • Type Definitions (beta)
      • Plugin overview
      • Creating a content object plugin
      • Validation and hooks
      • Interacting with external resources
    • Writer Plugin Building Blocks
      • Package
      • Component
      • Node
      • Converter
      • Events
    • Writer Plugin Style Guide
      • CSS Guidelines
      • CSS variables, colors and fonts
      • UI Components
    • Tutorials
      • Popover & text analysis
      • Search & replace
      • Concept interaction
      • Integrating External Spell Checking
    • Infomaker NewsML
      • Overview
      • Important: About inline notes
      • Document relations and types
      • Extensions XSD
      • NewsItem
      • ConceptItem
      • PlanningItem
      • Examples
        • NewsItem - Text
        • NewsItem - Picture
        • NewsItem - PDF
        • ConceptItem - Author
        • ConceptItem - Category
        • ConceptItem - Channel
        • ConceptItem - Content Profile
        • ConceptItem - Event
        • ConceptItem - Organisation
        • ConceptItem - Person
        • ConceptItem - Place (point)
        • ConceptItem - Place (polygon)
        • ConceptItem - Section
        • ConceptItem - Story
        • ConceptItem - Topic
        • PlanningItem
    • Media Enrichment
      • Images
  • API Reference
    • Writer Api
      • Api
      • Article
      • Browser
      • Concept
      • ConceptService
      • Document
      • Events
      • NewsItem
      • Router
      • Ui
      • Upload
      • User
      • settings
      • History
      • Settings
    • UI Components
      • UIAvatar
      • UIButton
      • UIByline
      • UICheckbox
      • UIChip
      • UIDatePicker
      • UIDatetimeFieldEditor
      • UIDropdown
      • UIFieldEditor
      • UIIconButton
      • UIInlineImage
      • UIPagination
      • UISelect
      • UITimePicker
      • UIToggle
      • UITooltip
      • UIInputText
      • UITextarea
      • UIButtonGroup
      • UIConceptSearch
      • UIDateTimePicker
      • UIInputSearch
      • UIIcon
      • UIPill
      • UISpinner
      • UIButtonList
      • UIIconBadge
      • UIIconButtonMenu
      • UIInputPassword
Powered by GitBook
On this page
  • Writer Configuration
  • Field Description
  • External API Specification
  • Language Codes
  • Spellcheck Request

Was this helpful?

  1. Developer guide
  2. Tutorials

Integrating External Spell Checking

It is possible to create your own Web API endpoints and integrate your own spell checking and suggestions into the Writer.

Writer Configuration

In order to enable the spellcheck integration, the Writer's client-config needs to be edited. The following should be added to the client configuration: Notes:-

· enableSaasSpellcheck should be true in the writer client config

· For the Spellcheck endpoint, by default, the method is POST. If your API spellcheck endpoint is GET then you need to specifically pass the method as GET

· "x-append-authorization": "Bearer Your Token" Add this property in the header if your API needs authentication to run

· For the Suggestion endpoint by default, the method is GET, if your API suggestion endpoint is POST then you need to specifically pass POST in the method. For GET request:

"external": {
         "spellcheck": {
                 "check": {
                     "url": "your-spellcheck-endpoint",
                     "method": "GET",
                     "headers": {
                          "Accept": "application/json; charset=utf-8",
                          "X-Requested-With": "XmlHttpRequest"
                      }
                   },
         "suggestion": {
                "url": "your-suggestion-endpoint",
                "headers": {
                     "Accept": "application/json; charset=utf-8",
                     "X-Requested-With": "XmlHttpRequest"
                      }
                 }
        }
}

For POST request:

"external": {
        "spellcheck": {
                "check": {
                    "url": "your-spellcheck-endpoint",
                    "headers": {
                          "Accept": "application/json; charset=utf-8",
                          "X-Requested-With": "XmlHttpRequest"
                          }
                     },
        "suggestion": {
                  "url": "your-suggestion-endpoint",
                  "method": "POST" ,
                  "headers": {
                        "Accept": "application/json; charset=utf-8",
                        "X-Requested-With": "XmlHttpRequest"
                       }
                }
        }
}

Field Description

Field

Description

external.spellcheck

Contains the configuration for external spellchecking endpoints.

external.spellcheck.check

Object containing configuration for external spellcheck requests.

external.spellcheck.check.url

Required Full url and path to your check request implementation.

external.spellcheck.check.headers

Optional Key-value object with extra header's which will be used in the request to your API.

external.suggestion

Object containing configuration for external suggestion requests.

external.suggestion.url

Required pass suggestions API endpoint

external.suggestion.headers

Optional Key-value object with extra header's which will be used in the request to your API.

The headers-properties are useful if you need to send additional headers to your API.

Remember to configure the external spellcheck service to allow cross-origin requests from the writer application url.

External API Specification

Your API needs to be able to handle the following requests to integrate with spell checking and suggestion.

Language Codes

Examples: sv_SE, en_GB, en_US, nl_NL

Spellcheck Request

The API must be able to receive the following request on an endpoint you define:

Request

    POST [your-spellcheck-endpoint]
    headers
        Accept: application/json
        Content-Type: application/json 
    body
        {
            "lang": "sv_SE",
            "text": "Lorem ipsum dolor sit amet, consectetur adipiscing elit"
        }

Response

The API should respond with a single array containing the misspelled words in the same json-format as they were sent, if no words were misspelled, response should contain an empty array.

Response Format

headers
    Content-Type: application/json 
body
    [
      { "start": 0, "end": 5, "text": "Lorem" },
      { "start": 6, "end": 11, "text": "ipsum" },
      { "start": 12, "end": 17, "text": "dolor" },
      { "start": 61, "end": 63, "text": "do" },
      { "start": 64, "end": 71, "text": "eiusmod" }
    ]

Example Request

The API should be able to perform the call below, and output an array of the misspelled words, or an empty array.

For making request using GET method:

api.router.get('/api/resourceproxy', {

url: `${this.apiURL}?text=${text}&lang=${lang}`,

headers: {

'Content-Type': 'application/json; charset=UTF-8',

...this.extraHeaders

}

})

.then((res) => res.json())

.then((json) => console.log(json))

For making request using POST method:

api.router.post('/api/resourceproxy', {

url: this.apiURL,

signal: controller.signal,

headers: {

'Content-Type': 'application/json; charset=UTF-8',

...this.extraHeaders

},

body: JSON.stringify({

text,

lang

})

})

.then((res) => res.json())

.then((json) => console.log(json))

Output:

    [
        {"start":0,"end":5,"text":"Lorem"},
        {"start":6,"end":11,"text":"ipsum"},
        {"start":64,"end":71,"text":"dolor"}
    ]

Suggestions

The API must be able to receive the following request on an endpoint you define:

Request

    POST [your-suggestion-endpoint]
    headers
        Accept: application/json
        Content-Type: application/json
    URL Params
        word=String
        lang=[language_code]

Response

The API should respond with a single array containing the misspelled words in the same json-format as they were sent, if no words were misspelled, response should be an empty array.

Response Format

    headers
        Content-Type: application/json
    body
        [
            "tempot",
            "tempo",
            "tempon",
            "tempos",
            "teorem"
        ]

Example Request

The API should be able to perform the call below, and output an array of words, or an empty array.

For making GET request:

api.router.get('/api/resourceproxy', {

url: `${externalSpellcheckUrl}?word=${word}&lang=${lang}`,

headers: {

'Content-Type': 'application/json; charset=UTF-8',

...extraHeaders

}

})

For making POST request:

For making POST request:

api.router.post('/api/resourceproxy', {

url: externalSpellcheckUrl,

headers: {

'Content-Type': 'application/json; charset=UTF-8',

...extraHeaders

},

body: JSON.stringify({

word,

lang

})

})

Output

["tempo", "temper", "tempos", "temp or", "temp-or", "tempo r"]
PreviousConcept interactionNextInfomaker NewsML

Was this helpful?

Language codes from the writer are sent in the format [language-identifier]_[region_identifier]. Where [language-identifier] follows the standard, which is two letters, lowercased. The [region-identifier] follows the standard, which is two letters, uppercased.

ISO 639-1
ISO 3166-2