dict-from-dict
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 5 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.3%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: stefantaubert
- License: mit
- Language: Python
- Default Branch: master
- Size: 196 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 4
Metadata Files
README.md
dict-from-dict
Command-line interface (CLI) to create a pronunciation dictionary from an other pronunciation dictionary with the possibility of ignoring punctuation and splitting on hyphens before lookup.
Features
- ignore casing of words while lookup
- trimming symbols at start and end of word before lookup
- separate word on hyphen before lookup
- if the dictionary contains words with hyphens they will be considered first (see example below)
- words with multiple pronunciations are supported
- weights will be multiplied for hyphenated words (see example below)
- outputting OOV words
- multiprocessing
Installation
sh
pip install dict-from-dict --user
Usage
sh
dict-from-dict-cli
Example
```sh
Create example vocabulary
cat > /tmp/vocabulary.txt << EOF Test? abc, "def Test-def. "xyz? "uv-w? EOF
Create example dictionary
cat > /tmp/dictionary.dict << EOF test 0.7 T E0 S T test 0.3 T E1 S T def 0.4 D E0 F def 0.6 D E1 F xyz 2.0 ? "xyz? 1.0 ' X Y Z ?? uv 2.0 ? w 2.0 ? uv-w 1.0 U V - W EOF
Create dictionary from vocabulary and example dictionary
dict-from-dict-cli \ /tmp/vocabulary.txt \ /tmp/dictionary.dict --consider-weights \ /tmp/result.dict \ --ignore-case --split-on-hyphen \ --trim "?" "\"" "," "." \ --n-jobs 4 \ --oov-out /tmp/oov.txt
cat /tmp/result.dict
-------
Output:
-------
Test? 0.7 T E0 S T ? Test? 0.3 T E1 S T ? "def 0.4 " D E0 F "def 0.6 " D E1 F Test-def. 0.27999999999999997 T E0 S T - D E0 F . Test-def. 0.42 T E0 S T - D E1 F . Test-def. 0.12 T E1 S T - D E0 F . Test-def. 0.18 T E1 S T - D E1 F . "xyz? 1.0 ' X Y Z ?? "uv-w? 1.0 " U V - W ?
-------
cat /tmp/oov.txt
-------
Output:
-------
abc,
-------
```
Development setup
```sh
update
sudo apt update
install Python 3.8-3.12 for ensuring that tests can be run
sudo apt install python3-pip \ python3.8 python3.8-dev python3.8-distutils python3.8-venv \ python3.9 python3.9-dev python3.9-distutils python3.9-venv \ python3.10 python3.10-dev python3.10-distutils python3.10-venv \ python3.11 python3.11-dev python3.11-distutils python3.11-venv \ python3.12 python3.12-dev python3.12-distutils python3.12-venv
install pipenv for creation of virtual environments
python3.8 -m pip install pipenv --user
check out repo
git clone https://github.com/stefantaubert/pronunciation-dict-creation.git cd pronunciation-dict-creation
create virtual environment
python3.8 -m pipenv install --dev ```
Running the tests
```sh
first install the tool like in "Development setup"
then, navigate into the directory of the repo (if not already done)
cd pronunciation-dict-creation
activate environment
python3.8 -m pipenv shell
run tests
tox ```
Final lines of test result output:
log
py38: commands succeeded
py39: commands succeeded
py310: commands succeeded
py311: commands succeeded
py312: commands succeeded
congratulations :)
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).
txt
Taubert, S. (2024). dict-from-dict (Version 0.0.4) [Computer software]. https://doi.org/10.5281/zenodo.10560441
Owner
- Name: Stefan Taubert
- Login: stefantaubert
- Kind: user
- Location: Chemnitz, Germany
- Company: Chemnitz University of Technology
- Website: https://stefantaubert.com
- Twitter: Stefan_Taubert
- Repositories: 75
- Profile: https://github.com/stefantaubert
Currently I am working on my PhD about the topic of speech synthesis at Chemnitz University of Technology.
Citation (CITATION.cff)
cff-version: 1.2.0
title: dict-from-dict
abstract: Command-line interface (CLI) to create a pronunciation dictionary from an other pronunciation dictionary with the possibility of ignoring punctuation and splitting on hyphens before lookup.
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- email: github@stefantaubert.com
given-names: Stefan
family-names: Taubert
affiliation: Chemnitz University of Technology
orcid: 'https://orcid.org/0000-0002-4932-2874'
website: 'https://stefantaubert.com/'
version: 0.0.4
date-released: 2024-01-24
license: MIT
url: https://github.com/stefantaubert/pronunciation-dict-creation
doi: 10.5281/zenodo.10560441
GitHub Events
Total
Last Year
Issues and Pull Requests
Last synced: 12 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- autoflake * develop
- autopep8 * develop
- build * develop
- dict-from-dict * develop
- isort * develop
- pycodestyle * develop
- pylint * develop
- pytest * develop
- rope * develop
- tox * develop
- ordered-set >=4.1.0
- pronunciation-dictionary >=0.0.5
- pronunciation-dictionary-utils >=0.0.2
- word-to-pronunciation >=0.0.1
- appdirs ==1.4.4 develop
- astroid ==2.12.13 develop
- attrs ==22.1.0 develop
- autoflake ==2.0.0 develop
- autopep8 ==2.0.0 develop
- build ==0.9.0 develop
- dict-from-dict * develop
- dill ==0.3.6 develop
- distlib ==0.3.6 develop
- exceptiongroup ==1.0.4 develop
- filelock ==3.8.0 develop
- iniconfig ==1.1.1 develop
- isort ==5.10.1 develop
- lazy-object-proxy ==1.8.0 develop
- mccabe ==0.7.0 develop
- ordered-set ==4.1.0 develop
- packaging ==21.3 develop
- pep517 ==0.13.0 develop
- platformdirs ==2.5.4 develop
- pluggy ==1.0.0 develop
- pronunciation-dictionary ==0.0.5 develop
- pronunciation-dictionary-utils ==0.0.2 develop
- py ==1.11.0 develop
- pycodestyle ==2.10.0 develop
- pyflakes ==3.0.1 develop
- pylint ==2.15.7 develop
- pyparsing ==3.0.9 develop
- pytest ==7.2.0 develop
- pytoolconfig ==1.2.2 develop
- rope ==1.5.1 develop
- six ==1.16.0 develop
- tomli ==2.0.1 develop
- tomlkit ==0.11.6 develop
- tox ==3.27.1 develop
- tqdm ==4.64.1 develop
- typing-extensions ==4.4.0 develop
- virtualenv ==20.17.0 develop
- word-to-pronunciation ==0.0.1 develop
- wrapt ==1.14.1 develop
- ordered-set ==4.1.0
- pronunciation-dictionary ==0.0.5
- pronunciation-dictionary-utils ==0.0.2
- tqdm ==4.64.1
- word-to-pronunciation ==0.0.1
- ordered-set >= 4.1.0
- pronunciation-dictionary >= 0.0.5
- pronunciation-dictionary-utils >=0.0.2
- word-to-pronunciation >= 0.0.1