Two critical fixes for word prediction quality:
1. **Fix pure underscore patterns producing blanks**
- Pure underscore patterns (like "________") were causing ValueError due to incorrect return format
- Fixed match_phonemes_to_words to return proper (word, confidence) tuples instead of just words
- Added neutral word fallbacks: 'the', 'and', 'that', 'this', 'with', 'from', 'they', 'have', 'been'
- Uses pattern length to provide variety: different underscore lengths get different neutral words
2. **Improve variety for repetitive patterns**
- BBBBB was always returning 'be' due to hardcoded consonant_words dictionary
- Updated repetition handling to use expanded character alternatives instead
- Now BBBBB -> 'bay', BBBB -> 'bad', BBBBBB -> 'be' for better variety
- Applied to all characters (vowels and consonants) for consistent behavior
Results:
- ________ -> 'been' (no more blanks)
- BBBBB -> 'bay' (not just 'be')
- B_B_B -> 'baby' (wildcard matching still works)
- Maintains phonetic accuracy while eliminating repetition monotony
Addresses user feedback: "The blanks is really a problem" and "if you can find more alternatives that are also good an make it less repetititves, it will be even better"