Skip to content

Commit

Permalink
fix hyphenation tag download
Browse files Browse the repository at this point in the history
  • Loading branch information
rakuri255 committed Jul 27, 2024
1 parent 7b6bf65 commit 73b4727
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion pytest/modules/Speech_Recognition/test_hyphenation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@
import unittest
from unittest.mock import patch
from src.modules.Speech_Recognition.hyphenation import hyphenation, language_check
from hyphen import Hyphenator
from hyphen import Hyphenator, dictools


class TestHypenation(unittest.TestCase):

def test_hypenation(self):
"""Test case for hyphenation function."""

# prepare test
installed = dictools.list_installed()
for lang in installed:
dictools.uninstall(lang)

assert hyphenation("darkness", Hyphenator("en")) == ["dark", "ness"]
assert hyphenation("Hombre", Hyphenator("es")) == ["Hom", "bre"]
assert hyphenation("begegnen", Hyphenator("de_DE")) == ["be", "geg", "nen"]
assert hyphenation(".b,e~g'eg*nen, ", Hyphenator("de_DE")) == [".b,e", "~g'eg", "*nen, "]
assert hyphenation("Abend, ", Hyphenator("de_AT")) == None
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ pydub==0.25.1
# via -r requirements.in
pygments==2.18.0
# via rich
pyhyphen-reloaded==4.0.5
pyhyphen-reloaded==4.0.6
# via -r requirements.in
pylint==3.2.6
# via -r requirements.in
Expand Down

0 comments on commit 73b4727

Please sign in to comment.