-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
32 additions
and
1,889 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
dictionary/words_with_frequency_and_translation_and_ipa.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
# https://github.com/mphilli/English-to-IPA | ||
# python3 setup.py install | ||
# python3 words_with_frequency_and_translation_and_ipa.py | ||
|
||
import json | ||
import eng_to_ipa as ipa | ||
|
||
with open('words_with_frequency_and_translation.json', 'r') as f: | ||
data = json.load(f) | ||
|
||
for key, val in data.items(): | ||
phonetic_symbol = ipa.convert(key, | ||
keep_punct=False, | ||
retrieve_all=False, | ||
stress_marks="primary") | ||
if phonetic_symbol: | ||
val["ipa"] = phonetic_symbol | ||
|
||
file = open("words_with_frequency_and_translation_and_ipa.json", "w") | ||
file.write(json.dumps(data, ensure_ascii=False)) | ||
file.close() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.