Command-line interface (CLI) to create a pronunciation dictionary by looking up pinyin transcriptions using pypinyin including the possibility of ignoring punctuation and splitting words on hyphens before transcribing them.
Project description
dict-from-pypinyin
Command-line interface (CLI) to create a pronunciation dictionary by looking up pinyin transcriptions using pypinyin including the possibility of ignoring punctuation and splitting words on hyphens before transcribing them.
Installation
pip install dict-from-pypinyin --user
Usage
dict-from-pypinyin-cli
Example
# Create example vocabulary
cat > /tmp/vocabulary.txt << EOF
社会语言学?
㐻,
『㑐
鲜-亮。
『占斌?
『机具-机呀?
EOF
# Create dictionary from vocabulary
dict-from-pypinyin-cli \
/tmp/vocabulary.txt \
/tmp/result.dict \
--split-on-hyphen
cat /tmp/result.dict
Output:
社会语言学? shè huì yǔ yán xué ?
社会语言学? shè huì yǔ yàn xué ?
社会语言学? shè huì yǔ yín xué ?
社会语言学? shè huì yù yán xué ?
社会语言学? shè huì yù yàn xué ?
社会语言学? shè huì yù yín xué ?
社会语言学? shè kuài yǔ yán xué ?
社会语言学? shè kuài yǔ yàn xué ?
社会语言学? shè kuài yǔ yín xué ?
社会语言学? shè kuài yù yán xué ?
社会语言学? shè kuài yù yàn xué ?
社会语言学? shè kuài yù yín xué ?
㐻, nèi ,
『㑐 『 shū
鲜-亮。 xiān - liàng 。
鲜-亮。 xiān - liáng 。
鲜-亮。 xiǎn - liàng 。
鲜-亮。 xiǎn - liáng 。
『占斌? 『 zhàn bīn ?
『占斌? 『 zhān bīn ?
『占斌? 『 tiē bīn ?
『机具-机呀? 『 jī jù - jī ya ?
『机具-机呀? 『 jī jù - jī yā ?
『机具-机呀? 『 jī jù - jī xiā ?
『机具-机呀? 『 jī jù - wèi ya ?
『机具-机呀? 『 jī jù - wèi yā ?
『机具-机呀? 『 jī jù - wèi xiā ?
『机具-机呀? 『 wèi jù - jī ya ?
『机具-机呀? 『 wèi jù - jī yā ?
『机具-机呀? 『 wèi jù - jī xiā ?
『机具-机呀? 『 wèi jù - wèi ya ?
『机具-机呀? 『 wèi jù - wèi yā ?
『机具-机呀? 『 wèi jù - wèi xiā ?
Dependencies
pronunciation-dictionary >= 0.0.5
word-to-pronunciation >= 0.0.1
ordered-set >= 4.1.0
pypinyin >= 0.47.1, < 0.48
tqdm
License
MIT License
Acknowledgments
Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – Project-ID 416228727 – CRC 1410
Citation
If you want to cite this repo, you can use this BibTeX-entry generated by GitHub (see About => Cite this repository).
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
Built Distribution
Hashes for dict_from_pypinyin-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4c75feded68c96ab9a5e3de718fc92cffbc0c83ec23baa2f8dd69524187554c |
|
MD5 | f8815e63c89082eab76422045720a208 |
|
BLAKE2b-256 | 571886d4bfa11ce261dbdaade1c3df3fcbefeb18ede9bac812b1ee87f07eaa8e |