scriptconv-copyleft 0.2.0a1__tar.gz → 0.2.2a1__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.
Files changed (49) hide show
  1. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/PKG-INFO +3 -3
  2. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/pyproject.toml +2 -2
  3. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/mul.py +4 -0
  4. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/version.py +1 -1
  5. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft.egg-info/PKG-INFO +3 -3
  6. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft.egg-info/SOURCES.txt +1 -0
  7. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft.egg-info/requires.txt +2 -2
  8. scriptconv_copyleft-0.2.2a1/tests/test_misaki_zh_zero.py +19 -0
  9. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_phonemizers_punctuation.py +13 -5
  10. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/LICENSE +0 -0
  11. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/README.md +0 -0
  12. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/__init__.py +0 -0
  13. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/__init__.py +0 -0
  14. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/_vendored/__init__.py +0 -0
  15. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/_vendored/kog2p/COPYING +0 -0
  16. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/_vendored/kog2p/LICENSE.md +0 -0
  17. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/_vendored/kog2p/__init__.py +0 -0
  18. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/_vendored/kog2p/rulebook.txt +0 -0
  19. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/_vendored/reginute/COPYING +0 -0
  20. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/_vendored/reginute/LICENSE +0 -0
  21. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/_vendored/reginute/SOURCE +0 -0
  22. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/_vendored/reginute/lt_kirciai.tsv +0 -0
  23. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/_vendored/reginute/lt_kreipiniai.tsv +0 -0
  24. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/_vendored/reginute/lt_raides.tsv +0 -0
  25. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/eu.py +0 -0
  26. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/fa.py +0 -0
  27. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/gl.py +0 -0
  28. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/ja.py +0 -0
  29. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/ko.py +0 -0
  30. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/phonemizers/lt.py +0 -0
  31. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft/readings.py +0 -0
  32. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft.egg-info/dependency_links.txt +0 -0
  33. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/scriptconv_copyleft.egg-info/top_level.txt +0 -0
  34. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/setup.cfg +0 -0
  35. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_espeak_acute_stress.py +0 -0
  36. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_espeak_french_english_switch.py +0 -0
  37. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_espeak_get_lang_case.py +0 -0
  38. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_espeak_lt_accent.py +0 -0
  39. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_lang_default_region.py +0 -0
  40. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_match_lang_direction.py +0 -0
  41. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_match_lang_preferred_value.py +0 -0
  42. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_misaki_ja_reader.py +0 -0
  43. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_phonemizers_base.py +0 -0
  44. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_phonemizers_cjk_ar.py +0 -0
  45. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_phonemizers_friendly_import_errors.py +0 -0
  46. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_phonemizers_identity.py +0 -0
  47. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_phonemizers_misaki_british.py +0 -0
  48. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/tests/test_readings.py +0 -0
  49. {scriptconv_copyleft-0.2.0a1 → scriptconv_copyleft-0.2.2a1}/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.2.0a1
3
+ Version: 0.2.2a1
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 AND CC-BY-4.0
@@ -23,7 +23,7 @@ License-File: scriptconv_copyleft/phonemizers/_vendored/kog2p/LICENSE.md
23
23
  License-File: scriptconv_copyleft/phonemizers/_vendored/kog2p/COPYING
24
24
  License-File: scriptconv_copyleft/phonemizers/_vendored/reginute/COPYING
25
25
  License-File: scriptconv_copyleft/phonemizers/_vendored/reginute/LICENSE
26
- Requires-Dist: scriptconv[phonemizers]>=0.0.4a88
26
+ Requires-Dist: scriptconv[phonemizers]>=0.0.4a113
27
27
  Provides-Extra: espeak
28
28
  Requires-Dist: espyak; extra == "espeak"
29
29
  Provides-Extra: transphone
@@ -67,7 +67,7 @@ Requires-Dist: pykakasi<3,>=2.3; extra == "test"
67
67
  Requires-Dist: epitran>=1.26.1; extra == "test"
68
68
  Requires-Dist: g2pk; python_version < "3.13" and extra == "test"
69
69
  Requires-Dist: regex; extra == "test"
70
- Requires-Dist: misaki[en,ko]; python_version < "3.13" and extra == "test"
70
+ Requires-Dist: misaki[en,ko,zh]; python_version < "3.13" and extra == "test"
71
71
  Requires-Dist: fugashi; python_version < "3.13" and extra == "test"
72
72
  Requires-Dist: jaconv; python_version < "3.13" and extra == "test"
73
73
  Requires-Dist: mojimoji; python_version < "3.13" and extra == "test"
@@ -16,7 +16,7 @@ license-files = [
16
16
  "scriptconv_copyleft/phonemizers/_vendored/reginute/COPYING",
17
17
  "scriptconv_copyleft/phonemizers/_vendored/reginute/LICENSE",
18
18
  ]
19
- dependencies = ["scriptconv[phonemizers]>=0.0.4a88"]
19
+ dependencies = ["scriptconv[phonemizers]>=0.0.4a113"]
20
20
  authors = [
21
21
  { name = "TigreGotico", email = "contact@tigregotico.com" }
22
22
  ]
@@ -42,7 +42,7 @@ fa = ["persian_phonemizer", "hazm>=0.10", "spacy>=3.7,<4.0"]
42
42
  ja = ["pykakasi>=2.3,<3"]
43
43
  ja-phonemizers = ["pykakasi>=2.3,<3"]
44
44
  ko = ["g2pk; python_version<'3.13'", "regex"]
45
- test = ["pytest", "pytest-timeout", "espyak", "pycotovia", "ahotts_g2p", "pykakasi>=2.3,<3", "epitran>=1.26.1", "g2pk; python_version<'3.13'", "regex", "misaki[en,ko]; python_version<'3.13'", "fugashi; python_version<'3.13'", "jaconv; python_version<'3.13'", "mojimoji; python_version<'3.13'", "unidic-lite; python_version<'3.13'", "spacy>=3.7,<4.0; python_version<'3.13'", "linguatag[langcodes]>=0.2.3a1", "packaging", "pyopenjtalk-plus[onnxruntime]>=0.4.1.post10"]
45
+ test = ["pytest", "pytest-timeout", "espyak", "pycotovia", "ahotts_g2p", "pykakasi>=2.3,<3", "epitran>=1.26.1", "g2pk; python_version<'3.13'", "regex", "misaki[en,ko,zh]; python_version<'3.13'", "fugashi; python_version<'3.13'", "jaconv; python_version<'3.13'", "mojimoji; python_version<'3.13'", "unidic-lite; python_version<'3.13'", "spacy>=3.7,<4.0; python_version<'3.13'", "linguatag[langcodes]>=0.2.3a1", "packaging", "pyopenjtalk-plus[onnxruntime]>=0.4.1.post10"]
46
46
 
47
47
  [project.urls]
48
48
  Homepage = "https://github.com/TigreGotico/scriptconv-copyleft"
@@ -514,6 +514,10 @@ class MisakiPhonemizer(BasePhonemizer):
514
514
 
515
515
  def phonemize_string(self, text: str, lang: str) -> str:
516
516
  pho = self._get_phonemizer(lang)
517
+ if self.get_lang(lang) == "zh":
518
+ # misaki's zh front end keeps the zero sign 〇 (U+3007) as a symbol. Wiktionary, "〇", Chinese: "Used to
519
+ # express a zero digit in a number", with the sense of 零, so it reads as 零.
520
+ text = text.replace("\u3007", "零")
517
521
  phonemes, tokens = pho(text)
518
522
  return phonemes
519
523
 
@@ -1,7 +1,7 @@
1
1
  # START_VERSION_BLOCK
2
2
  VERSION_MAJOR = 0
3
3
  VERSION_MINOR = 2
4
- VERSION_BUILD = 0
4
+ VERSION_BUILD = 2
5
5
  VERSION_ALPHA = 1
6
6
  # END_VERSION_BLOCK
7
7
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: scriptconv-copyleft
3
- Version: 0.2.0a1
3
+ Version: 0.2.2a1
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 AND CC-BY-4.0
@@ -23,7 +23,7 @@ License-File: scriptconv_copyleft/phonemizers/_vendored/kog2p/LICENSE.md
23
23
  License-File: scriptconv_copyleft/phonemizers/_vendored/kog2p/COPYING
24
24
  License-File: scriptconv_copyleft/phonemizers/_vendored/reginute/COPYING
25
25
  License-File: scriptconv_copyleft/phonemizers/_vendored/reginute/LICENSE
26
- Requires-Dist: scriptconv[phonemizers]>=0.0.4a88
26
+ Requires-Dist: scriptconv[phonemizers]>=0.0.4a113
27
27
  Provides-Extra: espeak
28
28
  Requires-Dist: espyak; extra == "espeak"
29
29
  Provides-Extra: transphone
@@ -67,7 +67,7 @@ Requires-Dist: pykakasi<3,>=2.3; extra == "test"
67
67
  Requires-Dist: epitran>=1.26.1; extra == "test"
68
68
  Requires-Dist: g2pk; python_version < "3.13" and extra == "test"
69
69
  Requires-Dist: regex; extra == "test"
70
- Requires-Dist: misaki[en,ko]; python_version < "3.13" and extra == "test"
70
+ Requires-Dist: misaki[en,ko,zh]; python_version < "3.13" and extra == "test"
71
71
  Requires-Dist: fugashi; python_version < "3.13" and extra == "test"
72
72
  Requires-Dist: jaconv; python_version < "3.13" and extra == "test"
73
73
  Requires-Dist: mojimoji; python_version < "3.13" and extra == "test"
@@ -36,6 +36,7 @@ tests/test_lang_default_region.py
36
36
  tests/test_match_lang_direction.py
37
37
  tests/test_match_lang_preferred_value.py
38
38
  tests/test_misaki_ja_reader.py
39
+ tests/test_misaki_zh_zero.py
39
40
  tests/test_phonemizers_base.py
40
41
  tests/test_phonemizers_cjk_ar.py
41
42
  tests/test_phonemizers_friendly_import_errors.py
@@ -1,4 +1,4 @@
1
- scriptconv[phonemizers]>=0.0.4a88
1
+ scriptconv[phonemizers]>=0.0.4a113
2
2
 
3
3
  [espeak]
4
4
  espyak
@@ -54,7 +54,7 @@ pyopenjtalk-plus[onnxruntime]>=0.4.1.post10
54
54
 
55
55
  [test:python_version < "3.13"]
56
56
  g2pk
57
- misaki[en,ko]
57
+ misaki[en,ko,zh]
58
58
  fugashi
59
59
  jaconv
60
60
  mojimoji
@@ -0,0 +1,19 @@
1
+ """misaki zh reads the zero sign 〇 (U+3007) as it reads 零.
2
+
3
+ Wiktionary, "〇", Chinese: "Used to express a zero digit in a number", with the sense of 零. The expected phonemes
4
+ are the ones misaki gives for the same text written with 零."""
5
+ import sys
6
+
7
+ import pytest
8
+
9
+ from scriptconv_copyleft.phonemizers.mul import MisakiPhonemizer, MisakiZhPhonemizer
10
+
11
+
12
+ @pytest.mark.skipif(sys.version_info >= (3, 13), reason="misaki declares Requires-Python <3.13")
13
+ @pytest.mark.parametrize("cls", [MisakiZhPhonemizer, MisakiPhonemizer])
14
+ @pytest.mark.parametrize("text", ["二〇二四", "〇 〇 七", "電話是五五五〇一〇〇。"])
15
+ def test_the_zero_sign_reads_as_zero(cls, text):
16
+ phonemizer = cls()
17
+ spoken = phonemizer.phonemize_string(text, "zh")
18
+ assert "〇" not in spoken
19
+ assert spoken == phonemizer.phonemize_string(text.replace("〇", "零"), "zh")
@@ -89,13 +89,21 @@ class TestDefaultKeepsNoPunctuation:
89
89
 
90
90
  def test_default_matches_the_previous_definitions(self, espeak):
91
91
  # phonemize_lazy phonemizes each chunk_text chunk with its punctuation
92
- # removed, and phonemize_to_list joins those chunks
92
+ # removed, and joins the clauses of one sentence with a space: a
93
+ # chunk with its end-of-sentence flag closes the sentence.
94
+ # phonemize_to_list joins those sentences
93
95
  for lang, texts in MULTILINGUAL.items():
94
96
  for text in texts:
95
- previous = [
96
- list(re.sub(r"\([^)]+\)", "", espeak.phonemize_string(
97
- espeak.remove_punctuation(chunk), lang)))
98
- for chunk, _, _ in espeak.chunk_text(text)]
97
+ previous, clauses = [], []
98
+ for chunk, _, sentence_end in espeak.chunk_text(text):
99
+ clause = re.sub(r"\([^)]+\)", "", espeak.phonemize_string(
100
+ espeak.remove_punctuation(chunk), lang))
101
+ clauses += [clause] if clause else []
102
+ if sentence_end:
103
+ previous.append(list(" ".join(clauses)))
104
+ clauses = []
105
+ if clauses:
106
+ previous.append(list(" ".join(clauses)))
99
107
  assert espeak.phonemize(text, lang) == previous
100
108
  assert list(espeak.phonemize_lazy(text, lang)) == previous
101
109
  assert espeak.phonemize_to_list(text, lang) == join_sentences(previous)