foobnix / LibreraReader

Book Reader for Android
http://librera.mobi
Other
2.72k stars 297 forks source link

TTS and end-of-line hyphens #1203

Open rlpowell opened 7 months ago

rlpowell commented 7 months ago

The text that gets passed to the replacements engine (i.e. even when replacements are off) and then to TTS has all line-trailing hyphens removed, even when hyphenation is off in the settings. This means that if the original, un-hyphenated text is "This was a very one-sided fight", and the - happens to end up at the end of a line, you get "This was a very onesided fight", which the TTS reader is unlikely to pronounce correctly. (I read a lot of SF; I've had situations like this where the resulting pronunciations were just horrible.)

This is slightly better in hyphenation mode, in as much as it happens less often.

I think the fix here is to find the bit of code that does the trailing hyphen replacement and make sure it doesn't do that if hyphenation isn't turned on in the settings, but I haven't dug into the code yet.

Edit: Ah, I'd forgotten why I stopped reading in hyphenation mode to reduce this problem, but I was quickly reminded; see https://github.com/foobnix/LibreraReader/issues/1204