MCPcopy
hub / github.com/coqui-ai/TTS / strip

Method strip

TTS/tts/utils/text/punctuation.py:61–71  ·  view source on GitHub ↗

Remove all the punctuations by replacing with `space`. Args: text (str): The text to be processed. Example:: "This is. example !" -> "This is example "

(self, text)

Source from the content-addressed store, hash-verified

59 self.puncs_regular_exp = re.compile(rf"(\s*[{re.escape(self._puncs)}]+\s*)+")
60
61 def strip(self, text):
62 """Remove all the punctuations by replacing with `space`.
63
64 Args:
65 text (str): The text to be processed.
66
67 Example::
68
69 "This is. example !" -> "This is example "
70 """
71 return re.sub(self.puncs_regular_exp, " ", text).rstrip().lstrip()
72
73 def strip_to_restore(self, text):
74 """Remove punctuations from text to restore them later.

Callers 15

setup.pyFile · 0.80
sync_readmeFunction · 0.80
test_phonemizeMethod · 0.80
test_strip_puncMethod · 0.80
conf.pyFile · 0.80
__init__.pyFile · 0.80
get_commit_hashFunction · 0.80
print_model_licenseMethod · 0.80
download_and_extractFunction · 0.80

Calls

no outgoing calls

Tested by 5

test_phonemizeMethod · 0.64
test_strip_puncMethod · 0.64