SIGN IN SIGN UP
coqui-ai / TTS UNCLAIMED

🐸💬 - a deep learning toolkit for Text-to-Speech, battle-tested in research and production

0 0 69 Python

fix: correctly strip/restore initial punctuation (#3336)

* refactor(punctuation): remove orphan code for handling lone punctuation

The case of lone punctuation is already handled at the top of restore(). The
removed if statement would never be called and would in fact raise an
AttributeError because the _punc_index named tuple doesn't have the attribute
`mark`.

* refactor(punctuation): remove unused argument

* fix(punctuation): correctly handle initial punctuation

Stripping and restoring initial punctuation didn't work correctly because the
string-splitting caused an additional empty string to be inserted in the text
list (because `".A".split(".")` => `["", "A"]`). Now, an initial empty string is
skipped and relevant test cases are added.

Fixes #3333
E
Enno Hermann committed
39321d02befe17ad49194c0d42f8020d8fb8a856
Parent: 9328338
Committed by GitHub <noreply@github.com> on 11/30/2023, 12:03:16 PM