What is @cspell/cspell-bundled-dicts?
@cspell/cspell-bundled-dicts is a package that provides a collection of pre-bundled dictionaries for use with the CSpell spell checker. It allows developers to easily integrate various language dictionaries into their projects to enhance spell-checking capabilities.
What are @cspell/cspell-bundled-dicts's main functionalities?
Loading a Dictionary
This feature allows you to load a specific dictionary by its language code. In this example, the 'en_us' dictionary is loaded and logged to the console.
const { getDictionary } = require('@cspell/cspell-bundled-dicts');
async function loadDictionary() {
const dictionary = await getDictionary('en_us');
console.log(dictionary);
}
loadDictionary();
Listing Available Dictionaries
This feature provides a list of all available dictionaries bundled with the package. The example code retrieves and logs the list of dictionaries.
const { getDictionaryList } = require('@cspell/cspell-bundled-dicts');
function listDictionaries() {
const dictionaries = getDictionaryList();
console.log(dictionaries);
}
listDictionaries();
Other packages similar to @cspell/cspell-bundled-dicts
hunspell-dict-en-us
hunspell-dict-en-us provides the English (US) dictionary for Hunspell, a popular spell checker. Unlike @cspell/cspell-bundled-dicts, which offers multiple dictionaries for different languages, hunspell-dict-en-us focuses solely on the US English dictionary.
dictionary-en
dictionary-en is part of the `wooorm/dictionaries` collection and provides English dictionaries for use with various spell checkers. It is similar to @cspell/cspell-bundled-dicts in that it offers pre-bundled dictionaries, but it is more focused on the English language.
spellchecker-wasm
spellchecker-wasm is a WebAssembly-based spell checker that includes dictionaries for multiple languages. It is similar to @cspell/cspell-bundled-dicts in providing multi-language support but differs in its use of WebAssembly for performance optimization.
Cspell Bundled Dictionaries
This package contains all the dictionaries bundled with cspell.
It has been pull into its own package to make it easier to Webpack cspell.
Webpack
Example webpack.config.js
modification:
externals: [
/^@cspell\/cspell-bundled-dicts/,
],
Example: package.json
:
"devDependencies": {
"cspell": "^5",
},
"dependencies": {
"@cspell/cspell-bundled-dicts": "^5"
}
See streetsidesoftware/cspell-action