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.
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)
Open
<WebSpellChecker_installation_path>/AppServer/AppServerX.xml.Find the
NgramPrioritizationtag for the language you need.Change the
Enabledattribute:Set
Enabled="true"to enable n-gram prioritization.Set
Enabled="false"to disable n-gram prioritization.
Example:
Save the file.
Restart AppServer to apply changes in AppServerX.xml.
To restart: stop the application, then start it again.
Error: failed to load n-gram model
If n-gram prioritization is enabled but the model file is missing, AppServer logs an error. Example:
This error usually means the model file is missing in the AppServer resources directory.
If the installation was done without downloading resources, re-run the installation with internet connection, or use the offline download procedure.
Last updated
Was this helpful?