karashiiro / karashiiro/TextToTalk

Allow regex graphemes

Open
#111 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
75
Forks
36
Avg merge
3d 10h
Merged PRs (30d)
3

Description

### Discussed in https://github.com/karashiiro/TextToTalk/discussions/104

Originally posted by **johnysandels** April 16, 2022
I was wondering if there was a way to use a regex to only replace a grapheme when the regex applies? So I could make the word `hm` get replaced while not messing with the word `hmm` or `Rhythm` . If some sort of Regex is currently possible I could just regex `\s*[hH]m\W` and then replace pronunciation of `hm` only after the regex matches.
The process I was hoping for would be:

```
Grapheme "hm" detected
if regex `\s*[hH]m\W` matches:
Replace "hm" with "hm̩"
else:
do not replace
```

If this is either already possible, or able to be implemented, it'll be very helpful for short words that are pronounced weirdly, and avoid those short graphemes interacting with longer words that are not included in the lexicon.
Example, a grapheme for "tis", would interact with satisfy. and would make is say " Sa tis F Y"

https://user-images.githubusercontent.com/79720646/163666419-9a8dfc83-890f-4cf1-a5c1-eef24f830f23.mp4

(May need to unmute)

It would also help with Characters and races with a `'s` contained within their names, that are read normally without needing correcting(thus not in the lexicon) getting broken in the same way with the grapheme `'s`.

I could see possible issues with putting regex into the .pls file if a voice backend isn't expecting those contents and needing a separate file for regexing. If it's already possible though, it may not be a problem, and _may_ already be built into AWS and the system backend. I'm not sure, let me know if you know anything!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.