Skip to content

Commit

Permalink
添加(db): pmim_sys-0.db 不含词库
Browse files Browse the repository at this point in the history
  • Loading branch information
secext2022 committed Mar 11, 2024
1 parent 6df48eb commit 5619b99
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: CI

on:
push:
branches: [ "main" ]
branches:
- main

jobs:
build:
Expand All @@ -26,6 +27,13 @@ jobs:
name: debug-tmp
path: debug-tmp.tar.zst

# `pmim_sys-0.db.zst` (不含词库)
- run: zstd -19 tmp/pmim_sys-0.db -o tmp/pmim_sys-0.db.zst
- uses: actions/upload-artifact@v4
with:
name: pmim_sys-0.db
path: tmp/pmim_sys-0.db.zst

# `pmim_sys.db.zst`
- run: zstd -19 tmp/pmim_sys.db -o tmp/pmim_sys.db.zst
- uses: actions/upload-artifact@v4
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# 默认目标
tmp/pmim_sys.db: tmp tmp/pinyin_diff.txt tmp/2017.db
deno run -A --unstable-kv tool/gen_db_sys.js tmp/pmim_sys.db .
cp tmp/pmim_sys.db tmp/pmim_sys-0.db
sqlite3 tmp/2017.db "select * from dict_2017 order by c desc" | deno run -A --unstable-kv tool/gen_db_sys_dict.js tmp/pmim_sys.db

# 创建 tmp/ 目录
Expand Down
7 changes: 7 additions & 0 deletions doc/pmim_db_sys.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,17 @@
"v8": "12.1.285.27",
"typescript": "5.3.3"
},
"n": "胖喵拼音内置数据库 (6w)",
"_last_update": "2024-02-29T22:30:23.595Z"
}
```

- `n`: 数据库名称 (用户可读)

- (可选) `["pmim_db", "sys_dict_nc"]` = `1`

配置标记: 词库没有词的频率数据. 根据汉字平均频率估算词的频率.

### 2 预加载

启动时加载一次, 然后常驻内存.
Expand Down
1 change: 1 addition & 0 deletions tool/gen_db_sys.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ async function 元数据(kv) {
await kv.set(["pmim_db", "v"], {
pmim: PMIM_VERSION,
deno_version: Deno.version,
n: "胖喵拼音内置数据库 (6w)",
_last_update: new Date().toISOString(),
});
}
Expand Down

0 comments on commit 5619b99

Please sign in to comment.