feat: Add Turkish Syllabification Module (#43)#50
Open
ada-cinar wants to merge 2 commits into
Open
Conversation
- Implement rule-based Turkish syllabifier following onset maximization - Support (C)(C)V(C)(C) syllable structure - Handle Turkish-specific phonotactics and consonant clusters - Expose syllabify() convenience function and Syllabifier class - Add SyllableInfo dataclass for detailed analysis - Include comprehensive test suite (70+ test cases) - Support case preservation and custom separators - Add Unicode NFC normalization for Turkish characters Closes #43
- Add fast syllabification algorithm in Rust (src/lib.rs)
- Implement Turkish phonotactic rules:
* VCV → V.CV (break before single consonant)
* VCCV → VC.CV (split between double consonants)
* VCC+V → VC.C+V (take first consonant with current syllable)
- Add Python API with Syllabifier class and SyllableInfo dataclass
- Export syllabify(), syllabify_with_separator(), syllable_count()
- Add comprehensive test suite (39 tests, 100% pass)
- Support edge cases: vowel sequences, consonant clusters, circumflex
- Performance: Rust implementation for fast batch processing
Examples:
syllabify('merhaba') → ['mer', 'ha', 'ba']
syllabify('anlamak') → ['an', 'la', 'mak']
syllabify('İstanbul') → ['İs', 'tan', 'bul']
Issue #43 - research-critical feature for prosody, poetry analysis, TTS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements research-critical Turkish syllabification functionality following linguistic principles of onset-nucleus-coda structure and Turkish phonotactics.
Motivation
Syllabification (hece ayırma) is fundamental for:
Implementation
Core Algorithm
Turkish Syllable Boundary Rules
API
Basic Usage
Advanced Analysis
Features
✅ Onset maximization (linguistically correct)
✅ Turkish consonant cluster recognition
✅ Case preservation (İSTANBUL → İS-TAN-BUL)
✅ Unicode NFC normalization (handles İ/i properly)
✅ Custom separator support
✅ Detailed syllable structure analysis
✅ Integration-ready (works with tokenizer)
Testing
Comprehensive test suite with 70+ test cases:
Examples
Performance
Pure Python implementation for Phase 1. Future optimization:
Related
Enables:
Closes #43