Keyboard Support

Contact and Search

Keyman.com Homepage

Header bottom

Keyman.com

Other versions
Version 18.0 (current version)Version 16.0Version 15.0Version 14.0Version 13.0Version 12.0

On this page

Manager.downloadLexicalModel()


Summary

The downloadLexicalModel() method installs dictionaries (lexical models) for active use.

Syntax

Manager.downloadLexicalModel(withID: String, languageID: String, isUpdate: Bool, fetchRepositoryIfNeeded: Bool = true)

Parameters

withID : ID of the dictionary.

languageID : ID of the language.

isUpdate : Boolean to keep the dictionary files on failure.

fetchRepositoryIfNeeded : Fetch the list of language resources from the API if necessary.

Description

This syntax can be used to asynchronously fetch dictionary files.

Example 1: Using downloadLexicalModel()

The following script illustrates the use of downloadLexicalModel():

Manager.shared.downloadLexicalModel(withID: model.id, languageID: model.languageID, isUpdate: false)

Syntax

Manager.downloadLexicalModel(url: URL)

Parameter

url : URL to a .MODEL.KMP package containing the dictionary.

Description

This syntax can be used to asynchronously fetch the dictionary files.

Example 2: Using downloadLexicalModel()

The following script illustrates the use of downloadLexicalModel():

let url = URL(string: "https://example.com/en.example.model.kmp")
Manager.shared.downloadLexicalModel(from: url!)