Home

Awesome

<!-- lint disable no-html -->

dictionaries

Collection of normalized and installable hunspell dictionaries.

Contents

What is this?

This monorepo is a bunch of scripts that crawls dictionaries from several sources, normalizes them, and packs them so that they can each be installed and used in one single way. Dictionaries are not maintained here but they are usable from here.

When should I use this?

You can particularly use the packages here as a programmer when integrating with other tools (such as nodehun or nspell) or when making such tools.

Install

These packages are ESM only. In Node.js (version 16+), install with npm:

npm install dictionary-en

👉 Note: replace en with the language code you want.

⚠️ Important: this project itself is MIT, but each index.dic and index.aff file still has its original license!

Use

import en from 'dictionary-en'

console.log(en)
// To do: use `en` somehow

Yields:

{aff: <Buffer>, dic: <Buffer>}

List of dictionaries

👉 Note: preferred BCP-47 codes are used (according to Unicode CLDR). To illustrate, as American English and Brazilian Portuguese are the most common types of English and Portuguese respectively, they get the codes en and pt.

<!--support start-->

In total 92 dictionaries are provided.

NameDescriptionLicense
dictionary-bgBulgarian(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)
dictionary-brBreton(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)
dictionary-caCatalan(GPL-2.0 OR LGPL-2.1)
dictionary-ca-valenciaCatalan (Valencia)(GPL-2.0 OR LGPL-2.1)
dictionary-csCzechGPL-2.0
dictionary-cyWelshLGPL-3.0
dictionary-daDanish(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)
dictionary-deGerman(GPL-2.0 OR GPL-3.0)
dictionary-de-atGerman (Austria)(GPL-2.0 OR GPL-3.0)
dictionary-de-chGerman (Switzerland)(GPL-2.0 OR GPL-3.0)
dictionary-elGreek(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)
dictionary-el-polytonGreek (Polyton)GPL-3.0
dictionary-enEnglish(MIT AND BSD)
dictionary-en-auEnglish (Australia)(MIT AND BSD)
dictionary-en-caEnglish (Canada)(MIT AND BSD)
dictionary-en-gbEnglish (United Kingdom)(MIT AND BSD)
dictionary-en-zaEnglish (South Africa)LGPL-2.1
dictionary-eoEsperantoGPL-2.0
dictionary-esSpanish(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-arSpanish (Argentina)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-boSpanish (Bolivia)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-clSpanish (Chile)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-coSpanish (Colombia)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-crSpanish (Costa Rica)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-cuSpanish (Cuba)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-doSpanish (Dominican Republic)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-ecSpanish (Ecuador)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-gtSpanish (Guatemala)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-hnSpanish (Honduras)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-mxSpanish (Mexico)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-niSpanish (Nicaragua)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-paSpanish (Panama)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-peSpanish (Peru)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-phSpanish (Philippines)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-prSpanish (Puerto Rico)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-pySpanish (Paraguay)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-svSpanish (El Salvador)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-usSpanish (United States of America)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-uySpanish (Uruguay)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-es-veSpanish (Venezuela)(GPL-3.0 OR LGPL-3.0 OR MPL-1.1)
dictionary-etEstonianLGPL-2.1
dictionary-euBasqueGPL-2.0
dictionary-faPersianApache-2.0
dictionary-foFaroese(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)
dictionary-frFrenchMPL-2.0
dictionary-furFriulianGPL-2.0
dictionary-fyWestern FrisianGPL-3.0
dictionary-gaIrishGPL-2.0
dictionary-gdScottish GaelicGPL-3.0
dictionary-glGalicianGPL-3.0
dictionary-heHebrewAGPL-3.0
dictionary-hrCroatian(LGPL-2.1 OR SISSL)
dictionary-huHungarian(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)
dictionary-hyArmenian(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)
dictionary-hywWestern Armenian(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)
dictionary-iaInterlinguaGPL-3.0
dictionary-ieInterlingueApache-2.0
dictionary-isIcelandicCC-BY-SA-3.0
dictionary-itItalianGPL-3.0
dictionary-kaGeorgianMIT
dictionary-koKorean(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)
dictionary-laLatinGPL-2.0
dictionary-lbLuxembourgishEUPL-1.1
dictionary-ltLithuanianBSD-3-Clause
dictionary-ltgLatgalianLGPL-2.1
dictionary-lvLatvianLGPL-2.1
dictionary-mkMacedonianGPL-3.0
dictionary-mnMongolianLPPL-1.3c
dictionary-nbNorwegian BokmĂĄlGPL-2.0
dictionary-ndsLow GermanGPL-3.0
dictionary-neNepaliLGPL-2.1
dictionary-nlDutch(BSD-3-Clause OR CC-BY-3.0)
dictionary-nnNorwegian NynorskGPL-2.0
dictionary-ocOccitanGPL-2.0
dictionary-plPolish(GPL-3.0 OR LGPL-3.0 OR MPL-2.0)
dictionary-ptPortuguese(LGPL-3.0 OR MPL-2.0)
dictionary-pt-ptPortuguese (Portugal)(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)
dictionary-roRomanian(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)
dictionary-ruRussianBSD-3-Clause
dictionary-rwKinyarwandaGPL-3.0
dictionary-skSlovak(GPL-2.0 OR LGPL-2.1 OR MPL-1.1)
dictionary-slSlovenian(GPL-3.0 OR LGPL-2.1)
dictionary-srSerbian(GPL-2.0 OR LGPL-2.1 OR MPL-1.1 OR CC-BY-SA-3.0)
dictionary-sr-latnSerbian (Latin script)(GPL-2.0 OR LGPL-2.1 OR MPL-1.1 OR CC-BY-SA-3.0)
dictionary-svSwedishLGPL-3.0
dictionary-sv-fiSwedish (Finland)LGPL-3.0
dictionary-tkTurkmenApache-2.0
dictionary-tlhKlingonApache-2.0
dictionary-tlh-latnKlingon (Latin script)Apache-2.0
dictionary-trTurkishMIT
dictionary-ukUkrainianGPL-3.0
dictionary-viVietnameseGPL-2.0
<!--support end-->

Examples

Example: use with nspell

This example uses dictionary-en in combination with nspell.

<details><summary>Show install command for this example</summary>
npm install dictionary-en nspell
</details>
import en from 'dictionary-en'
import nspell from 'nspell'

const spell = nspell(en)
console.log(spell.correct('color'))
console.log(spell.correct('colour'))

Yields:

true
false

Example: load files

This example loads the index.dic and index.aff files located in dictionary-hyw (Western Armenian) from a Node.js JavaScript module (ESM).

It uses a ponyfill (import-meta-resolve) for an experimental Node API.

<details><summary>Show install command for this example</summary>
npm install dictionary-hyw import-meta-resolve
</details>
import fs from 'node:fs/promises'
import {resolve} from 'import-meta-resolve'

const base = await resolve('dictionary-hyw', import.meta.url)
const aff = await fs.readFile(new URL('index.aff', base))
const dic = await fs.readFile(new URL('index.dic', base))
console.log(aff, dic)
<!--Old name of the following section:-->

<a name="macos"></a>

Example: use with macOS

Follow these steps to use a dictionary on macOS:

  1. navigate to the dictionary you want on GitHub, such as dictionaries/$code (replace $code with the language code you want)
  2. download the index.aff and index.dic files (as in open them, right-click “Raw”, and “download linked files”)
  3. rename the download files to $code.aff and $code.dic
  4. move $code.aff and $code.dic into the folder ~/Library/Spelling/
  5. go to System Preferences > Keyboard > Text > Spelling and select your added language (it should come with the (Library) suffix and is situated at the bottom)

Types

The packages are typed with TypeScript.

Security

These packages are safe.

Contribute

Yes please! See How to Contribute to Open Source.

Build

To build this project, on macOS, you at least need to install:

👉 Note: sed and the GNU replacements should be setup in PATH to overwrite macOS defaults.

Updating a dictionary

Dictionaries are not maintained here. Report problems upstream.

Adding a new dictionary

Dictionaries are not maintained here. Most languages have a small community or institute that maintains a dictionary, and they often do so on GitHub or similar. Please ask in the issues to request that such a dictionary is included here.

👉 Note: acceptable dictionaries must:

License

MIT © Titus Wormer

See license files in each dictionary for the licensing of index.dic and index.aff files.