DictionarySync
DictioanrySync handles downloading and saving Hunspell dictionaries. Pass it to {{SpellCheckHandler}} to configure a custom cache directory.
Static Method Summary
| Static Public Methods | ||
| public static |
Override the default logger for this class. |
|
Constructor Summary
| Public Constructor | ||
| public |
constructor(cacheDir: String) Creates a DictionarySync |
|
Member Summary
| Public Members | ||
| public |
cacheDir: * |
|
Method Summary
| Public Methods | ||
| public |
loadDictionaryForLanguage(langCode: String, cacheOnly: Boolean): Buffer | String Loads the dictionary for a given language code, trying first to load a local version, then downloading it. |
|
| public |
preloadDictionaries(languageList: Array<String>): Array<String> Pre-download dictionaries for languages that the user is likely to speak (based usually on their keyboard layouts). |
|
Static Public Methods
Public Constructors
Public Members
public cacheDir: * source
Public Methods
public loadDictionaryForLanguage(langCode: String, cacheOnly: Boolean): Buffer | String source
Loads the dictionary for a given language code, trying first to load a local version, then downloading it. You probably don't want this method directly, but the wrapped version {{loadDictionaryForLanguageWithAlternatives}} which is in {{SpellCheckHandler}}.
Return:
| Buffer | String | A Buffer of the file contents if {{cacheOnly}} is False, or the path to the file if True. |