Skip to content

Commit

Permalink
Fix hyphen download by using own PyHyphen-Reloaded
Browse files Browse the repository at this point in the history
  • Loading branch information
rakuri255 committed Jul 13, 2024
1 parent 990c3ff commit 0015d51
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 68 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ numpy~=1.26.4
Pillow~=10.3.0
pretty_midi~=0.2.10
pydub~=0.25.1
PyHyphen~=4.0.3
#PyHyphen~=4.0.3
PyHyphen-Reloaded~=4.0.5
python_Levenshtein~=0.25.1
scipy~=1.13.1
tensorflow<2.11
Expand Down
2 changes: 1 addition & 1 deletion src/Settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Settings:
APP_VERSION = "0.0.12-dev1"
APP_VERSION = "0.0.12-dev2"

create_midi = True
create_plot = False
Expand Down
67 changes: 1 addition & 66 deletions src/modules/Speech_Recognition/hyphenation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,71 +9,6 @@
blue_highlighted,
)

# PyHyphen tries to retrieve dictionaries for download 'https://cgit.freedesktop.org/libreoffice/dictionaries/plain/'
# Updated PyHyphen dictools Languages, so they can be installed
LANGUAGES = [
"af_ZA",
"an_ES",
"ar",
"be_BY",
"bg_BG",
"bn_BD",
"bo",
"br_FR",
"bs_BA",
"ca",
"ckb",
"cs_CZ",
"da_DK",
"de",
"el_GR",
"en",
"eo",
"es",
"et_EE",
"fa_IR",
"fr_FR",
"gd_GB",
"gl",
"gu_IN",
"gug",
"he_IL",
"hi_IN",
"hr_HR",
"hu_HU",
"id",
"is",
"it_IT",
"kmr_Latn",
"ko_KR",
"lo_LA",
"lt_LT",
"lv_LV",
"mn_MN",
"ne_NP",
"nl_NL",
"no",
"oc_FR",
"pl_PL",
"pt_BR",
"pt_PT",
"ro",
"ru_RU",
"si_LK",
"sk_SK",
"sl_SI",
"sq_AL",
"sr",
"sv_SE",
"sw_TZ",
"te_IN",
"th_TH",
"tr_TR",
"uk_UA",
"vi",
"zu_ZA",
]

def language_check(language="en") -> str | None:
"""Check if language is supported"""

Expand All @@ -89,7 +24,7 @@ def language_check(language="en") -> str | None:
lang_region = installed_region_keys[0]
else:
# Take downloadable language key
downloadable_key = [i for i in LANGUAGES if i.startswith(language)]
downloadable_key = [i for i in dictools.LANGUAGES if i.startswith(language)]
downloadable_folder_key = [i for i in downloadable_key if i == language]
if downloadable_folder_key:
lang_region = downloadable_key[0]
Expand Down

0 comments on commit 0015d51

Please sign in to comment.