Skip to content

Commit

Permalink
feat: Update Spanish dictionary (#1077)
Browse files Browse the repository at this point in the history
* feat: Update Spanish dictionary
* docs: add information for add new words
* feat: create additional_words.txt for spanish dictionary
* Move Additional words to the right place
* Update additional_words.txt
* Add suggestion maps from `index.aff`
* Do not spell check hunspell src

Co-authored-by: Fernando López Moreno <50037244+koficoud@users.noreply.github.com>
  • Loading branch information
Jason3S and koficoud committed May 4, 2022
1 parent 9cbbbee commit beca796
Show file tree
Hide file tree
Showing 20 changed files with 13,296 additions and 22,001 deletions.
714 changes: 693 additions & 21 deletions dictionaries/es_ES/LICENSE

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions dictionaries/es_ES/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ Building is only necessary if you want to modify the contents of the dictionary.
npm run build
```

## Adding Words

Please add any words to [src/additional_words.txt](./src/additional_words.txt) by making a pull request.

## Resources

The Hunspell source for this dictionary can be found:
Expand Down
Binary file modified dictionaries/es_ES/Spanish.trie.gz
Binary file not shown.
191 changes: 0 additions & 191 deletions dictionaries/es_ES/Spanish.txt

This file was deleted.

6 changes: 6 additions & 0 deletions dictionaries/es_ES/checksum.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
f8ffd462c0991b024b9b3fb58ded6f588099f255 ./Spanish.trie.gz
e9852fedec06e16eadf561a89fcfc4352800f320 ./source-dependencies.txt
30b5a9cd705505c82b9d576840d32cf6c83c352f ./source-files.txt
942c6fb2ca5fd83d0eeee1fdf50e81b2e766b60f ./src/additional_words.txt
50acae0932a1576ccb76393db2f7cd495e53e376 ./src/hunspell/index.aff
8f93fdb38bd02bfbfab931916773cc048cadd84d ./src/hunspell/index.dic
24 changes: 23 additions & 1 deletion dictionaries/es_ES/cspell-ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,29 @@
{
"name": "es-es",
"path": "./Spanish.trie.gz",
"description": "Spanish Dictionary (Spain)"
"description": "Spanish Dictionary (Spain)",
"dictionaryInformation": {
"locale": "es-ES",
"alphabet": "a-zA-ZóíjáéñúüÓÍÁÉÑÚÜ",
"suggestionEditCosts": [
{
"map": "MAP eéèëêEÉ|aáàAÁ|iíìïîIÍ|oóòöôOÓ|uüúùûUÚÜ",
"replace": 1
},
{
"map": "(ás)(az)|(cc)(x)|(és)(ez)|(güe)(hue)|(güi)(hui)",
"replace": 75
},
{
"map": "(ís)(iz)|(ío)(ido)|(ke)(que)|(ki)(qui)",
"replace": 75
},
{
"map": "(ll)(y)|(mb)(nv)|(seci)(cesi)|(vámonos)(vayámonos)",
"replace": 75
}
]
}
}
],
"dictionaries": [],
Expand Down
31 changes: 31 additions & 0 deletions dictionaries/es_ES/cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
id: "es-es"
version: "0.2"
readonly: true
name: "Spanish Dictionary (Spain)"
description: "Spanish Dictionary (Spain)"
dictionaryDefinitions:
- name: "es-es"
path: "./Spanish.trie.gz"
description: "Spanish Dictionary (Spain)"
dictionaryInformation:
locale: "es-ES"
# cspell:ignore ZóíjáéñúüÓÍÁÉÑÚÜ
alphabet: a-zA-ZóíjáéñúüÓÍÁÉÑÚÜ
suggestionEditCosts:
# cspell:ignore eéèëê iíìïî oóòöô uüúùû
- map: MAP eéèëêEÉ|aáàAÁ|iíìïîIÍ|oóòöôOÓ|uüúùûUÚÜ
replace: 1
- map: (ás)(az)|(cc)(x)|(és)(ez)|(güe)(hue)|(güi)(hui)
replace: 75
- map: (ís)(iz)|(ío)(ido)|(ke)(que)|(ki)(qui)
replace: 75
# cspell:ignore seci cesi vámonos vayámonos
- map: (ll)(y)|(mb)(nv)|(seci)(cesi)|(vámonos)(vayámonos)
replace: 75
dictionaries: []
languageSettings:
- languageId: "*"
locale: "es, es_ES"
caseSensitive: true
dictionaries: ["es-es"]
15 changes: 4 additions & 11 deletions dictionaries/es_ES/cspell.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
{
"files": [
"**/*.{md,txt}"
],
"ignorePaths": [
"*.aff",
"*.dic",
"cspell-ext.json"
],
"files": ["**/*.{md,txt}"],
"ignorePaths": ["cspell-ext.json", "src/hunspell"],
"language": "en,es",
"import": [
"./cspell-ext.json"
],
"import": ["./cspell-ext.json"],
"caseSensitive": true,
"ignoreWords": [
"Alexandro",
Expand All @@ -25,6 +17,7 @@
"Garrone",
"Gelbort",
"gmail",
"hunspell",
"HYPH",
"KNTRO",
"LGPL",
Expand Down
25 changes: 20 additions & 5 deletions dictionaries/es_ES/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,20 @@
"./cspell-ext.json": "./cspell-ext.json"
},
"scripts": {
"build": "cspell-tools-cli compile --trie3 -x compound \"src/hunspell/Spanish.dic\" -o .",
"test": "hunspell-reader words -n 1000 \"src/hunspell/Spanish.dic\" | cspell -v -c ./cspell-ext.json --local=es --languageId=* stdin",
"#build": "cspell-tools-cli compile --trie3 -x compound \"src/hunspell/Spanish.dic\" -o .",
"#test": "hunspell-reader words -n 1000 \"src/hunspell/Spanish.dic\" | cspell -v -c ./cspell-ext.json --local=es --languageId=* stdin",
"#prepublishOnly": "echo pre-publish",
"cspell-yaml-to-json": "yarn -s yaml2json -p cspell.config.yaml > cspell-ext.json && yarn lint",
"build": "yarn run compile",
"sync": "yarn cpy \"../../node_modules/dictionary-es/**\" src/hunspell",
"checksum": "shasum -c checksum.txt",
"compile": "cat source-files.txt | xargs cspell-tools-cli compile --trie3 -x compound --merge Spanish -o . && yarn run gen-checksum",
"conditional-build": "yarn run sync && yarn run --silent checksum || yarn run build",
"gen-checksum": "cat source-files.txt source-dependencies.txt | sort -u | xargs shasum > checksum.txt",
"lint": "yarn prettier -w \"*.{yaml,json}\"",
"test-dict": "hunspell-reader words -n 1000 \"src/hunspell/index.dic\" | cspell -v -c ./cspell-ext.json --local=es --languageId=* stdin",
"test-text": "cspell",
"test": "yarn run test-dict && yarn run test-text",
"prepublishOnly": "echo pre-publish"
},
"repository": {
Expand All @@ -27,14 +39,17 @@
"spelling"
],
"author": "Jason Dent",
"license": "MIT",
"license": "GPL-3.0-or-later",
"bugs": {
"url": "https://github.com/streetsidesoftware/cspell-dicts/issues"
},
"homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/es_ES#readme",
"files": [
"Spanish.trie.gz",
"cspell-ext.json",
"Spanish.txt"
]
"src/hunspell/license"
],
"devDependencies": {
"dictionary-es": "^3.2.0"
}
}
5 changes: 5 additions & 0 deletions dictionaries/es_ES/source-dependencies.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
./Spanish.trie.gz
./source-dependencies.txt
./source-files.txt
./src/additional_words.txt
./src/hunspell/index.aff
2 changes: 2 additions & 0 deletions dictionaries/es_ES/source-files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
./src/additional_words.txt
./src/hunspell/index.dic
2 changes: 2 additions & 0 deletions dictionaries/es_ES/src/additional_words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# When adding words to the CSpell Spanish dictionary via a pull request,
# Please add the words to this file, one term per line.
Loading

0 comments on commit beca796

Please sign in to comment.