skrutable 2.9.3__tar.gz → 2.10.0__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.
- {skrutable-2.9.3 → skrutable-2.10.0}/PKG-INFO +17 -3
- skrutable-2.10.0/src/skrutable/__init__.py +1 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/splitting.py +8 -2
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/transliteration.py +20 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable.egg-info/PKG-INFO +17 -3
- skrutable-2.9.3/src/skrutable/__init__.py +0 -1
- {skrutable-2.9.3 → skrutable-2.10.0}/LICENSE.md +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/README.md +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/setup.cfg +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/setup.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/config.json +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/config.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/generate_scheme_vectors.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/impossible_bigrams.json +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/manual.md +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/meter_identification.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/meter_patterns.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/phonemes.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/profiling_runner.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/run_examples.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/scansion.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/scheme_detection.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/scheme_maps.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/scheme_vectors.json +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/scheme_vectors_mbh.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/utils.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable/virAma_avoidance.py +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable.egg-info/SOURCES.txt +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable.egg-info/dependency_links.txt +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable.egg-info/requires.txt +0 -0
- {skrutable-2.9.3 → skrutable-2.10.0}/src/skrutable.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: skrutable
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.10.0
|
|
4
4
|
Summary: skrutable library for working with Sanskrit text
|
|
5
5
|
Home-page: https://github.com/tylergneill/skrutable
|
|
6
6
|
Author: Tyler Neill
|
|
@@ -8,8 +8,22 @@ Author-email: tyler.g.neill@gmail.com
|
|
|
8
8
|
License: CC BY-SA 4.0
|
|
9
9
|
Keywords: Sanskrit text transliteration scansion meter identification sandhi compound splitting
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
|
-
Provides-Extra: testing
|
|
12
11
|
License-File: LICENSE.md
|
|
12
|
+
Requires-Dist: numpy
|
|
13
|
+
Requires-Dist: requests
|
|
14
|
+
Provides-Extra: testing
|
|
15
|
+
Requires-Dist: pytest; extra == "testing"
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: author-email
|
|
18
|
+
Dynamic: description
|
|
19
|
+
Dynamic: description-content-type
|
|
20
|
+
Dynamic: home-page
|
|
21
|
+
Dynamic: keywords
|
|
22
|
+
Dynamic: license
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
Dynamic: provides-extra
|
|
25
|
+
Dynamic: requires-dist
|
|
26
|
+
Dynamic: summary
|
|
13
27
|
|
|
14
28
|
# skrutable
|
|
15
29
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.10.0"
|
|
@@ -234,6 +234,7 @@ class Splitter(object):
|
|
|
234
234
|
splitter_model: str='dharmamitra_2024_sept',
|
|
235
235
|
preserve_compound_hyphens: bool = PRESERVE_COMPOUND_HYPHENS_DEFAULT,
|
|
236
236
|
preserve_punctuation: bool=PRESERVE_PUNCTUATION_DEFAULT,
|
|
237
|
+
preserve_dandas: bool = False,
|
|
237
238
|
) -> str:
|
|
238
239
|
"""
|
|
239
240
|
Splits sandhi and compounds of multi-line Sanskrit string,
|
|
@@ -243,12 +244,17 @@ class Splitter(object):
|
|
|
243
244
|
from_scheme: input transliteration scheme (None = auto-detect).
|
|
244
245
|
to_scheme: output transliteration scheme (None = IAST, the hub scheme).
|
|
245
246
|
Processing always happens in IAST; transliteration wraps the call if needed.
|
|
247
|
+
preserve_dandas: passed to the output transliteration when to_scheme is set,
|
|
248
|
+
so roman output gets | and || unless True (Indic output keeps । and ॥).
|
|
249
|
+
Dandas are always kept through splitting itself,
|
|
250
|
+
so with to_scheme None the output keeps whatever dandas came in.
|
|
246
251
|
"""
|
|
247
252
|
|
|
248
253
|
# transliterate input to IAST (auto-detects if from_scheme is None)
|
|
249
254
|
# anunāsika flattened to anusvāra, which the splitter model expects
|
|
255
|
+
# dandas kept as is (handled as punctuation below)
|
|
250
256
|
T = Transliterator()
|
|
251
|
-
text = T.transliterate(text, from_scheme=from_scheme, to_scheme='IAST', preserve_anunasika=False)
|
|
257
|
+
text = T.transliterate(text, from_scheme=from_scheme, to_scheme='IAST', preserve_anunasika=False, preserve_dandas=True)
|
|
252
258
|
|
|
253
259
|
# save original punctuation
|
|
254
260
|
sentences: List[str]
|
|
@@ -297,6 +303,6 @@ class Splitter(object):
|
|
|
297
303
|
|
|
298
304
|
# transliterate output from IAST if requested
|
|
299
305
|
if to_scheme is not None and to_scheme.upper() != 'IAST':
|
|
300
|
-
final_results = T.transliterate(final_results, from_scheme='IAST', to_scheme=to_scheme)
|
|
306
|
+
final_results = T.transliterate(final_results, from_scheme='IAST', to_scheme=to_scheme, preserve_dandas=preserve_dandas)
|
|
301
307
|
|
|
302
308
|
return final_results
|
|
@@ -161,6 +161,17 @@ class Transliterator():
|
|
|
161
161
|
if to_scheme == 'IASTREDUCED' or not preserve_anunasika:
|
|
162
162
|
self.contents = self.contents.replace('~', 'M')
|
|
163
163
|
|
|
164
|
+
def normalize_dandas(self, to_scheme, preserve_dandas):
|
|
165
|
+
"""
|
|
166
|
+
Internal method.
|
|
167
|
+
|
|
168
|
+
Converts Unicode dandas (। U+0964, ॥ U+0965) to | and ||
|
|
169
|
+
for non-Indic (roman) output schemes, unless preserve_dandas is True.
|
|
170
|
+
"""
|
|
171
|
+
if to_scheme in scheme_maps.indic_schemes or preserve_dandas:
|
|
172
|
+
return
|
|
173
|
+
self.contents = self.contents.replace('\u0965', '||').replace('\u0964', '|')
|
|
174
|
+
|
|
164
175
|
def transliterate(
|
|
165
176
|
self,
|
|
166
177
|
cntnts,
|
|
@@ -169,6 +180,7 @@ class Transliterator():
|
|
|
169
180
|
avoid_virama_indic_scripts: bool = AVOID_VIRAMA_INDIC_SCRIPTS_DEFAULT,
|
|
170
181
|
avoid_virama_non_indic_scripts: bool = AVOID_VIRAMA_NON_INDIC_SCRIPTS_DEFAULT,
|
|
171
182
|
preserve_anunasika: bool = True,
|
|
183
|
+
preserve_dandas: bool = False,
|
|
172
184
|
):
|
|
173
185
|
"""
|
|
174
186
|
User-facing method.
|
|
@@ -193,6 +205,11 @@ class Transliterator():
|
|
|
193
205
|
and a sign given on the semivowel itself
|
|
194
206
|
(devāl̃loke, devālm̐loke, strict SLP devAl~loke) is moved there.
|
|
195
207
|
|
|
208
|
+
Dandas: for non-Indic (roman) output, Unicode । and ॥
|
|
209
|
+
are converted to | and || by default,
|
|
210
|
+
or left as is if preserve_dandas is True.
|
|
211
|
+
Indic-script output always keeps them as is.
|
|
212
|
+
|
|
196
213
|
Result returned via updated self.contents
|
|
197
214
|
and also directly as string.
|
|
198
215
|
"""
|
|
@@ -236,4 +253,7 @@ class Transliterator():
|
|
|
236
253
|
self.linear_preprocessing('SLP', self.scheme_out)
|
|
237
254
|
self.map_replace('SLP', self.scheme_out)
|
|
238
255
|
|
|
256
|
+
# convert Unicode dandas to ASCII pipes for roman output unless preserving
|
|
257
|
+
self.normalize_dandas(self.scheme_out, preserve_dandas)
|
|
258
|
+
|
|
239
259
|
return self.contents
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: skrutable
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.10.0
|
|
4
4
|
Summary: skrutable library for working with Sanskrit text
|
|
5
5
|
Home-page: https://github.com/tylergneill/skrutable
|
|
6
6
|
Author: Tyler Neill
|
|
@@ -8,8 +8,22 @@ Author-email: tyler.g.neill@gmail.com
|
|
|
8
8
|
License: CC BY-SA 4.0
|
|
9
9
|
Keywords: Sanskrit text transliteration scansion meter identification sandhi compound splitting
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
|
-
Provides-Extra: testing
|
|
12
11
|
License-File: LICENSE.md
|
|
12
|
+
Requires-Dist: numpy
|
|
13
|
+
Requires-Dist: requests
|
|
14
|
+
Provides-Extra: testing
|
|
15
|
+
Requires-Dist: pytest; extra == "testing"
|
|
16
|
+
Dynamic: author
|
|
17
|
+
Dynamic: author-email
|
|
18
|
+
Dynamic: description
|
|
19
|
+
Dynamic: description-content-type
|
|
20
|
+
Dynamic: home-page
|
|
21
|
+
Dynamic: keywords
|
|
22
|
+
Dynamic: license
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
Dynamic: provides-extra
|
|
25
|
+
Dynamic: requires-dist
|
|
26
|
+
Dynamic: summary
|
|
13
27
|
|
|
14
28
|
# skrutable
|
|
15
29
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.9.3"
|
|
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
|