• Stars
    star
    180
  • Rank 211,856 (Top 5 %)
  • Language
    Python
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

搜狗细胞词库转鼠须管(Rime)词库

scel2txt

搜狗细胞词库转鼠须管(Rime)词库,提供 Python3 和 Golang 实现的版本

使用

将从搜狗官方词库网站下载的 *.scel 文件放入 scel 文件夹,然后运行

Python

python3 scel2txt.py

或者下载编译好的命令 scel2txt-darwin-amd64-0.0.1.gz

gunzip scel2txt-darwin-amd64-0.0.1.gz
chmod +x scel2txt-darwin-amd64-0.0.1
./scel2txt-darwin-amd64-0.0.1

生成的文件

  • 后缀为 .txt 的同名词库文件
  • 自动合并所有 *.txt 文件到 luna_pinyin.sogou.dict.yaml

搜狗细胞词库(scel格式文件) 格式说明

按照一定格式保存的 Unicode 编码文件,其中每两个字节表示一个字符(中文汉字或者英文字母)。

主要包括两部分:

  1. 全局拼音表,在文件中的偏移值是 0x1540+4, 格式为 (py_idx, py_len, py_str)

    • py_idx: 两个字节的整数,代表这个拼音的索引
    • py_len: 两个字节的整数,拼音的字节长度
    • py_str: 当前的拼音,每个字符两个字节,总长 py_len
  2. 汉语词组表,在文件中的偏移值是 0x2628 或 0x26c4, 格式为 (word_count, py_idx_count, py_idx_data, (word_len, word_str, ext_len, ext){word_count}),其中 (word_len, word, ext_len, ext){word_count} 一共重复 word_count 次, 表示拼音的相同的词一共有 word_count 个

    • word_count: 两个字节的整数,同音词数量
    • py_idx_count: 两个字节的整数,拼音的索引个数
    • py_idx_data: 两个字节表示一个整数,每个整数代表一个拼音的索引,拼音索引数
    • word_len:两个字节的整数,代表中文词组字节数长度
    • word_str: 汉语词组,每个中文汉字两个字节,总长度 word_len
    • ext_len: 两个字节的整数,可能代表扩展信息的长度,好像都是 10
    • ext: 扩展信息,一共 10 个字节,前两个字节是一个整数(不知道是不是词频),后八个字节全是 0,ext_len 和 ext 一共 12 个字节

目前已测试的词库

参考资料

  1. scel2mmseg
  2. scel-to-txt

More Repositories

1

gost-install.ipynb

通过 Jupyter Notebook 安装 GOST
Jupyter Notebook
684
star
2

autotranslate

Videos Transcription and Translation with Faster Whisper and ChatGPT
Jupyter Notebook
233
star
3

youtube-drive

Store files as YouTube videos == infinite disk space. youtube-drive is totally inspired by YouTubeDrive.
Python
211
star
4

shanghai-lockdown-covid-19

Coronavirus (COVID-19) statistics data in Shanghai lockdown. 封控期间上海疫情数据,包括病例数、死亡数、确诊数、无症状数和疫情地址等。
HTML
159
star
5

ShadowsocksX-NG-GostPlugin

ShadowsocksX-NG 的 gost 插件脚本,方便在 ShadowsocksX-NG 中使用 gost
Shell
119
star
6

PaddleWebOCR

开源的中英文离线 OCR,使用 PaddleOCR 实现,提供了简单的 Web 页面及接口
Vue
115
star
7

chatglm2-6b-colab

Colab for chatglm2-6b
Jupyter Notebook
72
star
8

MQTT-Web-Terminal

Bring any Linux device/server to the web, whenever they have public ip or not
Python
41
star
9

bookbookgo_bot

A Telegram bot for book-searcher. Create and search books index, create your private library on Telegram.
Python
38
star
10

certbot-self-hosting

A certbot container is used similarly to acme.sh
Shell
20
star
11

Alacritty.icns

一组 Alacritty 图标
18
star
12

paipai

上海车牌沪牌拍牌助手(不能使用了,仅供参考)
Python
15
star
13

miniblog

A miniblog demo powered by web.py and rye
Python
11
star
14

meow

Meow~喵~是一个面向新手的 Git/GitHub/GitLab 团队开发协作修炼场所
Python
7
star
15

rime_dict_maker

A tool to make your rime dict
Python
7
star
16

jsmwlwedding

A simple parallax scrolling website for my wedding
SCSS
5
star
17

CN-Traffic-Tickets-Query-Adapter

A pyAdapter for querying traffic tickets in China
Python
3
star
18

picb0

Free Pictures Hosting On Github/Statically
Shell
3
star
19

nucintosh

Nucintosh - Hackintosh on Intel NUC8i5BEH/NUC8i7BEH
2
star
20

rtl8723bu

RTL8723BU WiFi Linux Driver v5.2.17.1 for Raspberry Pi
C
2
star
21

pyqt5-examples

PyQt5 示例
Python
2
star
22

WGD-gobinet

MeiG SLM750 GobiNet Driver for Linux
C
2
star
23

jwow

A very simple non-blocking http server
Java
1
star
24

tesla-instrument-panel

Instrument Panel for Tesla Model 3/Y
JavaScript
1
star
25

akoola_tv

An android app plays like a TV remote controller
Java
1
star
26

lewangdev.github.io

Personal Blog of Le
HTML
1
star
27

catcatgo

Catcatgo, 猫猫快跑 is a fast & simple static site generator powered by Python 3.
HTML
1
star
28

ggwave-fork

C++
1
star
29

folotoy-tool

Flasher tool for FoloToys, running in web browser using WebSerial.
Vue
1
star