skrutable 2.6.2__tar.gz → 2.6.3__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.6.2 → skrutable-2.6.3}/PKG-INFO +1 -1
- skrutable-2.6.3/src/skrutable/__init__.py +1 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/meter_identification.py +25 -12
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable.egg-info/PKG-INFO +1 -1
- skrutable-2.6.2/src/skrutable/__init__.py +0 -1
- {skrutable-2.6.2 → skrutable-2.6.3}/LICENSE.md +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/README.md +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/setup.cfg +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/setup.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/config.json +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/config.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/generate_scheme_vectors.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/impossible_bigrams.json +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/manual.md +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/meter_patterns.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/phonemes.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/run_examples.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/scansion.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/scheme_detection.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/scheme_maps.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/scheme_vectors.json +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/scheme_vectors_mbh.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/splitting.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/transliteration.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/utils.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable/virAma_avoidance.py +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable.egg-info/SOURCES.txt +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable.egg-info/dependency_links.txt +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable.egg-info/requires.txt +0 -0
- {skrutable-2.6.2 → skrutable-2.6.3}/src/skrutable.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.6.3"
|
|
@@ -153,6 +153,8 @@ class Diagnostic:
|
|
|
153
153
|
imperfect_label_sanskrit: Optional[dict] = None # keyed by pada (1–4 or 'odd'/'even'); Sanskrit only
|
|
154
154
|
imperfect_label_english: Optional[dict] = None # keyed by pada (1–4 or 'odd'/'even'); English only
|
|
155
155
|
problem_syllables: Optional[dict] = None # keyed by pada (1–4 or 'odd'/'even'); None if perfect
|
|
156
|
+
notable_syllables: Optional[dict] = None # keyed by pada (1–4 or 'odd'/'even'); green-highlighted "interesting/ok" syllables
|
|
157
|
+
notable_label: Optional[dict] = None # keyed by pada (1–4 or 'odd'/'even'); label for the notable feature (same string for skt/eng)
|
|
156
158
|
|
|
157
159
|
def perfect(self):
|
|
158
160
|
return self.perfect_id_label is not None
|
|
@@ -473,17 +475,28 @@ class VerseTester(object):
|
|
|
473
475
|
result = None
|
|
474
476
|
for weights_pattern, label in meter_patterns.anuzwuB_pAda['odd'].items():
|
|
475
477
|
if re.match(weights_pattern, odd_pAda_weights):
|
|
476
|
-
|
|
478
|
+
is_vipula = 'vipulā' in label
|
|
479
|
+
result = Diagnostic(
|
|
480
|
+
perfect_id_label=label,
|
|
481
|
+
notable_syllables={'odd': [4, 5, 6]} if is_vipula else None,
|
|
482
|
+
notable_label={'odd': label} if is_vipula else None,
|
|
483
|
+
)
|
|
477
484
|
break
|
|
478
485
|
if result is None:
|
|
479
486
|
# Odd pāda matched no perfect pattern — try asamīcīna patterns
|
|
480
487
|
# before falling back to the generic ya-gaṇa violation label.
|
|
481
488
|
for weights_pattern, (label, problem_syls, code) in meter_patterns.anuzwuB_pAda_asamIcIna['odd'].items():
|
|
482
489
|
if re.match(weights_pattern, odd_pAda_weights):
|
|
490
|
+
is_vipula = 'vipulā' in label
|
|
491
|
+
# extract vipulā name from label like "asamīcīnā, ma-vipulāyāḥ pūrvam raḥ syāt"
|
|
492
|
+
vipula_match = re.search(r'\w+-vipulā', label)
|
|
493
|
+
vipula_name = vipula_match.group(0) if vipula_match else None
|
|
483
494
|
result = Diagnostic(
|
|
484
495
|
imperfect_label_sanskrit={'odd': label},
|
|
485
496
|
imperfect_label_english={'odd': code},
|
|
486
497
|
problem_syllables={'odd': problem_syls},
|
|
498
|
+
notable_syllables={'odd': [4, 5, 6]} if is_vipula else None,
|
|
499
|
+
notable_label={'odd': vipula_name} if vipula_name else None,
|
|
487
500
|
)
|
|
488
501
|
break
|
|
489
502
|
if result is None:
|
|
@@ -528,7 +541,7 @@ class VerseTester(object):
|
|
|
528
541
|
Vrs.diagnostic = ardham_eva_result
|
|
529
542
|
return ardham_eva_result
|
|
530
543
|
elif ardham_eva_result.imperfect():
|
|
531
|
-
label_str = '; '.join(
|
|
544
|
+
label_str = '; '.join(ardham_eva_result.imperfect_label_sanskrit.values())
|
|
532
545
|
Vrs.meter_label = f"anuṣṭubh (ardham eva: {label_str})"
|
|
533
546
|
Vrs.identification_score = meter_scores["anuṣṭubh, half, single half imperfect)"]
|
|
534
547
|
Vrs.is_perfect = False
|
|
@@ -553,14 +566,14 @@ class VerseTester(object):
|
|
|
553
566
|
# one half imperfect
|
|
554
567
|
|
|
555
568
|
elif pAdas_ab_result.imperfect() and pAdas_cd_result.perfect():
|
|
556
|
-
ab_str = '; '.join(
|
|
569
|
+
ab_str = '; '.join(pAdas_ab_result.imperfect_label_sanskrit.values())
|
|
557
570
|
Vrs.meter_label = f"anuṣṭubh (1,2: {ab_str}; 3,4: {pAdas_cd_result.perfect_id_label})"
|
|
558
571
|
Vrs.identification_score = meter_scores["anuṣṭubh, full, one half perfect, one imperfect)"]
|
|
559
572
|
Vrs.is_perfect = False
|
|
560
573
|
Vrs.diagnostic = {'ab': pAdas_ab_result, 'cd': pAdas_cd_result}
|
|
561
574
|
return pAdas_ab_result
|
|
562
575
|
elif pAdas_ab_result.perfect() and pAdas_cd_result.imperfect():
|
|
563
|
-
cd_str = '; '.join(
|
|
576
|
+
cd_str = '; '.join(pAdas_cd_result.imperfect_label_sanskrit.values())
|
|
564
577
|
Vrs.meter_label = f"anuṣṭubh (1,2: {pAdas_ab_result.perfect_id_label}; 3,4: {cd_str})"
|
|
565
578
|
Vrs.identification_score = meter_scores["anuṣṭubh, full, one half perfect, one imperfect)"]
|
|
566
579
|
Vrs.is_perfect = False
|
|
@@ -570,8 +583,8 @@ class VerseTester(object):
|
|
|
570
583
|
# both halves imperfect
|
|
571
584
|
|
|
572
585
|
elif pAdas_ab_result.imperfect() and pAdas_cd_result.imperfect():
|
|
573
|
-
ab_str = '; '.join(
|
|
574
|
-
cd_str = '; '.join(
|
|
586
|
+
ab_str = '; '.join(pAdas_ab_result.imperfect_label_sanskrit.values())
|
|
587
|
+
cd_str = '; '.join(pAdas_cd_result.imperfect_label_sanskrit.values())
|
|
575
588
|
Vrs.meter_label = f"anuṣṭubh (1,2: {ab_str}; 3,4: {cd_str})"
|
|
576
589
|
Vrs.identification_score = meter_scores["anuṣṭubh, full, both halves imperfect)"]
|
|
577
590
|
Vrs.is_perfect = False
|
|
@@ -581,14 +594,14 @@ class VerseTester(object):
|
|
|
581
594
|
# one half perfect, one length error
|
|
582
595
|
|
|
583
596
|
elif pAdas_ab_result.length_error() and pAdas_cd_result.perfect():
|
|
584
|
-
ab_str = '; '.join(
|
|
597
|
+
ab_str = '; '.join(pAdas_ab_result.imperfect_label_sanskrit.values())
|
|
585
598
|
Vrs.meter_label = f"anuṣṭubh (1,2: ?? {ab_str}; 3,4: {pAdas_cd_result.perfect_id_label})"
|
|
586
599
|
Vrs.identification_score = meter_scores["anuṣṭubh, full, one half perfect, one length error)"]
|
|
587
600
|
Vrs.is_perfect = False
|
|
588
601
|
Vrs.diagnostic = {'ab': pAdas_ab_result, 'cd': pAdas_cd_result}
|
|
589
602
|
return pAdas_cd_result
|
|
590
603
|
elif pAdas_ab_result.perfect() and pAdas_cd_result.length_error():
|
|
591
|
-
cd_str = '; '.join(
|
|
604
|
+
cd_str = '; '.join(pAdas_cd_result.imperfect_label_sanskrit.values())
|
|
592
605
|
Vrs.meter_label = f"anuṣṭubh (1,2: {pAdas_ab_result.perfect_id_label}; 3,4: ?? {cd_str})"
|
|
593
606
|
Vrs.identification_score = meter_scores["anuṣṭubh, full, one half perfect, one length error)"]
|
|
594
607
|
Vrs.is_perfect = False
|
|
@@ -598,16 +611,16 @@ class VerseTester(object):
|
|
|
598
611
|
# one half imperfect, one length error
|
|
599
612
|
|
|
600
613
|
elif pAdas_ab_result.length_error() and pAdas_cd_result.imperfect():
|
|
601
|
-
ab_str = '; '.join(
|
|
602
|
-
cd_str = '; '.join(
|
|
614
|
+
ab_str = '; '.join(pAdas_ab_result.imperfect_label_sanskrit.values())
|
|
615
|
+
cd_str = '; '.join(pAdas_cd_result.imperfect_label_sanskrit.values())
|
|
603
616
|
Vrs.meter_label = f"anuṣṭubh (1,2: ?? {ab_str}; 3,4: {cd_str})"
|
|
604
617
|
Vrs.identification_score = meter_scores["anuṣṭubh, full, one half imperfect, one length error)"]
|
|
605
618
|
Vrs.is_perfect = False
|
|
606
619
|
Vrs.diagnostic = {'ab': pAdas_ab_result, 'cd': pAdas_cd_result}
|
|
607
620
|
return pAdas_cd_result
|
|
608
621
|
elif pAdas_ab_result.imperfect() and pAdas_cd_result.length_error():
|
|
609
|
-
ab_str = '; '.join(
|
|
610
|
-
cd_str = '; '.join(
|
|
622
|
+
ab_str = '; '.join(pAdas_ab_result.imperfect_label_sanskrit.values())
|
|
623
|
+
cd_str = '; '.join(pAdas_cd_result.imperfect_label_sanskrit.values())
|
|
611
624
|
Vrs.meter_label = f"anuṣṭubh (1,2: {ab_str}; 3,4: ?? {cd_str})"
|
|
612
625
|
Vrs.identification_score = meter_scores["anuṣṭubh, full, one half imperfect, one length error)"]
|
|
613
626
|
Vrs.is_perfect = False
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.6.2"
|
|
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
|