Build fcitx5/RIME dictionaries from MediaWiki sites
Project description
mw2fcitx
Build fcitx5 libraries from MediaWiki sites.
pip install mw2fcitx
# or if you want to just install for current user
pip install mw2fcitx --user
For the old fcitx5-pinyin-moegirl
, see branch v1.
For the pre-build moegirl dictionary info, see the wiki.
CLI Usage
mw2fcitx -c config_script.py
Configuration Script Format
# By default we assume the configuration is located at a variable
# called "exports".
# You can change this with `-n any_name` in the CLI.
exports = {
# Source configurations.
"source": {
# MediaWiki api.php path, if to fetch titles from online.
"api_path": "https://zh.moegirl.org.cn/api.php",
# Title file path, if to fetch titles from local file. (optional)
# Can be a path or a list of paths.
"file_path": ["titles.txt"],
"kwargs": {
# Title number limit for fetching. (optional)
"title_limit": 120,
# Title number limit for fetching via API. (optional)
# Overrides title_limit.
"api_title_limit": 120,
# Title number limit for each fetch via file. (optional)
# Overrides title_limit.
"file_title_limit": 60,
# Partial session file on exception (optional)
"partial": "partial.json",
# Title list export path. (optional)
"output": "titles.txt"
}
},
# Tweaks configurations as an list.
# Every tweak function accepts a list of titles and return
# a list of title.
"tweaks":
tweaks,
# Converter configurations.
"converter": {
# opencc is a built-in converter.
# For custom converter functions, just give the function itself.
"use": "opencc",
"kwargs": {}
},
# Generator configurations.
"generator": [{
# rime is a built-in generator.
# For custom generator functions, just give the function itself.
"use": "rime",
"kwargs": {
# Destination dictionary filename. (optional)
"output": "moegirl.dict.yml"
}
}, {
# pinyin is a built-in generator.
"use": "pinyin",
"kwargs": {
# Destination dictionary filename. (mandatory)
"output": "moegirl.dict"
}
}]
}
A sample config file is here: sample_config.py
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mw2fcitx-0.14.0.tar.gz
(10.1 kB
view hashes)
Built Distribution
mw2fcitx-0.14.0-py3-none-any.whl
(13.5 kB
view hashes)
Close
Hashes for mw2fcitx-0.14.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0614f2535f7be6a18ea3a0cacd1c29e8da5ed71630fee104186d58fb8fbe99e |
|
MD5 | 19f126a85c1f1fd6eb27fc459d39eda0 |
|
BLAKE2b-256 | 42786d24fc0eeac8040ff40ab31e28c63421530e4dc884f78687beed1ce190f4 |