Skip to content

Commit

Permalink
fix: Use Mongolian dictionary from wooorm/dictionaries (#4116)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S authored Feb 22, 2025
1 parent 83970ed commit 77932b2
Show file tree
Hide file tree
Showing 16 changed files with 16,089 additions and 22,578 deletions.
7 changes: 4 additions & 3 deletions dictionaries/mn_MN/checksum.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
5080c13d61bf60137bfb8f8c6b8e96c2db05f5a3 dict/mn-mn.trie
739b662b85481c70956640f8f1d831a039c26155 src/mn_MN.aff
13448fd57a5daa61ce27149a6f323ec76f25269a src/mn_MN.dic
e90c354ed223fb0a8d2b604b2358e6d62a37db0e dict/mn-mn.trie
01b3cc8b21ed8e943b2b22d554f19b6b1abde040 src/additional-words.txt
b786697b4e3e589f17f97a9af799a7e75be1fd62 src/hunspell/index.aff
1ffeb349473e17bd44fef97284b606d0f48c566b src/hunspell/index.dic
29 changes: 3 additions & 26 deletions dictionaries/mn_MN/cspell-ext.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,21 @@
// cSpell Settings
{
"id": "mn-mn",
"version": "0.2",
"name": "Mongolian",
"description": "Mongolian dictionary for cspell.",
"readonly": true,
// List of dictionary files to add to the global list of dictionaries
"dictionaryDefinitions": [
{
"name": "mn-mn",
"path": "./dict/mn-mn.trie",
"description": "Mongolian dictionary for cspell."
"path": "./dict/mn-mn.trie.gz",
"description": "Mongolian dictionary."
}
],
// Dictionaries to always be used.
// Generally left empty
"dictionaries": [],
// Language Rules to apply to matching files.
// Files are matched on `languageId` and `locale`
"languageSettings": [
{
// VSCode languageId. i.e. typescript, java, go, cpp, javascript, markdown, latex
// * will match against any file type.
"languageId": "*",
// Language locale. i.e. en-US, de-AT, or ru. * will match all locales.
// Multiple locales can be specified like: "en, en-US" to match both English and English US.
"locale": "mn,mn-MN",
// By default the whole text of a file is included for spell checking
// Adding patterns to the "includeRegExpList" to only include matching patterns
"includeRegExpList": [],
// To exclude patterns, add them to "ignoreRegExpList"
"ignoreRegExpList": [],
// regex patterns than can be used with ignoreRegExpList or includeRegExpList
// Example: "pattern": [{ "name": "mdash", "pattern": "—" }]
// This could be included in "ignoreRegExpList": ["mdash"]
"patterns": [],
// List of dictionaries to enable by name in `dictionaryDefinitions`
"dictionaries": ["mn-mn"],
// Dictionary definitions can also be supplied here. They are only used iff "languageId" and "locale" match.
"dictionaryDefinitions": []
"dictionaries": ["mn-mn"]
}
]
}
5 changes: 3 additions & 2 deletions dictionaries/mn_MN/cspell-tools.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
targets:
- name: 'mn-mn'
sources:
- filename: 'src/mn_MN.dic'
maxDepth: 1 # This is set to 1 to prevent initial builds from taking too long.
- filename: 'src/hunspell/index.dic'
maxDepth: 1 # This is set to 1 to prevent builds from taking too long.
- src/additional-words.txt
format: 'trie3'
targetDirectory: './dict'
generateNonStrict: true
Expand Down
3 changes: 2 additions & 1 deletion dictionaries/mn_MN/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
],
"import": [
"./cspell-ext.json"
]
],
"ignorePaths": ["src/hunspell"]
}
29,652 changes: 14,708 additions & 14,944 deletions dictionaries/mn_MN/dict/mn-mn.trie

Large diffs are not rendered by default.

18 changes: 10 additions & 8 deletions dictionaries/mn_MN/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"name": "@cspell/dict-mn-mn",
"version": "1.0.0",
"description": "Mongolian dictionary for cspell. -- Private until verified",
"private": true,
"description": "Mongolian dictionary for cspell.",
"publishConfig": {
"access": "public",
"provenance": true
Expand All @@ -14,11 +13,13 @@
},
"scripts": {
"build": "cross-env NODE_OPTIONS=--max_old_space_size=8192 cspell-tools-cli build",
"test": "hunspell-reader words -n 1000 -m 0 \"src/mn_MN.dic\" | cspell -c ./cspell-ext.json \"--locale=mn,mn-MN\" \"--languageId=*\" stdin",
"test": "pnpm test:words && pnpm test:samples",
"test:samples": "cspell samples",
"test:words": "hunspell-reader words -n 1000 -m 0 \"src/hunspell/index.dic\" | cspell -c ./cspell-ext.json \"--locale=mn,mn-MN\" \"--languageId=*\" stdin",
"prepublishOnly": "pnpm run conditional-build && pnpm test",
"prepare:dictionary": "cspell-tools-cli gzip \"dict/*.trie\"",
"conditional-build": "pnpm run sync && pnpm run build --conditional",
"sync": "pnpm cpy \"node_modules/dictionary-ru/**\" src/"
"conditional-build": "pnpm run sync && pnpm run build --conditional && pnpm run prepare:dictionary",
"sync": "pnpm cpy \"node_modules/dictionary-mn/*\" src/hunspell"
},
"repository": {
"type": "git",
Expand All @@ -39,10 +40,11 @@
"url": "https://github.com/streetsidesoftware/cspell-dicts/issues"
},
"homepage": "https://github.com/streetsidesoftware/cspell-dicts/blob/main/dictionaries/mn_MN#readme",
"devDependencies": {},
"dependencies": {},
"devDependencies": {
"dictionary-mn": "^3.0.0"
},
"files": [
"dict/mn-mn.trie",
"dict/mn-mn.trie.gz",
"cspell-ext.json",
"*.js",
"*.d.ts"
Expand Down
14 changes: 14 additions & 0 deletions dictionaries/mn_MN/samples/sample.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Улаанбаатар - Ulaanbaatar

[Улаанбаатар — Википедиа нэвтэрхий толь](https://mn.wikipedia.org/wiki/%D0%A3%D0%BB%D0%B0%D0%B0%D0%BD%D0%B1%D0%B0%D0%B0%D1%82%D0%B0%D1%80)

Улаанбаатар (ᠤᠯᠠᠭᠠᠨᠪᠠᠭᠠᠲᠤᠷ улаганбагатур, улаан-баа-тар) нь Монгол Улсын нийслэл бөгөөд Монгол Улсын цорын ганц саятан хот юм.

Улаанбаатар хот Монгол Улсын төв хэсэгт хуучнаар Алтан тэвшийн хөндий, өнөөгийнхөөр Туул-Сэлбийн гол бэлчир хөндийд, далайн түвшнээс дээш 1300-1350 метр өндөрт Богд хан, Сонгино хайрхан, Чингэлтэй уул, Баянзүрх дөрвөн уулаар хүрээлэгдэн орших ба 4,704.4 км2 нутаг дэвсгэртэй. 2021 оны эцсээр 1,649,172 хүн оршин сууж байна. Засаг захиргааны хувьд 9 дүүрэг, 204 хороонд хуваагддаг.

1639 онд Ширээт цагаан нуурт Өндөр гэгээнийг залж орд өргөө боссоноор Улаанбаатар хотын өмнөх суурин байгуулагджээ. 1778 он хүртэл олон газар нүүдэллэж байгаад одоогийн байрлалдаа тогтсон. Өмнө нь шашин, худалдааны төв байсан бол 1912 оноос улсын нийслэл болж[4], XX зуунд барилгажиж, аж үйлдвэр хөгжин, XXI зуунд их хотын төрх бүрдэж байна. Улаанбаатар Монгол Улсын улс төр, эдийн засаг, соёл, технологийн төв юм. Түгжрэл утаа маш ихтэй.

<!--
cspell:locale en,mn
cspell:words Ulaanbaatar улаганбагатур ᠤᠯᠠᠭᠠᠨᠪᠠᠭᠠᠲᠤᠷ
-->
8 changes: 8 additions & 0 deletions dictionaries/mn_MN/src/additional-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Please add additional words below
Википедиа
өнөөгийнхөөр
түвшнээс
дэвсгэртэй
боссоноор
Википедиа
байрлалдаа
Loading

0 comments on commit 77932b2

Please sign in to comment.