Configure n-gram models

N-gram models improve spell checking suggestion quality.

N-gram models use language-specific model files stored in the AppServer resources directory.

The default location is <WebSpellChecker_installation_path>/AppServer/Resources/. The actual path is controlled by ResourcesDir in AppServerX.xml. See AppServer parameters.

N-gram models are configured via the NgramPrioritization tag in AppServerX.xml. It is nested under the Hunspell spell engine options for a CheckKit.

All supported n-gram models are enabled by default.

circle-info

Each n-gram model uses roughly the same amount of RAM as its file size on disk. Model sizes are listed in the table below.

Installation

Model files are downloaded during installation.

After download, the installer places the models into the AppServer resources directory. The spell engine loads them from the path configured in NgramPrioritization (for example, en/en_ngram_model.bin).

If your server has no Internet access, see Manually downloading resources (offline installation).

Available n-gram models

Language

Supported language IDs

Model file

Size

English

en_US, en_GB, en_CA, en_AU, en_NZ, en_ZA

en_ngram_model.dat

80 MB

German

de_DE, de_CH, de_AT

de_ngram_model.dat

78 MB

Spanish

es_ES

es_ngram_model.dat

100 MB

Change n-gram settings (enable/disable)

  1. Open <WebSpellChecker_installation_path>/AppServer/AppServerX.xml.

  2. Find the NgramPrioritization tag for the language you need.

  3. Change the Enabled attribute:

    • Set Enabled="true" to enable n-gram prioritization.

    • Set Enabled="false" to disable n-gram prioritization.

Example:

  1. Save the file.

Restart AppServer to apply changes in AppServerX.xml.

To restart: stop the application, then start it again.

Use Main AppServer commands.

Error: failed to load n-gram model

If n-gram prioritization is enabled but the model file is missing, AppServer logs an error. Example:

circle-exclamation

Last updated

Was this helpful?