@furifont/dictionary 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/dictionary.json +11 -0
- package/data/manual/jr-stations.json +4033 -0
- package/data/manual/yojijukugo.json +2043 -0
- package/data/tatoeba.json +1 -0
- package/dist/index.mjs +79 -2
- package/dist/jr-stations-Rjpbmev2.mjs +4036 -0
- package/dist/yojijukugo-B8mguWRF.mjs +2046 -0
- package/package.json +4 -3
package/data/tatoeba.json
CHANGED
|
@@ -12796,6 +12796,7 @@
|
|
|
12796
12796
|
["魔法使い","0:ま;1:ほう;2:つか",1],
|
|
12797
12797
|
["魔法瓶","0:ま;1:ほう;2:びん",2],
|
|
12798
12798
|
["魔力","0:ま;1:りょく",4],
|
|
12799
|
+
["麻雀","0:まー;1:じゃん",9],
|
|
12799
12800
|
["麻薬","0:ま;1:やく",19],
|
|
12800
12801
|
["埋める","0:う",15],
|
|
12801
12802
|
["埋もれる","0:う",3],
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,79 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
+
//#region src/manual/mahjong-yaku.ts
|
|
3
|
+
/**
|
|
4
|
+
* The yaku (scoring hands) and tiles of Japanese riichi mahjong, as the Japan
|
|
5
|
+
* Professional Mahjong League lists them: https://www.ma-jan.or.jp/activity/yaku.html
|
|
6
|
+
* Each name reads in katakana there; here it is hiragana, in inline notation.
|
|
7
|
+
* Their readings are jargon (立直 りーち, 七対子 ちーといつ), so they only fill runs
|
|
8
|
+
* that no common word claims.
|
|
9
|
+
*/
|
|
10
|
+
const MAHJONG_YAKU = [
|
|
11
|
+
"門[めん]前[ぜん]清[ちん]自[つ]摸[も]和[ほー]",
|
|
12
|
+
"立[りー]直[ち]",
|
|
13
|
+
"平[ぴん]和[ふ]",
|
|
14
|
+
"断[たん]么九[やお]",
|
|
15
|
+
"役[やく]牌[はい]",
|
|
16
|
+
"三[さん]元[げん]牌[はい]",
|
|
17
|
+
"場[ば]風[かぜ]牌[はい]",
|
|
18
|
+
"自[じ]風[かぜ]牌[はい]",
|
|
19
|
+
"連[れん]風[ぷう]牌[はい]",
|
|
20
|
+
"客[きゃく]風[ふう]牌[はい]",
|
|
21
|
+
"一[いー]盃[ぺー]口[こー]",
|
|
22
|
+
"嶺[りん]上[しゃん]開[かい]花[ほー]",
|
|
23
|
+
"搶[ちゃん]槓[かん]",
|
|
24
|
+
"槍[ちゃん]槓[かん]",
|
|
25
|
+
"海[はい]底[てい]摸[もー]月[ゆえ]",
|
|
26
|
+
"河[ほー]底[てい]撈[らお]魚[ゆい]",
|
|
27
|
+
"一[いっ]発[ぱつ]",
|
|
28
|
+
"三[さん]色[しょく]同[どう]順[じゅん]",
|
|
29
|
+
"一[いっ]気[き]通[つう]貫[かん]",
|
|
30
|
+
"七[ちー]対[とい]子[つ]",
|
|
31
|
+
"対[とい]々[とい]和[ほー]",
|
|
32
|
+
"三[さん]暗[あん]刻[こう]",
|
|
33
|
+
"三[さん]色[しょく]同[どう]刻[こう]",
|
|
34
|
+
"混全帯么九[ちゃんた]",
|
|
35
|
+
"三[さん]槓[かん]子[つ]",
|
|
36
|
+
"小[しょう]三[さん]元[げん]",
|
|
37
|
+
"混[ほん]老[ろう]頭[とう]",
|
|
38
|
+
"混一色[ほんいつ]",
|
|
39
|
+
"純全帯么九[じゅんちゃん]",
|
|
40
|
+
"二[りゃん]盃[ぺー]口[こー]",
|
|
41
|
+
"清一色[ちんいつ]",
|
|
42
|
+
"国[こく]士[し]無[む]双[そう]",
|
|
43
|
+
"四[すー]暗[あん]刻[こう]",
|
|
44
|
+
"四[すー]暗[あん]刻[こう]単[たん]騎[き]",
|
|
45
|
+
"大[だい]三[さん]元[げん]",
|
|
46
|
+
"字[つー]一[いー]色[そー]",
|
|
47
|
+
"小[しょう]四[すー]喜[しー]",
|
|
48
|
+
"大[だい]四[すー]喜[しー]",
|
|
49
|
+
"清[ちん]老[ろう]頭[とう]",
|
|
50
|
+
"緑[りゅー]一[いー]色[そー]",
|
|
51
|
+
"九[ちゅー]蓮[れん]宝[ぽう]燈[とう]",
|
|
52
|
+
"純[じゅん]正[せい]九[ちゅー]蓮[れん]宝[ぽう]燈[とう]",
|
|
53
|
+
"四[すー]槓[かん]子[つ]",
|
|
54
|
+
"天[てん]和[ほー]",
|
|
55
|
+
"地[ち]和[ほー]",
|
|
56
|
+
"役[やく]満[まん]",
|
|
57
|
+
"赤[あか]牌[はい]"
|
|
58
|
+
];
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/manual/index.ts
|
|
61
|
+
const NotationsSchema = v.array(v.string());
|
|
62
|
+
/**
|
|
63
|
+
* Word lists kept by hand, by source name, in inline notation. A source is a
|
|
64
|
+
* list written in this directory, or a file under `data/manual/` that a script
|
|
65
|
+
* compiled from a web page, which bundlers split into a lazy chunk. Add a
|
|
66
|
+
* source here and a build includes it, unless its plan lists the sources it wants.
|
|
67
|
+
*/
|
|
68
|
+
const MANUAL_SOURCES = {
|
|
69
|
+
"mahjong-yaku": async () => MAHJONG_YAKU,
|
|
70
|
+
"yojijukugo": async () => v.parse(NotationsSchema, (await import("./yojijukugo-B8mguWRF.mjs")).default),
|
|
71
|
+
"jr-stations": async () => v.parse(NotationsSchema, (await import("./jr-stations-Rjpbmev2.mjs")).default)
|
|
72
|
+
};
|
|
73
|
+
async function loadManualSources() {
|
|
74
|
+
return Object.fromEntries(await Promise.all(Object.entries(MANUAL_SOURCES).map(async ([name, load]) => [name, await load()])));
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
2
77
|
//#region src/overrides.ts
|
|
3
78
|
/**
|
|
4
79
|
* Readings that override the compiled data where it ranks them wrong, in inline notation. JMdict's
|
|
@@ -68,11 +143,12 @@ async function readData(name, schema) {
|
|
|
68
143
|
}
|
|
69
144
|
/** Loads the compiled dictionary: JMdict and JMnedict place names, aligned by JmdictFurigana, with KANJIDIC2's on'yomi, JLPT levels and uses in Tatoeba's sentences. */
|
|
70
145
|
async function loadDictionary() {
|
|
71
|
-
const [data, places, jlpt, tatoeba] = await Promise.all([
|
|
146
|
+
const [data, places, jlpt, tatoeba, manual] = await Promise.all([
|
|
72
147
|
readData("dictionary", DataSchema),
|
|
73
148
|
readData("places", PlacesSchema),
|
|
74
149
|
readData("jlpt", JlptSchema),
|
|
75
|
-
readData("tatoeba", TatoebaSchema)
|
|
150
|
+
readData("tatoeba", TatoebaSchema),
|
|
151
|
+
loadManualSources()
|
|
76
152
|
]);
|
|
77
153
|
const levels = new Map(jlpt.map(([form, furigana, level]) => [`${form}|${furigana}`, level]));
|
|
78
154
|
const uses = new Map(tatoeba.map(([form, furigana, n]) => [`${form}|${furigana}`, n]));
|
|
@@ -81,6 +157,7 @@ async function loadDictionary() {
|
|
|
81
157
|
onyomi: data.onyomi,
|
|
82
158
|
defaults: OVERRIDE_READINGS,
|
|
83
159
|
bare: BARE_FORMS,
|
|
160
|
+
manual,
|
|
84
161
|
places: places.map(([form, furigana]) => ({
|
|
85
162
|
form,
|
|
86
163
|
furigana
|