scriptconv 0.0.3a14__tar.gz → 0.0.3a15__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-0.0.3a14 → scriptconv-0.0.3a15}/PKG-INFO +1 -1
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/base.py +7 -4
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/version.py +1 -1
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv.egg-info/PKG-INFO +1 -1
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_phonemizers_base.py +15 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/LICENSE +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/README.md +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/pyproject.toml +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/requirements.txt +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/__init__.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/__main__.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/cangjie.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/conventions.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/data/__init__.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/data/cangjie5_tc.tsv.gz +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/graph.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/notation.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/__init__.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/__init__.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/bw2ipa.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/hangul2ipa.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/ko_tables/aspiration.csv +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/ko_tables/assimilation.csv +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/ko_tables/double_coda.csv +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/ko_tables/hanja.tsv +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/ko_tables/ipa.csv +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/ko_tables/neutralization.csv +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/ko_tables/tensification.csv +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/ko_tables/yale.csv +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/__init__.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/codeswitch.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/diacritize.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/dialectal.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/english_g2p.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/espeak.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/frontend.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/levantine_g2p.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/normalize.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/phoneme_inventory.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/zh_num.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/ar.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/en.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/enums.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/eu.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/fa.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/gl.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/he.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/ja.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/ko.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/mul.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/mwl.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/o2ipa.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/pt.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/registry.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/shami.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/vi.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/zh.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/py.typed +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/readings.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/scripts.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/translit.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv.egg-info/SOURCES.txt +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv.egg-info/dependency_links.txt +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv.egg-info/requires.txt +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv.egg-info/top_level.txt +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/setup.cfg +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_arpa_stress.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_cangjie.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_cli.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_conventions.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_errors_policy.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_examples.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_graph.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_notation.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_phonemizers_cjk_ar.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_readings.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_readings_zh.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_scripts.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_scripts_stressonnx_compat.py +0 -0
- {scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/tests/test_translit.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scriptconv
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.3a15
|
|
4
4
|
Summary: Zero-dependency script & phoneme-notation core — ISO-15924 detection & metadata, IPA↔ARPABET/X-SAMPA/Lexique/Kirshenbaum/Cotovía/RFE, Buckwalter↔Arabic, Hangul→jamo, kana
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Project-URL: Homepage, https://github.com/TigreGotico/scriptconv
|
|
@@ -45,8 +45,9 @@ class BasePhonemizer(metaclass=abc.ABCMeta):
|
|
|
45
45
|
# optional (text, lang) -> str hook run before chunking; see module
|
|
46
46
|
# docstring — scriptconv performs no normalization of its own
|
|
47
47
|
self.normalizer = normalizer
|
|
48
|
-
# local path to a phonikud ONNX model (Hebrew diacritization)
|
|
49
|
-
#
|
|
48
|
+
# local path to a phonikud ONNX model (Hebrew diacritization), or a
|
|
49
|
+
# zero-arg callable resolving one lazily; scriptconv never downloads
|
|
50
|
+
# — the consumer resolves the file
|
|
50
51
|
self.phonikud_model = phonikud_model
|
|
51
52
|
|
|
52
53
|
# diacritizer model name, for languages that need one. Arabic uses
|
|
@@ -59,7 +60,9 @@ class BasePhonemizer(metaclass=abc.ABCMeta):
|
|
|
59
60
|
@property
|
|
60
61
|
def phonikud(self):
|
|
61
62
|
if self._phonikud is None:
|
|
62
|
-
|
|
63
|
+
model = self.phonikud_model() if callable(self.phonikud_model) \
|
|
64
|
+
else self.phonikud_model
|
|
65
|
+
if not model:
|
|
63
66
|
raise ValueError(
|
|
64
67
|
"Hebrew diacritization needs a local phonikud ONNX model: "
|
|
65
68
|
"pass phonikud_model=<path> (scriptconv never downloads "
|
|
@@ -70,7 +73,7 @@ class BasePhonemizer(metaclass=abc.ABCMeta):
|
|
|
70
73
|
raise ImportError(
|
|
71
74
|
"Hebrew diacritization needs phonikud-onnx — install "
|
|
72
75
|
"with `pip install scriptconv[he]`") from None
|
|
73
|
-
self._phonikud = Phonikud(
|
|
76
|
+
self._phonikud = Phonikud(model)
|
|
74
77
|
return self._phonikud
|
|
75
78
|
|
|
76
79
|
def tashkeel(self, model: Optional[str] = None):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scriptconv
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.3a15
|
|
4
4
|
Summary: Zero-dependency script & phoneme-notation core — ISO-15924 detection & metadata, IPA↔ARPABET/X-SAMPA/Lexique/Kirshenbaum/Cotovía/RFE, Buckwalter↔Arabic, Hangul→jamo, kana
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Project-URL: Homepage, https://github.com/TigreGotico/scriptconv
|
|
@@ -159,3 +159,18 @@ class TestFacadeAndGraph(unittest.TestCase):
|
|
|
159
159
|
from scriptconv import phonemizers
|
|
160
160
|
g = DEFAULT_GRAPH.extend(phonemizers.register)
|
|
161
161
|
self.assertTrue(g.can_convert("text", "arpa"))
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class TestPhonikudModelResolver(unittest.TestCase):
|
|
165
|
+
def test_callable_resolver_invoked_lazily(self):
|
|
166
|
+
calls = []
|
|
167
|
+
|
|
168
|
+
def resolver():
|
|
169
|
+
calls.append(1)
|
|
170
|
+
return "" # resolves to nothing -> still the explicit ValueError
|
|
171
|
+
|
|
172
|
+
g = GraphemePhonemizer(phonikud_model=resolver)
|
|
173
|
+
self.assertEqual(calls, []) # not resolved at construction
|
|
174
|
+
with self.assertRaises(ValueError):
|
|
175
|
+
g.add_diacritics("שלום", "he")
|
|
176
|
+
self.assertEqual(calls, [1])
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/hangul2ipa.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/ko_tables/hanja.tsv
RENAMED
|
File without changes
|
{scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/ko_tables/ipa.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/ko_tables/yale.csv
RENAMED
|
File without changes
|
{scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/__init__.py
RENAMED
|
File without changes
|
{scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/codeswitch.py
RENAMED
|
File without changes
|
{scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/diacritize.py
RENAMED
|
File without changes
|
{scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/dialectal.py
RENAMED
|
File without changes
|
{scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/english_g2p.py
RENAMED
|
File without changes
|
{scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/espeak.py
RENAMED
|
File without changes
|
{scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/frontend.py
RENAMED
|
File without changes
|
|
File without changes
|
{scriptconv-0.0.3a14 → scriptconv-0.0.3a15}/scriptconv/phonemizers/_thirdparty/shami/normalize.py
RENAMED
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|