WA: when [!] is not at the end of a sentence, it is used as a glottal stop in the phonetic input and sentences are NOT delimited by [!]

This commit is contained in:
Jindrich Matousek 2022-04-06 10:06:06 +02:00
parent 427c9e1100
commit aae77dac07
1 changed files with 7 additions and 1 deletions

View File

@ -155,7 +155,13 @@ class Synthesizer(object):
Returns: Returns:
List[str]: list of sentences. List[str]: list of sentences.
""" """
return self.seg.segment(text) # JMa
# WA: fix glottal stop (!): "ahoj, !", "ahoj." => "ahoj, !ahoj."
# Exclamation mark (!) at the end of the sentence should not be affected.
# return self.seg.segment(text)
sents = self.seg.segment(text)
split_text = " ".join(sents)
return [split_text.replace("! ", "!")]
def save_wav(self, wav: List[int], path: str) -> None: def save_wav(self, wav: List[int], path: str) -> None:
"""Save the waveform as a file. """Save the waveform as a file.