scriptconv-copyleft 0.1.0a1__tar.gz → 0.1.1a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/PKG-INFO +1 -1
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/mul.py +19 -4
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/version.py +1 -1
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft.egg-info/PKG-INFO +1 -1
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_espeak_french_english_switch.py +10 -1
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/LICENSE +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/README.md +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/pyproject.toml +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/__init__.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/__init__.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/_vendored/__init__.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/_vendored/kog2p/COPYING +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/_vendored/kog2p/LICENSE.md +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/_vendored/kog2p/__init__.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/_vendored/kog2p/rulebook.txt +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/eu.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/fa.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/gl.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/ja.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/ko.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/readings.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft.egg-info/SOURCES.txt +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft.egg-info/dependency_links.txt +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft.egg-info/requires.txt +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft.egg-info/top_level.txt +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/setup.cfg +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_espeak_acute_stress.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_espeak_get_lang_case.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_lang_default_region.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_match_lang_direction.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_match_lang_preferred_value.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_phonemizers_base.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_phonemizers_cjk_ar.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_phonemizers_friendly_import_errors.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_phonemizers_identity.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_phonemizers_misaki_british.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_phonemizers_punctuation.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_readings.py +0 -0
- {scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_transphone_extra_declares_auto_installs.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scriptconv-copyleft
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1a1
|
|
4
4
|
Summary: scriptconv phonemizer backends whose code or dependencies are copyleft (GPL, LGPL, AGPL)
|
|
5
5
|
Author-email: TigreGotico <contact@tigregotico.com>
|
|
6
6
|
License-Expression: Apache-2.0 AND GPL-3.0-only
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/mul.py
RENAMED
|
@@ -35,15 +35,30 @@ class EspeakError(Exception):
|
|
|
35
35
|
# sentence, so a French voice reads "d'aujourd'hui" as English. Respell each of
|
|
36
36
|
# them as French text espeak-ng reads correctly (checked against espeak-ng 1.52.0):
|
|
37
37
|
# "de aujourd'hui" -> də oʒuʁdyˈi, "grand-mère" -> ɡʁˈɑ̃mˈɛʁ, "prud-homme" -> pʁˈydˈɔm.
|
|
38
|
+
def _elide_d(match: "re.Match[str]") -> str:
|
|
39
|
+
""""d'aujourd'hui" -> "de aujourd'hui", keeping the case the text was written in."""
|
|
40
|
+
word = match.group(0)
|
|
41
|
+
return ("DE " if word.isupper() else word[0] + "e ") + word[2:].replace("\u2019", "'")
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def _hyphenate(match: "re.Match[str]") -> str:
|
|
45
|
+
""""grand'mère" -> "grand-mère" (the apostrophe becomes a hyphen; the letters keep their case)."""
|
|
46
|
+
return match.group(1) + "-" + match.group(2)
|
|
47
|
+
|
|
48
|
+
|
|
38
49
|
_FRENCH_ENGLISH_SWITCH_FIXES = (
|
|
39
|
-
(re.compile(r"\
|
|
40
|
-
(re.compile(r"\b(
|
|
41
|
-
(re.compile(r"\b(
|
|
50
|
+
(re.compile(r"\bd['\u2019]aujourd['\u2019]hui\b", re.IGNORECASE), _elide_d),
|
|
51
|
+
(re.compile(r"\b(grand)['\u2019](m[\u00e8e]res?)\b", re.IGNORECASE), _hyphenate),
|
|
52
|
+
(re.compile(r"\b(prud)['\u2019](hommes?)\b", re.IGNORECASE), _hyphenate),
|
|
42
53
|
)
|
|
43
54
|
|
|
44
55
|
|
|
45
56
|
def _respell_for_espeak(text: str, lang: str) -> str:
|
|
46
|
-
"""Respell the few words espeak-ng mistakes for English in a French text.
|
|
57
|
+
"""Respell the few words espeak-ng mistakes for English in a French text.
|
|
58
|
+
|
|
59
|
+
The match ignores case, so a heading in capitals ("D'AUJOURD'HUI", "GRAND'MÈRE") gets
|
|
60
|
+
the same treatment; the replacement keeps whatever case each letter had.
|
|
61
|
+
"""
|
|
47
62
|
if lang.split("-")[0].lower() != "fr":
|
|
48
63
|
return text
|
|
49
64
|
for pattern, replacement in _FRENCH_ENGLISH_SWITCH_FIXES:
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scriptconv-copyleft
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.1a1
|
|
4
4
|
Summary: scriptconv phonemizer backends whose code or dependencies are copyleft (GPL, LGPL, AGPL)
|
|
5
5
|
Author-email: TigreGotico <contact@tigregotico.com>
|
|
6
6
|
License-Expression: Apache-2.0 AND GPL-3.0-only
|
|
@@ -21,6 +21,14 @@ from scriptconv_copyleft.phonemizers.mul import EspeakPhonemizer, _respell_for_e
|
|
|
21
21
|
("grand'mere", "grand-mere"),
|
|
22
22
|
("prud'homme", "prud-homme"),
|
|
23
23
|
("Prud'hommes", "Prud-hommes"),
|
|
24
|
+
# All capitals and mixed case (CodeRabbit on scriptconv#160): the case is kept.
|
|
25
|
+
("D'AUJOURD'HUI", "DE AUJOURD'HUI"),
|
|
26
|
+
("D\u2019AUJOURD\u2019HUI", "DE AUJOURD'HUI"),
|
|
27
|
+
("GRAND'MÈRE", "GRAND-MÈRE"),
|
|
28
|
+
("GRAND'MÈRES", "GRAND-MÈRES"),
|
|
29
|
+
("Grand'Mère", "Grand-Mère"),
|
|
30
|
+
("PRUD'HOMMES", "PRUD-HOMMES"),
|
|
31
|
+
("LE JOUR D'AUJOURD'HUI", "LE JOUR DE AUJOURD'HUI"),
|
|
24
32
|
])
|
|
25
33
|
def test_the_words_espeak_mistakes_for_english_are_respelled_in_french(text, expected):
|
|
26
34
|
assert _respell_for_espeak(text, "fr") == expected
|
|
@@ -40,7 +48,8 @@ def test_other_languages_are_left_alone():
|
|
|
40
48
|
assert _respell_for_espeak("d'aujourd'hui", "it") == "d'aujourd'hui"
|
|
41
49
|
|
|
42
50
|
|
|
43
|
-
@pytest.mark.parametrize("text", ["d'aujourd'hui", "Le jour d'aujourd'hui", "grand'mère", "les prud'hommes"
|
|
51
|
+
@pytest.mark.parametrize("text", ["d'aujourd'hui", "Le jour d'aujourd'hui", "grand'mère", "les prud'hommes",
|
|
52
|
+
"D'AUJOURD'HUI", "GRAND'MÈRE", "PRUD'HOMMES"])
|
|
44
53
|
def test_a_french_voice_gets_no_english_phones(text):
|
|
45
54
|
phonemes = EspeakPhonemizer().phonemize_string(text, "fr-FR")
|
|
46
55
|
# the English voice's vowels and affricate, which French never produces here
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/eu.py
RENAMED
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/fa.py
RENAMED
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/gl.py
RENAMED
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/ja.py
RENAMED
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft/phonemizers/ko.py
RENAMED
|
File without changes
|
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/scriptconv_copyleft.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_espeak_acute_stress.py
RENAMED
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_espeak_get_lang_case.py
RENAMED
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_lang_default_region.py
RENAMED
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_match_lang_direction.py
RENAMED
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_match_lang_preferred_value.py
RENAMED
|
File without changes
|
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_phonemizers_cjk_ar.py
RENAMED
|
File without changes
|
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_phonemizers_identity.py
RENAMED
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_phonemizers_misaki_british.py
RENAMED
|
File without changes
|
{scriptconv_copyleft-0.1.0a1 → scriptconv_copyleft-0.1.1a1}/tests/test_phonemizers_punctuation.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|