Abstract
Sanskrit segmentation presents a significant challenge for natural language processing due to sandhi—euphonic transformations that merge word boundaries into continuous strings. This paper evaluates two distinct computational approaches: an augmented Finite State Transducer (FST) that integrates sandhi rules into a morphological engine, and a two-stage method inspired by Optimality Theory (OT). Our findings demonstrate that the OT-based approach, which separates candidate generation from morphological validation, achieves a superior accuracy of 92.87% and drastically reduces processing time compared to integrated FST models.
Introduction
Unlike many modern languages, written Sanskrit often lacks explicit word boundaries. This "wall of text" phenomenon is driven by sandhi rules, where the phonetic environment at word junctions causes sounds to merge, change, or disappear. For example, the junction of two vowels may result in a single, different vowel. This makes segmentation non-deterministic; a single string can often be split into multiple morphologically valid sequences, only one of which is semantically correct. Traditional greedy algorithms and standard FSTs struggle with the resulting state explosion and lack of prioritization between valid splits.
Methodology
This research explores two architectural strategies for automating the segmentation process.
Approach 1: Augmented FST
The first method attempts to modify a standard morphological FST. In this model, final states (representing the completion of a valid word) are linked back to intermediate states via transitions that represent sandhi rules. By "baking" the segmentation logic directly into the grammar engine, the system attempts to recognize word boundaries as it parses the string.
Approach 2: Optimality Theory (OT)
Inspired by linguistic Optimality Theory, the second approach utilizes a two-step process:
- GEN (Generator): This component recursively identifies all possible positions where a sandhi rule might have been applied, generating an exhaustive list of candidate splits.
- EVAL (Evaluator): Candidates are processed through a high-speed morphological analyzer (
lttoolbox). Invalid word sequences are pruned, and the remaining candidates are ranked using a Scoring Matrix. This matrix incorporates probabilities from a parallel corpus and applies a simplicity penalty ($k$) to favor splits with fewer segments, adhering to the principle of parsimony.
Experimental Setup and Results
The system was trained on a parallel corpus of 100,000 words, from which 2,650 unique sandhi rules were extracted. Evaluation was conducted on a test set of 2,510 words, comparing the two proposed approaches against a simple greedy baseline.
As shown in the table below, Approach 2 significantly outperformed Approach 1 in both accuracy and efficiency. While Approach 1 achieved 71.25% accuracy, it suffered from high computational latency (10 seconds for a 15-letter string). In contrast, Approach 2 achieved 92.87% accuracy and processed the same string in just 0.04 seconds.
Furthermore, for Approach 2, the correct segmentation was found within the top three ranked suggestions in approximately 98% of cases, highlighting the effectiveness of the Scoring Matrix in prioritizing valid linguistic interpretations.
Conclusion and Future Work
The separation of sandhi generation from morphological validation proves to be a more scalable and accurate architecture for Sanskrit segmentation than integrated FST models. Future research will focus on incorporating semantic context to resolve ambiguities between multiple morphologically valid splits and expanding the morphological coverage to include complex verbal derivatives and deceptive white spaces in traditional manuscripts.
Summary updated