https://github.com/razum2um/yaspeller-dictionary-builder
π€ spelling exceptions builder for lazy people
https://github.com/razum2um/yaspeller-dictionary-builder
dictionary hacktoberfest pymorphy2 spellcheck
Last synced: about 1 year ago
JSON representation
π€ spelling exceptions builder for lazy people
- Host: GitHub
- URL: https://github.com/razum2um/yaspeller-dictionary-builder
- Owner: razum2um
- Created: 2021-10-31T18:44:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-10-31T19:44:01.000Z (over 4 years ago)
- Last Synced: 2025-03-29T05:41:38.386Z (about 1 year ago)
- Topics: dictionary, hacktoberfest, pymorphy2, spellcheck
- Language: Python
- Homepage:
- Size: 8.79 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Yaspeller Dictionary (Auto)builder
[](https://github.com/razum2um/yaspeller-dictionary-builder/actions/workflows/python.yml)
## Usage
```sh
# this sample command generates `./yaspeller_report.json`
# yaspeller --report json --ignore-digits --ignore-text "'.*" --ignore-latin --only-errors --file-extensions ".md" --lang ru
python -m venv env
source env/bin/activate
pip install
python src/dictionary.py yaspeller_report.json
```
## Why
[Yaspeller](https://github.com/hcodes/yaspeller) is nice, but there are too many anglicisms in a usual documentation.
Normally you just want to ignore that, but there's the only possibility to add a regexp-array to ignore words.
This generates a array of dictionary words including all lexems for all cases like
```
[
"[Π±Π]Π°Π³(Π°|Π°ΠΌ|Π°ΠΌΠΈ|Π°Ρ
|Π΅|ΠΈ|ΠΎΠ²|ΠΎΠΌ|Ρ)?",
"[Π΄Π]ΠΈΡΡ(Π°|Π°ΠΌ|Π°ΠΌΠΈ|Π°Ρ
|Π΅|ΠΎΠ²|ΠΎΠΌ|Ρ|Ρ)?",
"[ΠΊΠ]ΠΎΠΌΠΌΠΈΡ(Π°|Π°ΠΌ|Π°ΠΌΠΈ|Π°Ρ
|Π΅|ΠΎΠ²|ΠΎΠΌ|Ρ|Ρ)?",
"[ΠΏΠ]Π°ΡΡΠΈΠ½Π³(Π°|Π°ΠΌ|Π°ΠΌΠΈ|Π°Ρ
|Π΅|ΠΈ|ΠΎΠ²|ΠΎΠΌ|Ρ)?",
"[ΡΠ ]ΡΠ±ΠΈΡΡ(Π°|Π°ΠΌ|Π°ΠΌΠΈ|Π°Ρ
|Π΅|ΠΎΠ²|ΠΎΠΌ|Ρ|Ρ)?",
"[ΡΠ‘]Π°ΠΌΠΎΠΎΡΠ³Π°Π½ΠΈΠ·ΠΎΠ²Π°Π½Π½(ΠΎΠ³ΠΎ|ΠΎΠΌ|ΠΎΠΌΡ|ΡΡ|ΡΠ΅|ΡΠΉ|ΡΠΌ|ΡΠΌΠΈ|ΡΡ
)",
"[ΡΠ’]ΠΈΠΊΠ΅Ρ(Π°|Π°ΠΌ|Π°ΠΌΠΈ|Π°Ρ
|Π΅|ΠΎΠ²|ΠΎΠΌ|Ρ|Ρ)?",
"ΠΊΠΎΠΌΠΌΠΈΡΠΈΡΡ"
]
```
from yaspeller errors (in text format looking like)
```
Spelling check:
β www.ruby-lang.org/ru/community/ruby-core/index.md 130 ms
-----
Typos: 9
1. ΠΏΠ°ΡΡΠΈΠ½Π³ΠΎΠΌ (36:27)
2. ΠΊΠΎΠΌΠΌΠΈΡΠΈΡΡ (68:32, suggest: ΠΊΠΎΠΌΠΈΡΠ΅Ρ)
3. Π±Π°Π³Π°Ρ
(75:15, suggest: Π±ΠΎΠ³Π°Ρ
, Π±Π°ΠΊΠ°Ρ
, Π±Π΅Π³Π°Ρ
)
4. Π±Π°Π³ΠΈ (89:24, suggest: Π±Π°Π³Π³ΠΈ)
5. Π±Π°Π³ (96:25)
6. ΡΠΈΠΊΠ΅Ρ (107:14, suggest: ΡΡΠΈΠΊΠ΅Ρ)
7. Π΄ΠΈΡΡ (115:18)
8. ΠΊΠΎΠΌΠΌΠΈΡΡ (147:24, suggest: ΠΊΠΎΠΌΠ΅ΡΡ, ΠΊΠΎΠΌΠ½Π°ΡΡ)
9. ΠΊΠΎΠΌΠΌΠΈΡΠ° (148:58, suggest: ΠΊΠΎΠΌΠ΅ΡΠ°)
-----
```
## Live example
Initially created for [www.ruby-lang.org](https://github.com/ruby/www.ruby-lang.org/pull/2720) translations spellchecking