scriptconv-nonfree 0.2.0a1__tar.gz → 0.2.1a2__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 (44) hide show
  1. scriptconv_nonfree-0.2.1a2/PKG-INFO +116 -0
  2. scriptconv_nonfree-0.2.1a2/README.md +62 -0
  3. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/mantoq/num2words.py +27 -1
  4. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/version.py +2 -2
  5. scriptconv_nonfree-0.2.1a2/scriptconv_nonfree.egg-info/PKG-INFO +116 -0
  6. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree.egg-info/SOURCES.txt +2 -1
  7. scriptconv_nonfree-0.2.1a2/tests/test_phonemizers_mantoq_long_digits.py +80 -0
  8. scriptconv_nonfree-0.2.0a1/PKG-INFO +0 -122
  9. scriptconv_nonfree-0.2.0a1/README.md +0 -68
  10. scriptconv_nonfree-0.2.0a1/scriptconv_nonfree.egg-info/PKG-INFO +0 -122
  11. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/LICENSE +0 -0
  12. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/LICENSE.africa-g2p-data.md +0 -0
  13. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/pyproject.toml +0 -0
  14. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/__init__.py +0 -0
  15. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/__init__.py +0 -0
  16. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/__init__.py +0 -0
  17. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/LICENSE.cc-by-nc-4.0 +0 -0
  18. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/LICENSE.md +0 -0
  19. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/__init__.py +0 -0
  20. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/phonetiser.py +0 -0
  21. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.cc-by-nc-4.0 +0 -0
  22. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.mantoq +0 -0
  23. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.md +0 -0
  24. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/mantoq/__init__.py +0 -0
  25. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/mantoq/buck/__init__.py +0 -0
  26. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/mantoq/buck/phonetise_buckwalter.py +0 -0
  27. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/mantoq/buck/symbols.py +0 -0
  28. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/mantoq/buck/tokenization.py +0 -0
  29. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/_vendored/mantoq/unicode_symbol2label.py +0 -0
  30. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/africa.py +0 -0
  31. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/ar.py +0 -0
  32. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/ghana.py +0 -0
  33. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree/phonemizers/vi.py +0 -0
  34. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree.egg-info/dependency_links.txt +0 -0
  35. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree.egg-info/requires.txt +0 -0
  36. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/scriptconv_nonfree.egg-info/top_level.txt +0 -0
  37. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/setup.cfg +0 -0
  38. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/tests/test_match_lang_direction.py +0 -0
  39. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/tests/test_phonemizers_africa.py +0 -0
  40. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/tests/test_phonemizers_cjk_ar.py +0 -0
  41. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/tests/test_phonemizers_friendly_import_errors.py +0 -0
  42. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/tests/test_phonemizers_ghana.py +0 -0
  43. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/tests/test_phonemizers_halabi_iqra.py +0 -0
  44. {scriptconv_nonfree-0.2.0a1 → scriptconv_nonfree-0.2.1a2}/tests/test_phonemizers_identity.py +0 -0
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.4
2
+ Name: scriptconv-nonfree
3
+ Version: 0.2.1a2
4
+ Summary: scriptconv phonemizer backends whose code, data or dependencies are non-commercial or carry no licence grant
5
+ Author-email: TigreGotico <contact@tigregotico.com>
6
+ License-Expression: Apache-2.0 AND MIT AND CC-BY-NC-4.0 AND LicenseRef-AfricaG2P-Data
7
+ Project-URL: Homepage, https://github.com/TigreGotico/scriptconv-nonfree
8
+ Project-URL: Repository, https://github.com/TigreGotico/scriptconv-nonfree
9
+ Project-URL: Issues, https://github.com/TigreGotico/scriptconv-nonfree/issues
10
+ Keywords: g2p,phonemizer,tts,scriptconv,arabic,mantoq,halabi,iqra,vietnamese,african-languages
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Text Processing :: Linguistic
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ License-File: scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.md
23
+ License-File: scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.mantoq
24
+ License-File: scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.cc-by-nc-4.0
25
+ License-File: scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/LICENSE.md
26
+ License-File: scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/LICENSE.cc-by-nc-4.0
27
+ License-File: LICENSE.africa-g2p-data.md
28
+ Requires-Dist: scriptconv[phonemizers]>=0.0.4a98
29
+ Provides-Extra: ar-phonemizers
30
+ Requires-Dist: ovos-number-parser; extra == "ar-phonemizers"
31
+ Provides-Extra: vi
32
+ Requires-Dist: viphoneme; python_version < "3.12" and extra == "vi"
33
+ Requires-Dist: vinorm; python_version < "3.12" and extra == "vi"
34
+ Requires-Dist: underthesea; python_version < "3.12" and extra == "vi"
35
+ Requires-Dist: eng_to_ipa; python_version < "3.12" and extra == "vi"
36
+ Provides-Extra: africa
37
+ Requires-Dist: africa-g2p>=0.3.5; extra == "africa"
38
+ Provides-Extra: ghana
39
+ Requires-Dist: ghana-g2p>=0.1.1; extra == "ghana"
40
+ Requires-Dist: africa-g2p>=0.3.5; extra == "ghana"
41
+ Provides-Extra: test
42
+ Requires-Dist: pytest; extra == "test"
43
+ Requires-Dist: pytest-timeout; extra == "test"
44
+ Requires-Dist: ovos-number-parser; extra == "test"
45
+ Requires-Dist: africa-g2p>=0.3.5; extra == "test"
46
+ Requires-Dist: ghana-g2p>=0.1.1; extra == "test"
47
+ Requires-Dist: viphoneme; python_version < "3.12" and extra == "test"
48
+ Requires-Dist: vinorm; python_version < "3.12" and extra == "test"
49
+ Requires-Dist: underthesea; python_version < "3.12" and extra == "test"
50
+ Requires-Dist: eng_to_ipa; python_version < "3.12" and extra == "test"
51
+ Requires-Dist: linguatag[langcodes]>=0.2.3a1; extra == "test"
52
+ Requires-Dist: packaging; extra == "test"
53
+ Dynamic: license-file
54
+
55
+ # scriptconv-nonfree
56
+
57
+ <!-- agent-hint
58
+ covers: what scriptconv-nonfree is, the quickstart, the backends it holds and its licence
59
+ source: pyproject.toml, scriptconv_nonfree/phonemizers/, LICENSE.africa-g2p-data.md, scriptconv/phonemizers/registry.py in scriptconv
60
+ generated: no
61
+ verify: python -m doctest README.md
62
+ see: docs/index.md, docs/getting-started.md, AGENTS.md
63
+ -->
64
+
65
+ scriptconv-nonfree holds the phonemizer backends of
66
+ [scriptconv](https://github.com/TigreGotico/scriptconv) whose code, data or
67
+ dependencies are for non-commercial use only, or carry no licence grant.
68
+ scriptconv keeps the registry, and its extras install this package, so you
69
+ call the backends through scriptconv as usual. Do not use them in a commercial
70
+ product.
71
+
72
+ ## Quickstart
73
+
74
+ ```bash
75
+ uv pip install --prerelease=allow "scriptconv[ar-phonemizers]"
76
+ ```
77
+
78
+ ```python
79
+ >>> from scriptconv.phonemizers import Phonemizer, get_phonemizer
80
+ >>> get_phonemizer(Phonemizer.MANTOQ).phonemize_string("مَرْحَبًا بِالْعَالَمِ", "ar")
81
+ 'marħabanaː bilʕaːlami'
82
+
83
+ ```
84
+
85
+ mantoq reads the diacritics of the text and adds none.
86
+ [Getting started](docs/getting-started.md) walks through the alphabets, the
87
+ African backends and the draft rule tables.
88
+
89
+ ## Backends
90
+
91
+ | `Phonemizer` values | scriptconv extra | Restricted item |
92
+ | --- | --- | --- |
93
+ | `mantoq`, `halabi`, `iqra` | `ar-phonemizers` | the Arabic-Phonetiser of Nawar Halabi, CC-BY-NC-4.0 |
94
+ | `viphoneme` | `vi` | viphoneme and vinorm, "Free for non-commercial use" |
95
+ | `africa_g2p` | `africa` | the africa-g2p rule tables, with no licence grant |
96
+ | `ghana_g2p` | `ghana` | the same rule tables, which ghana-g2p loads |
97
+
98
+ scriptconv never picks one of these backends by default: the Arabic default
99
+ is arbtok. The [backend reference](docs/backends.md) gives the languages,
100
+ alphabets and parameters of each backend.
101
+
102
+ ## Licence
103
+
104
+ The package is `Apache-2.0 AND MIT AND CC-BY-NC-4.0 AND LicenseRef-AfricaG2P-Data`.
105
+ Its own glue code is Apache-2.0. The vendored mantoq code is MIT, except the
106
+ phonetiser and `num2words.py`. The two vendored copies of the Arabic phonetiser are
107
+ CC-BY-NC-4.0, which forbids commercial use. `LICENSE.africa-g2p-data.md`
108
+ states the terms of the africa-g2p rule tables, which the `africa` and `ghana`
109
+ backends load: they are not for commercial use. [Licences](docs/licences.md)
110
+ gives the restricted item of each backend and the licence of each file.
111
+
112
+ ## Documentation
113
+
114
+ The [documentation index](docs/index.md) lists every page in reading order.
115
+ The [scriptconv documentation](https://github.com/TigreGotico/scriptconv/tree/dev/docs)
116
+ explains the phonemizer contract and the other backends.
@@ -0,0 +1,62 @@
1
+ # scriptconv-nonfree
2
+
3
+ <!-- agent-hint
4
+ covers: what scriptconv-nonfree is, the quickstart, the backends it holds and its licence
5
+ source: pyproject.toml, scriptconv_nonfree/phonemizers/, LICENSE.africa-g2p-data.md, scriptconv/phonemizers/registry.py in scriptconv
6
+ generated: no
7
+ verify: python -m doctest README.md
8
+ see: docs/index.md, docs/getting-started.md, AGENTS.md
9
+ -->
10
+
11
+ scriptconv-nonfree holds the phonemizer backends of
12
+ [scriptconv](https://github.com/TigreGotico/scriptconv) whose code, data or
13
+ dependencies are for non-commercial use only, or carry no licence grant.
14
+ scriptconv keeps the registry, and its extras install this package, so you
15
+ call the backends through scriptconv as usual. Do not use them in a commercial
16
+ product.
17
+
18
+ ## Quickstart
19
+
20
+ ```bash
21
+ uv pip install --prerelease=allow "scriptconv[ar-phonemizers]"
22
+ ```
23
+
24
+ ```python
25
+ >>> from scriptconv.phonemizers import Phonemizer, get_phonemizer
26
+ >>> get_phonemizer(Phonemizer.MANTOQ).phonemize_string("مَرْحَبًا بِالْعَالَمِ", "ar")
27
+ 'marħabanaː bilʕaːlami'
28
+
29
+ ```
30
+
31
+ mantoq reads the diacritics of the text and adds none.
32
+ [Getting started](docs/getting-started.md) walks through the alphabets, the
33
+ African backends and the draft rule tables.
34
+
35
+ ## Backends
36
+
37
+ | `Phonemizer` values | scriptconv extra | Restricted item |
38
+ | --- | --- | --- |
39
+ | `mantoq`, `halabi`, `iqra` | `ar-phonemizers` | the Arabic-Phonetiser of Nawar Halabi, CC-BY-NC-4.0 |
40
+ | `viphoneme` | `vi` | viphoneme and vinorm, "Free for non-commercial use" |
41
+ | `africa_g2p` | `africa` | the africa-g2p rule tables, with no licence grant |
42
+ | `ghana_g2p` | `ghana` | the same rule tables, which ghana-g2p loads |
43
+
44
+ scriptconv never picks one of these backends by default: the Arabic default
45
+ is arbtok. The [backend reference](docs/backends.md) gives the languages,
46
+ alphabets and parameters of each backend.
47
+
48
+ ## Licence
49
+
50
+ The package is `Apache-2.0 AND MIT AND CC-BY-NC-4.0 AND LicenseRef-AfricaG2P-Data`.
51
+ Its own glue code is Apache-2.0. The vendored mantoq code is MIT, except the
52
+ phonetiser and `num2words.py`. The two vendored copies of the Arabic phonetiser are
53
+ CC-BY-NC-4.0, which forbids commercial use. `LICENSE.africa-g2p-data.md`
54
+ states the terms of the africa-g2p rule tables, which the `africa` and `ghana`
55
+ backends load: they are not for commercial use. [Licences](docs/licences.md)
56
+ gives the restricted item of each backend and the licence of each file.
57
+
58
+ ## Documentation
59
+
60
+ The [documentation index](docs/index.md) lists every page in reading order.
61
+ The [scriptconv documentation](https://github.com/TigreGotico/scriptconv/tree/dev/docs)
62
+ explains the phonemizer contract and the other backends.
@@ -11,6 +11,16 @@ from functools import partial
11
11
  NUM_REGEX = re.compile(r"\d+(?:\.\d+)?")
12
12
  PERCENT_NO_DIAC = "بالمئة"
13
13
 
14
+ # The longest digit run that is still one quantity the Arabic number tables
15
+ # speak with their own scale words: the top entry of ``_SCALES_AR`` is
16
+ # تريليون, 10**12 (``ovos_number_parser/numbers_ar.py``), so 15 digits
17
+ # (10**15 - 1) is the largest value they compose. Beyond it the tables recycle
18
+ # their scale words ("ألف تريليون"), and no speaker reads such a run as one
19
+ # quantity: it is read digit by digit, each digit with its own word.
20
+ MAX_QUANTITY_DIGITS = 15
21
+ # The word pronounce_number puts between the parts of a decimal (فاصلة).
22
+ DECIMAL_SEPARATOR_WORD = "فاصلة"
23
+
14
24
  # Arabic-Indic (U+0660-0669) and Extended Arabic-Indic (U+06F0-06F9) -> ASCII
15
25
  _DIGIT_TABLE = {0x0660 + i: str(i) for i in range(10)}
16
26
  _DIGIT_TABLE.update({0x06F0 + i: str(i) for i in range(10)})
@@ -24,10 +34,26 @@ def normalize_digits(text: str) -> str:
24
34
  return text.translate(_DIGIT_TABLE)
25
35
 
26
36
 
37
+ def _read_digit_by_digit(digits: str) -> str:
38
+ """Read a digit run as separate digits, one number word each."""
39
+ from ovos_number_parser import pronounce_number
40
+ return " ".join(pronounce_number(int(digit), lang="ar")
41
+ for digit in digits)
42
+
43
+
27
44
  def _convert_num2words(m: re.Match, *, apply_tashkeel):
28
45
  from ovos_number_parser import pronounce_number
29
46
  number = m.group(0)
30
- value = float(number) if "." in number else int(number)
47
+ whole, _, fraction = number.partition(".")
48
+ if len(whole) > MAX_QUANTITY_DIGITS:
49
+ # Too long to be one quantity. ``int()`` would also refuse a run over
50
+ # its own string-conversion limit, so the digits are read one by one.
51
+ words = _read_digit_by_digit(whole)
52
+ if fraction:
53
+ words += " " + DECIMAL_SEPARATOR_WORD + " " + \
54
+ _read_digit_by_digit(fraction)
55
+ return words
56
+ value = float(number) if fraction else int(number)
31
57
  return pronounce_number(value, lang="ar")
32
58
 
33
59
 
@@ -1,8 +1,8 @@
1
1
  # START_VERSION_BLOCK
2
2
  VERSION_MAJOR = 0
3
3
  VERSION_MINOR = 2
4
- VERSION_BUILD = 0
5
- VERSION_ALPHA = 1
4
+ VERSION_BUILD = 1
5
+ VERSION_ALPHA = 2
6
6
  # END_VERSION_BLOCK
7
7
 
8
8
  __version__ = f"{VERSION_MAJOR}.{VERSION_MINOR}.{VERSION_BUILD}" + (f"a{VERSION_ALPHA}" if VERSION_ALPHA else "")
@@ -0,0 +1,116 @@
1
+ Metadata-Version: 2.4
2
+ Name: scriptconv-nonfree
3
+ Version: 0.2.1a2
4
+ Summary: scriptconv phonemizer backends whose code, data or dependencies are non-commercial or carry no licence grant
5
+ Author-email: TigreGotico <contact@tigregotico.com>
6
+ License-Expression: Apache-2.0 AND MIT AND CC-BY-NC-4.0 AND LicenseRef-AfricaG2P-Data
7
+ Project-URL: Homepage, https://github.com/TigreGotico/scriptconv-nonfree
8
+ Project-URL: Repository, https://github.com/TigreGotico/scriptconv-nonfree
9
+ Project-URL: Issues, https://github.com/TigreGotico/scriptconv-nonfree/issues
10
+ Keywords: g2p,phonemizer,tts,scriptconv,arabic,mantoq,halabi,iqra,vietnamese,african-languages
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Text Processing :: Linguistic
19
+ Requires-Python: >=3.11
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ License-File: scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.md
23
+ License-File: scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.mantoq
24
+ License-File: scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.cc-by-nc-4.0
25
+ License-File: scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/LICENSE.md
26
+ License-File: scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/LICENSE.cc-by-nc-4.0
27
+ License-File: LICENSE.africa-g2p-data.md
28
+ Requires-Dist: scriptconv[phonemizers]>=0.0.4a98
29
+ Provides-Extra: ar-phonemizers
30
+ Requires-Dist: ovos-number-parser; extra == "ar-phonemizers"
31
+ Provides-Extra: vi
32
+ Requires-Dist: viphoneme; python_version < "3.12" and extra == "vi"
33
+ Requires-Dist: vinorm; python_version < "3.12" and extra == "vi"
34
+ Requires-Dist: underthesea; python_version < "3.12" and extra == "vi"
35
+ Requires-Dist: eng_to_ipa; python_version < "3.12" and extra == "vi"
36
+ Provides-Extra: africa
37
+ Requires-Dist: africa-g2p>=0.3.5; extra == "africa"
38
+ Provides-Extra: ghana
39
+ Requires-Dist: ghana-g2p>=0.1.1; extra == "ghana"
40
+ Requires-Dist: africa-g2p>=0.3.5; extra == "ghana"
41
+ Provides-Extra: test
42
+ Requires-Dist: pytest; extra == "test"
43
+ Requires-Dist: pytest-timeout; extra == "test"
44
+ Requires-Dist: ovos-number-parser; extra == "test"
45
+ Requires-Dist: africa-g2p>=0.3.5; extra == "test"
46
+ Requires-Dist: ghana-g2p>=0.1.1; extra == "test"
47
+ Requires-Dist: viphoneme; python_version < "3.12" and extra == "test"
48
+ Requires-Dist: vinorm; python_version < "3.12" and extra == "test"
49
+ Requires-Dist: underthesea; python_version < "3.12" and extra == "test"
50
+ Requires-Dist: eng_to_ipa; python_version < "3.12" and extra == "test"
51
+ Requires-Dist: linguatag[langcodes]>=0.2.3a1; extra == "test"
52
+ Requires-Dist: packaging; extra == "test"
53
+ Dynamic: license-file
54
+
55
+ # scriptconv-nonfree
56
+
57
+ <!-- agent-hint
58
+ covers: what scriptconv-nonfree is, the quickstart, the backends it holds and its licence
59
+ source: pyproject.toml, scriptconv_nonfree/phonemizers/, LICENSE.africa-g2p-data.md, scriptconv/phonemizers/registry.py in scriptconv
60
+ generated: no
61
+ verify: python -m doctest README.md
62
+ see: docs/index.md, docs/getting-started.md, AGENTS.md
63
+ -->
64
+
65
+ scriptconv-nonfree holds the phonemizer backends of
66
+ [scriptconv](https://github.com/TigreGotico/scriptconv) whose code, data or
67
+ dependencies are for non-commercial use only, or carry no licence grant.
68
+ scriptconv keeps the registry, and its extras install this package, so you
69
+ call the backends through scriptconv as usual. Do not use them in a commercial
70
+ product.
71
+
72
+ ## Quickstart
73
+
74
+ ```bash
75
+ uv pip install --prerelease=allow "scriptconv[ar-phonemizers]"
76
+ ```
77
+
78
+ ```python
79
+ >>> from scriptconv.phonemizers import Phonemizer, get_phonemizer
80
+ >>> get_phonemizer(Phonemizer.MANTOQ).phonemize_string("مَرْحَبًا بِالْعَالَمِ", "ar")
81
+ 'marħabanaː bilʕaːlami'
82
+
83
+ ```
84
+
85
+ mantoq reads the diacritics of the text and adds none.
86
+ [Getting started](docs/getting-started.md) walks through the alphabets, the
87
+ African backends and the draft rule tables.
88
+
89
+ ## Backends
90
+
91
+ | `Phonemizer` values | scriptconv extra | Restricted item |
92
+ | --- | --- | --- |
93
+ | `mantoq`, `halabi`, `iqra` | `ar-phonemizers` | the Arabic-Phonetiser of Nawar Halabi, CC-BY-NC-4.0 |
94
+ | `viphoneme` | `vi` | viphoneme and vinorm, "Free for non-commercial use" |
95
+ | `africa_g2p` | `africa` | the africa-g2p rule tables, with no licence grant |
96
+ | `ghana_g2p` | `ghana` | the same rule tables, which ghana-g2p loads |
97
+
98
+ scriptconv never picks one of these backends by default: the Arabic default
99
+ is arbtok. The [backend reference](docs/backends.md) gives the languages,
100
+ alphabets and parameters of each backend.
101
+
102
+ ## Licence
103
+
104
+ The package is `Apache-2.0 AND MIT AND CC-BY-NC-4.0 AND LicenseRef-AfricaG2P-Data`.
105
+ Its own glue code is Apache-2.0. The vendored mantoq code is MIT, except the
106
+ phonetiser and `num2words.py`. The two vendored copies of the Arabic phonetiser are
107
+ CC-BY-NC-4.0, which forbids commercial use. `LICENSE.africa-g2p-data.md`
108
+ states the terms of the africa-g2p rule tables, which the `africa` and `ghana`
109
+ backends load: they are not for commercial use. [Licences](docs/licences.md)
110
+ gives the restricted item of each backend and the licence of each file.
111
+
112
+ ## Documentation
113
+
114
+ The [documentation index](docs/index.md) lists every page in reading order.
115
+ The [scriptconv documentation](https://github.com/TigreGotico/scriptconv/tree/dev/docs)
116
+ explains the phonemizer contract and the other backends.
@@ -35,4 +35,5 @@ tests/test_phonemizers_cjk_ar.py
35
35
  tests/test_phonemizers_friendly_import_errors.py
36
36
  tests/test_phonemizers_ghana.py
37
37
  tests/test_phonemizers_halabi_iqra.py
38
- tests/test_phonemizers_identity.py
38
+ tests/test_phonemizers_identity.py
39
+ tests/test_phonemizers_mantoq_long_digits.py
@@ -0,0 +1,80 @@
1
+ """Long digit runs through the mantoq number step.
2
+
3
+ The Arabic number tables reach تريليون, 10**12, so 15 digits is the largest run
4
+ they speak as one quantity. A longer run is read digit by digit: no speaker
5
+ reads 20000 digits as one number, and ``int()`` refuses a run over 4300 digits
6
+ outright, which turned any long run into a crash.
7
+ """
8
+ import time
9
+ import unittest
10
+ from importlib import import_module
11
+
12
+ from scriptconv_nonfree.phonemizers import ar as ar_phonemizers
13
+
14
+ # the module itself, not the function the package re-exports under the same name
15
+ numbers = import_module(
16
+ "scriptconv_nonfree.phonemizers._vendored.mantoq.num2words")
17
+
18
+ MAX_QUANTITY_DIGITS = 15 # 10**15 - 1, the reach of تريليون, 10**12
19
+ DECIMAL_SEPARATOR_WORD = "فاصلة"
20
+
21
+ # num2words() output recorded from the code before a long run was read digit by
22
+ # digit: the largest number the tables speak as one quantity, plus common ones.
23
+ UNCHANGED = {
24
+ "9" * MAX_QUANTITY_DIGITS: (
25
+ "تسعمئة وتسعة وتسعون تريليون وتسعمئة وتسعة وتسعون مليار وتسعمئة "
26
+ "وتسعة وتسعون مليون وتسعمئة وتسعة وتسعون ألف وتسعمئة وتسعة وتسعون"),
27
+ "2026": "ألفان وستة وعشرون",
28
+ "3.5": "ثلاثة فاصلة خمسة",
29
+ "100": "مئة",
30
+ }
31
+
32
+ # A digit run one digit over what the tables speak as one quantity.
33
+ OVER_THE_CAP = "1234567890123456"
34
+
35
+
36
+ def digit_by_digit(digits: str) -> str:
37
+ """A digit run as the single-digit readings num2words itself gives."""
38
+ return " ".join(numbers.num2words(digit) for digit in digits)
39
+
40
+
41
+ def phonemize(text: str):
42
+ phonemizer = ar_phonemizers.MantoqPhonemizer()
43
+ started = time.monotonic()
44
+ out = phonemizer.phonemize(text, "ar")
45
+ return out, time.monotonic() - started
46
+
47
+
48
+ class TestLongDigitRuns(unittest.TestCase):
49
+ def test_4301_digit_run_phonemizes(self):
50
+ out, elapsed = phonemize("7" * 4301)
51
+ self.assertTrue(out)
52
+ self.assertLess(elapsed, 5.0, "4301 digits took %.1fs" % elapsed)
53
+
54
+ def test_20000_digit_run_phonemizes(self):
55
+ out, elapsed = phonemize("7" * 20000)
56
+ self.assertTrue(out)
57
+ self.assertLess(elapsed, 5.0, "20000 digits took %.1fs" % elapsed)
58
+
59
+ def test_one_digit_over_the_cap_reads_digit_by_digit(self):
60
+ self.assertEqual(len(OVER_THE_CAP), MAX_QUANTITY_DIGITS + 1)
61
+ self.assertEqual(numbers.num2words(OVER_THE_CAP),
62
+ digit_by_digit(OVER_THE_CAP))
63
+
64
+ def test_overlong_integer_part_of_a_decimal(self):
65
+ digits = "8" * 5000
66
+ expected = digit_by_digit(digits) + " " + DECIMAL_SEPARATOR_WORD + \
67
+ " " + digit_by_digit("25")
68
+ self.assertEqual(numbers.num2words(digits + ".25"), expected)
69
+
70
+ def test_runs_within_the_cap_keep_their_output(self):
71
+ for number, expected in UNCHANGED.items():
72
+ self.assertEqual(numbers.num2words(number), expected, number)
73
+
74
+ def test_the_number_step_uses_the_cap_the_tests_assume(self):
75
+ self.assertEqual(getattr(numbers, "MAX_QUANTITY_DIGITS", None),
76
+ MAX_QUANTITY_DIGITS)
77
+
78
+
79
+ if __name__ == "__main__":
80
+ unittest.main()
@@ -1,122 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: scriptconv-nonfree
3
- Version: 0.2.0a1
4
- Summary: scriptconv phonemizer backends whose code, data or dependencies are non-commercial or carry no licence grant
5
- Author-email: TigreGotico <contact@tigregotico.com>
6
- License-Expression: Apache-2.0 AND MIT AND CC-BY-NC-4.0 AND LicenseRef-AfricaG2P-Data
7
- Project-URL: Homepage, https://github.com/TigreGotico/scriptconv-nonfree
8
- Project-URL: Repository, https://github.com/TigreGotico/scriptconv-nonfree
9
- Project-URL: Issues, https://github.com/TigreGotico/scriptconv-nonfree/issues
10
- Keywords: g2p,phonemizer,tts,scriptconv,arabic,mantoq,halabi,iqra,vietnamese,african-languages
11
- Classifier: Development Status :: 3 - Alpha
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Intended Audience :: Science/Research
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Programming Language :: Python :: 3.13
18
- Classifier: Topic :: Text Processing :: Linguistic
19
- Requires-Python: >=3.11
20
- Description-Content-Type: text/markdown
21
- License-File: LICENSE
22
- License-File: scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.md
23
- License-File: scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.mantoq
24
- License-File: scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.cc-by-nc-4.0
25
- License-File: scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/LICENSE.md
26
- License-File: scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/LICENSE.cc-by-nc-4.0
27
- License-File: LICENSE.africa-g2p-data.md
28
- Requires-Dist: scriptconv[phonemizers]>=0.0.4a98
29
- Provides-Extra: ar-phonemizers
30
- Requires-Dist: ovos-number-parser; extra == "ar-phonemizers"
31
- Provides-Extra: vi
32
- Requires-Dist: viphoneme; python_version < "3.12" and extra == "vi"
33
- Requires-Dist: vinorm; python_version < "3.12" and extra == "vi"
34
- Requires-Dist: underthesea; python_version < "3.12" and extra == "vi"
35
- Requires-Dist: eng_to_ipa; python_version < "3.12" and extra == "vi"
36
- Provides-Extra: africa
37
- Requires-Dist: africa-g2p>=0.3.5; extra == "africa"
38
- Provides-Extra: ghana
39
- Requires-Dist: ghana-g2p>=0.1.1; extra == "ghana"
40
- Requires-Dist: africa-g2p>=0.3.5; extra == "ghana"
41
- Provides-Extra: test
42
- Requires-Dist: pytest; extra == "test"
43
- Requires-Dist: pytest-timeout; extra == "test"
44
- Requires-Dist: ovos-number-parser; extra == "test"
45
- Requires-Dist: africa-g2p>=0.3.5; extra == "test"
46
- Requires-Dist: ghana-g2p>=0.1.1; extra == "test"
47
- Requires-Dist: viphoneme; python_version < "3.12" and extra == "test"
48
- Requires-Dist: vinorm; python_version < "3.12" and extra == "test"
49
- Requires-Dist: underthesea; python_version < "3.12" and extra == "test"
50
- Requires-Dist: eng_to_ipa; python_version < "3.12" and extra == "test"
51
- Requires-Dist: linguatag[langcodes]>=0.2.3a1; extra == "test"
52
- Requires-Dist: packaging; extra == "test"
53
- Dynamic: license-file
54
-
55
- # scriptconv-nonfree
56
-
57
- The scriptconv phonemizer backends whose code, data or dependencies are for non-commercial use only, or carry no licence grant.
58
-
59
- ## Where this fits
60
-
61
- [scriptconv](https://github.com/TigreGotico/scriptconv) is the text conversion library. Its wheel holds only Apache-2.0 code. Each backend in this package has a non-commercial licence, or data with no licence grant, somewhere in its chain, so it ships here instead.
62
-
63
- scriptconv keeps the registry. A backend keeps its `Phonemizer` value and its routing entry in scriptconv, and scriptconv imports the class from this package only when a caller asks for that backend. The scriptconv extra of each backend installs this package:
64
-
65
- ```bash
66
- pip install scriptconv[ar-phonemizers]
67
- ```
68
-
69
- ```python
70
- from scriptconv.phonemizers import Phonemizer, get_phonemizer
71
-
72
- get_phonemizer(Phonemizer.MANTOQ).phonemize_string("مرحبا", "ar")
73
- ```
74
-
75
- This package depends on scriptconv. scriptconv never imports this package when it is imported itself.
76
-
77
- ## Backends
78
-
79
- | `Phonemizer` value | Class | Module | Restricted item in the chain |
80
- | --- | --- | --- | --- |
81
- | `mantoq` | `MantoqPhonemizer` | `scriptconv_nonfree.phonemizers.ar` | the vendored Halabi phonetiser in mantoq (CC-BY-NC-4.0) |
82
- | `halabi` | `HalabiPhonemizer` | `scriptconv_nonfree.phonemizers.ar` | the same vendored phonetiser (CC-BY-NC-4.0) |
83
- | `iqra` | `IqraPhonemizer` | `scriptconv_nonfree.phonemizers.ar` | the vendored IqraEval phonetiser (CC-BY-NC-4.0) |
84
- | `viphoneme` | `VIPhonemePhonemizer` | `scriptconv_nonfree.phonemizers.vi` | viphoneme and vinorm, which PyPI marks "Free for non-commercial use" |
85
- | `africa_g2p` | `AfricaG2PPhonemizer` | `scriptconv_nonfree.phonemizers.africa` | the africa-g2p language data, which has no licence grant |
86
- | `ghana_g2p` | `GhanaG2PPhonemizer` | `scriptconv_nonfree.phonemizers.ghana` | the same africa-g2p language data, which ghana-g2p loads |
87
-
88
- Each backend's own dependencies install with the extra of the same name, for example `pip install scriptconv-nonfree[vi]`.
89
-
90
- ## The African backends
91
-
92
- The `africa` extra installs `africa-g2p>=0.3.5` from PyPI (AfriSpeech/africa-g2p). The `ghana` extra installs `ghana-g2p>=0.1.1` (GhanaNLP/ghana-g2p) with the same africa-g2p floor. ghana-g2p loads the same installed africa-g2p, so the two backends always read the same rule tables. `identity()` of `AfricaG2PPhonemizer` gives the africa-g2p version, and `identity()` of `GhanaG2PPhonemizer` gives the ghana-g2p version.
93
-
94
- Each africa-g2p rule table has a `confidence` field. A table with `omniglot`, `high`, `medium` or `hand-verified` is transcribed from an Omniglot chart or from Hartell (ed.), *Alphabets of Africa* (UNESCO, 1993). Both backends serve these tables by default.
95
-
96
- They also serve the 5 `tts-reviewed` tables of africa-g2p 0.3.5 by default: Dagbani, Ewe, Fante, Ga and Twi. Each is an Omniglot chart with corrections that an LLM proposed. No native speaker has checked the corrections. The corrected Ewe table measures closer to WikiPron Ewe than the chart it replaces: phoneme error rate 0.4690 against 0.4948 on 247 words.
97
-
98
- Every other value is a draft, also a value that a later africa-g2p adds. In africa-g2p 0.3.5, 352 tables are `llm-draft`: an LLM drafted them from corpus text, and no chart backs them. Both backends refuse a draft table. The error is `UnsupportedLanguageError`, and its message names the table, its `confidence` value and the africa-g2p version. To use draft tables, build the backend with `allow_draft_rules=True`:
99
-
100
- ```python
101
- from scriptconv.phonemizers import Phonemizer, get_phonemizer
102
-
103
- get_phonemizer(Phonemizer.AFRICA_G2P, allow_draft_rules=True).phonemize_string("aba", "aab")
104
- ```
105
-
106
- `supported_langs()` lists the tables served by default: 398 of the 750 tables of africa-g2p 0.3.5, and all 42 ghana-g2p languages. `supported_langs(allow_draft_rules=True)` lists all of them.
107
-
108
- ## Licence
109
-
110
- The package holds files under several licences. The SPDX expression is `Apache-2.0 AND MIT AND CC-BY-NC-4.0 AND LicenseRef-AfricaG2P-Data`.
111
-
112
- | Files | Licence | Notice |
113
- | --- | --- | --- |
114
- | `scriptconv_nonfree/phonemizers/_vendored/mantoq/buck/phonetise_buckwalter.py` | CC-BY-NC-4.0 | `LICENSE.md` and `LICENSE.cc-by-nc-4.0` in `_vendored/mantoq/`. Upstream: nawarhalabi/Arabic-Phonetiser. |
115
- | `scriptconv_nonfree/phonemizers/_vendored/mantoq/num2words.py` | Apache-2.0 | `LICENSE`. Written for scriptconv on top of ovos-number-parser. |
116
- | every other file in `scriptconv_nonfree/phonemizers/_vendored/mantoq/` | MIT | `LICENSE.mantoq` in that directory. Upstream: mush42/mantoq. |
117
- | `scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/` | CC-BY-NC-4.0 | `LICENSE.md` and `LICENSE.cc-by-nc-4.0` in that directory. Upstream: Iqra-Eval/MSA_phonetiser, a fork of Arabic-Phonetiser. |
118
- | every other file | Apache-2.0 | `LICENSE` |
119
-
120
- `LicenseRef-AfricaG2P-Data` is the language data of the installed africa-g2p distribution, which the `africa` and `ghana` backends load. This package holds no copy of it. The code of africa-g2p is Apache-2.0, but its rule tables have no licence grant. `LICENSE.africa-g2p-data.md` states the terms and quotes the upstream data notice.
121
-
122
- The CC-BY-NC-4.0 files and the africa-g2p data are not for commercial use. The dependencies of each backend keep their own licences.
@@ -1,68 +0,0 @@
1
- # scriptconv-nonfree
2
-
3
- The scriptconv phonemizer backends whose code, data or dependencies are for non-commercial use only, or carry no licence grant.
4
-
5
- ## Where this fits
6
-
7
- [scriptconv](https://github.com/TigreGotico/scriptconv) is the text conversion library. Its wheel holds only Apache-2.0 code. Each backend in this package has a non-commercial licence, or data with no licence grant, somewhere in its chain, so it ships here instead.
8
-
9
- scriptconv keeps the registry. A backend keeps its `Phonemizer` value and its routing entry in scriptconv, and scriptconv imports the class from this package only when a caller asks for that backend. The scriptconv extra of each backend installs this package:
10
-
11
- ```bash
12
- pip install scriptconv[ar-phonemizers]
13
- ```
14
-
15
- ```python
16
- from scriptconv.phonemizers import Phonemizer, get_phonemizer
17
-
18
- get_phonemizer(Phonemizer.MANTOQ).phonemize_string("مرحبا", "ar")
19
- ```
20
-
21
- This package depends on scriptconv. scriptconv never imports this package when it is imported itself.
22
-
23
- ## Backends
24
-
25
- | `Phonemizer` value | Class | Module | Restricted item in the chain |
26
- | --- | --- | --- | --- |
27
- | `mantoq` | `MantoqPhonemizer` | `scriptconv_nonfree.phonemizers.ar` | the vendored Halabi phonetiser in mantoq (CC-BY-NC-4.0) |
28
- | `halabi` | `HalabiPhonemizer` | `scriptconv_nonfree.phonemizers.ar` | the same vendored phonetiser (CC-BY-NC-4.0) |
29
- | `iqra` | `IqraPhonemizer` | `scriptconv_nonfree.phonemizers.ar` | the vendored IqraEval phonetiser (CC-BY-NC-4.0) |
30
- | `viphoneme` | `VIPhonemePhonemizer` | `scriptconv_nonfree.phonemizers.vi` | viphoneme and vinorm, which PyPI marks "Free for non-commercial use" |
31
- | `africa_g2p` | `AfricaG2PPhonemizer` | `scriptconv_nonfree.phonemizers.africa` | the africa-g2p language data, which has no licence grant |
32
- | `ghana_g2p` | `GhanaG2PPhonemizer` | `scriptconv_nonfree.phonemizers.ghana` | the same africa-g2p language data, which ghana-g2p loads |
33
-
34
- Each backend's own dependencies install with the extra of the same name, for example `pip install scriptconv-nonfree[vi]`.
35
-
36
- ## The African backends
37
-
38
- The `africa` extra installs `africa-g2p>=0.3.5` from PyPI (AfriSpeech/africa-g2p). The `ghana` extra installs `ghana-g2p>=0.1.1` (GhanaNLP/ghana-g2p) with the same africa-g2p floor. ghana-g2p loads the same installed africa-g2p, so the two backends always read the same rule tables. `identity()` of `AfricaG2PPhonemizer` gives the africa-g2p version, and `identity()` of `GhanaG2PPhonemizer` gives the ghana-g2p version.
39
-
40
- Each africa-g2p rule table has a `confidence` field. A table with `omniglot`, `high`, `medium` or `hand-verified` is transcribed from an Omniglot chart or from Hartell (ed.), *Alphabets of Africa* (UNESCO, 1993). Both backends serve these tables by default.
41
-
42
- They also serve the 5 `tts-reviewed` tables of africa-g2p 0.3.5 by default: Dagbani, Ewe, Fante, Ga and Twi. Each is an Omniglot chart with corrections that an LLM proposed. No native speaker has checked the corrections. The corrected Ewe table measures closer to WikiPron Ewe than the chart it replaces: phoneme error rate 0.4690 against 0.4948 on 247 words.
43
-
44
- Every other value is a draft, also a value that a later africa-g2p adds. In africa-g2p 0.3.5, 352 tables are `llm-draft`: an LLM drafted them from corpus text, and no chart backs them. Both backends refuse a draft table. The error is `UnsupportedLanguageError`, and its message names the table, its `confidence` value and the africa-g2p version. To use draft tables, build the backend with `allow_draft_rules=True`:
45
-
46
- ```python
47
- from scriptconv.phonemizers import Phonemizer, get_phonemizer
48
-
49
- get_phonemizer(Phonemizer.AFRICA_G2P, allow_draft_rules=True).phonemize_string("aba", "aab")
50
- ```
51
-
52
- `supported_langs()` lists the tables served by default: 398 of the 750 tables of africa-g2p 0.3.5, and all 42 ghana-g2p languages. `supported_langs(allow_draft_rules=True)` lists all of them.
53
-
54
- ## Licence
55
-
56
- The package holds files under several licences. The SPDX expression is `Apache-2.0 AND MIT AND CC-BY-NC-4.0 AND LicenseRef-AfricaG2P-Data`.
57
-
58
- | Files | Licence | Notice |
59
- | --- | --- | --- |
60
- | `scriptconv_nonfree/phonemizers/_vendored/mantoq/buck/phonetise_buckwalter.py` | CC-BY-NC-4.0 | `LICENSE.md` and `LICENSE.cc-by-nc-4.0` in `_vendored/mantoq/`. Upstream: nawarhalabi/Arabic-Phonetiser. |
61
- | `scriptconv_nonfree/phonemizers/_vendored/mantoq/num2words.py` | Apache-2.0 | `LICENSE`. Written for scriptconv on top of ovos-number-parser. |
62
- | every other file in `scriptconv_nonfree/phonemizers/_vendored/mantoq/` | MIT | `LICENSE.mantoq` in that directory. Upstream: mush42/mantoq. |
63
- | `scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/` | CC-BY-NC-4.0 | `LICENSE.md` and `LICENSE.cc-by-nc-4.0` in that directory. Upstream: Iqra-Eval/MSA_phonetiser, a fork of Arabic-Phonetiser. |
64
- | every other file | Apache-2.0 | `LICENSE` |
65
-
66
- `LicenseRef-AfricaG2P-Data` is the language data of the installed africa-g2p distribution, which the `africa` and `ghana` backends load. This package holds no copy of it. The code of africa-g2p is Apache-2.0, but its rule tables have no licence grant. `LICENSE.africa-g2p-data.md` states the terms and quotes the upstream data notice.
67
-
68
- The CC-BY-NC-4.0 files and the africa-g2p data are not for commercial use. The dependencies of each backend keep their own licences.
@@ -1,122 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: scriptconv-nonfree
3
- Version: 0.2.0a1
4
- Summary: scriptconv phonemizer backends whose code, data or dependencies are non-commercial or carry no licence grant
5
- Author-email: TigreGotico <contact@tigregotico.com>
6
- License-Expression: Apache-2.0 AND MIT AND CC-BY-NC-4.0 AND LicenseRef-AfricaG2P-Data
7
- Project-URL: Homepage, https://github.com/TigreGotico/scriptconv-nonfree
8
- Project-URL: Repository, https://github.com/TigreGotico/scriptconv-nonfree
9
- Project-URL: Issues, https://github.com/TigreGotico/scriptconv-nonfree/issues
10
- Keywords: g2p,phonemizer,tts,scriptconv,arabic,mantoq,halabi,iqra,vietnamese,african-languages
11
- Classifier: Development Status :: 3 - Alpha
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Intended Audience :: Science/Research
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Programming Language :: Python :: 3.13
18
- Classifier: Topic :: Text Processing :: Linguistic
19
- Requires-Python: >=3.11
20
- Description-Content-Type: text/markdown
21
- License-File: LICENSE
22
- License-File: scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.md
23
- License-File: scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.mantoq
24
- License-File: scriptconv_nonfree/phonemizers/_vendored/mantoq/LICENSE.cc-by-nc-4.0
25
- License-File: scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/LICENSE.md
26
- License-File: scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/LICENSE.cc-by-nc-4.0
27
- License-File: LICENSE.africa-g2p-data.md
28
- Requires-Dist: scriptconv[phonemizers]>=0.0.4a98
29
- Provides-Extra: ar-phonemizers
30
- Requires-Dist: ovos-number-parser; extra == "ar-phonemizers"
31
- Provides-Extra: vi
32
- Requires-Dist: viphoneme; python_version < "3.12" and extra == "vi"
33
- Requires-Dist: vinorm; python_version < "3.12" and extra == "vi"
34
- Requires-Dist: underthesea; python_version < "3.12" and extra == "vi"
35
- Requires-Dist: eng_to_ipa; python_version < "3.12" and extra == "vi"
36
- Provides-Extra: africa
37
- Requires-Dist: africa-g2p>=0.3.5; extra == "africa"
38
- Provides-Extra: ghana
39
- Requires-Dist: ghana-g2p>=0.1.1; extra == "ghana"
40
- Requires-Dist: africa-g2p>=0.3.5; extra == "ghana"
41
- Provides-Extra: test
42
- Requires-Dist: pytest; extra == "test"
43
- Requires-Dist: pytest-timeout; extra == "test"
44
- Requires-Dist: ovos-number-parser; extra == "test"
45
- Requires-Dist: africa-g2p>=0.3.5; extra == "test"
46
- Requires-Dist: ghana-g2p>=0.1.1; extra == "test"
47
- Requires-Dist: viphoneme; python_version < "3.12" and extra == "test"
48
- Requires-Dist: vinorm; python_version < "3.12" and extra == "test"
49
- Requires-Dist: underthesea; python_version < "3.12" and extra == "test"
50
- Requires-Dist: eng_to_ipa; python_version < "3.12" and extra == "test"
51
- Requires-Dist: linguatag[langcodes]>=0.2.3a1; extra == "test"
52
- Requires-Dist: packaging; extra == "test"
53
- Dynamic: license-file
54
-
55
- # scriptconv-nonfree
56
-
57
- The scriptconv phonemizer backends whose code, data or dependencies are for non-commercial use only, or carry no licence grant.
58
-
59
- ## Where this fits
60
-
61
- [scriptconv](https://github.com/TigreGotico/scriptconv) is the text conversion library. Its wheel holds only Apache-2.0 code. Each backend in this package has a non-commercial licence, or data with no licence grant, somewhere in its chain, so it ships here instead.
62
-
63
- scriptconv keeps the registry. A backend keeps its `Phonemizer` value and its routing entry in scriptconv, and scriptconv imports the class from this package only when a caller asks for that backend. The scriptconv extra of each backend installs this package:
64
-
65
- ```bash
66
- pip install scriptconv[ar-phonemizers]
67
- ```
68
-
69
- ```python
70
- from scriptconv.phonemizers import Phonemizer, get_phonemizer
71
-
72
- get_phonemizer(Phonemizer.MANTOQ).phonemize_string("مرحبا", "ar")
73
- ```
74
-
75
- This package depends on scriptconv. scriptconv never imports this package when it is imported itself.
76
-
77
- ## Backends
78
-
79
- | `Phonemizer` value | Class | Module | Restricted item in the chain |
80
- | --- | --- | --- | --- |
81
- | `mantoq` | `MantoqPhonemizer` | `scriptconv_nonfree.phonemizers.ar` | the vendored Halabi phonetiser in mantoq (CC-BY-NC-4.0) |
82
- | `halabi` | `HalabiPhonemizer` | `scriptconv_nonfree.phonemizers.ar` | the same vendored phonetiser (CC-BY-NC-4.0) |
83
- | `iqra` | `IqraPhonemizer` | `scriptconv_nonfree.phonemizers.ar` | the vendored IqraEval phonetiser (CC-BY-NC-4.0) |
84
- | `viphoneme` | `VIPhonemePhonemizer` | `scriptconv_nonfree.phonemizers.vi` | viphoneme and vinorm, which PyPI marks "Free for non-commercial use" |
85
- | `africa_g2p` | `AfricaG2PPhonemizer` | `scriptconv_nonfree.phonemizers.africa` | the africa-g2p language data, which has no licence grant |
86
- | `ghana_g2p` | `GhanaG2PPhonemizer` | `scriptconv_nonfree.phonemizers.ghana` | the same africa-g2p language data, which ghana-g2p loads |
87
-
88
- Each backend's own dependencies install with the extra of the same name, for example `pip install scriptconv-nonfree[vi]`.
89
-
90
- ## The African backends
91
-
92
- The `africa` extra installs `africa-g2p>=0.3.5` from PyPI (AfriSpeech/africa-g2p). The `ghana` extra installs `ghana-g2p>=0.1.1` (GhanaNLP/ghana-g2p) with the same africa-g2p floor. ghana-g2p loads the same installed africa-g2p, so the two backends always read the same rule tables. `identity()` of `AfricaG2PPhonemizer` gives the africa-g2p version, and `identity()` of `GhanaG2PPhonemizer` gives the ghana-g2p version.
93
-
94
- Each africa-g2p rule table has a `confidence` field. A table with `omniglot`, `high`, `medium` or `hand-verified` is transcribed from an Omniglot chart or from Hartell (ed.), *Alphabets of Africa* (UNESCO, 1993). Both backends serve these tables by default.
95
-
96
- They also serve the 5 `tts-reviewed` tables of africa-g2p 0.3.5 by default: Dagbani, Ewe, Fante, Ga and Twi. Each is an Omniglot chart with corrections that an LLM proposed. No native speaker has checked the corrections. The corrected Ewe table measures closer to WikiPron Ewe than the chart it replaces: phoneme error rate 0.4690 against 0.4948 on 247 words.
97
-
98
- Every other value is a draft, also a value that a later africa-g2p adds. In africa-g2p 0.3.5, 352 tables are `llm-draft`: an LLM drafted them from corpus text, and no chart backs them. Both backends refuse a draft table. The error is `UnsupportedLanguageError`, and its message names the table, its `confidence` value and the africa-g2p version. To use draft tables, build the backend with `allow_draft_rules=True`:
99
-
100
- ```python
101
- from scriptconv.phonemizers import Phonemizer, get_phonemizer
102
-
103
- get_phonemizer(Phonemizer.AFRICA_G2P, allow_draft_rules=True).phonemize_string("aba", "aab")
104
- ```
105
-
106
- `supported_langs()` lists the tables served by default: 398 of the 750 tables of africa-g2p 0.3.5, and all 42 ghana-g2p languages. `supported_langs(allow_draft_rules=True)` lists all of them.
107
-
108
- ## Licence
109
-
110
- The package holds files under several licences. The SPDX expression is `Apache-2.0 AND MIT AND CC-BY-NC-4.0 AND LicenseRef-AfricaG2P-Data`.
111
-
112
- | Files | Licence | Notice |
113
- | --- | --- | --- |
114
- | `scriptconv_nonfree/phonemizers/_vendored/mantoq/buck/phonetise_buckwalter.py` | CC-BY-NC-4.0 | `LICENSE.md` and `LICENSE.cc-by-nc-4.0` in `_vendored/mantoq/`. Upstream: nawarhalabi/Arabic-Phonetiser. |
115
- | `scriptconv_nonfree/phonemizers/_vendored/mantoq/num2words.py` | Apache-2.0 | `LICENSE`. Written for scriptconv on top of ovos-number-parser. |
116
- | every other file in `scriptconv_nonfree/phonemizers/_vendored/mantoq/` | MIT | `LICENSE.mantoq` in that directory. Upstream: mush42/mantoq. |
117
- | `scriptconv_nonfree/phonemizers/_vendored/iqra_phonetiser/` | CC-BY-NC-4.0 | `LICENSE.md` and `LICENSE.cc-by-nc-4.0` in that directory. Upstream: Iqra-Eval/MSA_phonetiser, a fork of Arabic-Phonetiser. |
118
- | every other file | Apache-2.0 | `LICENSE` |
119
-
120
- `LicenseRef-AfricaG2P-Data` is the language data of the installed africa-g2p distribution, which the `africa` and `ghana` backends load. This package holds no copy of it. The code of africa-g2p is Apache-2.0, but its rule tables have no licence grant. `LICENSE.africa-g2p-data.md` states the terms and quotes the upstream data notice.
121
-
122
- The CC-BY-NC-4.0 files and the africa-g2p data are not for commercial use. The dependencies of each backend keep their own licences.