Skip to content

Commit

Permalink
Linter recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
shavit committed Sep 30, 2024
1 parent f521211 commit 636ea59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions TTS/tts/utils/text/cleaners.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"""Set of default text cleaners"""

# TODO: pick the cleaner for languages dynamically

import re
from typing import Optional
from unicodedata import normalize

from anyascii import anyascii
from unicodedata import normalize

from TTS.tts.utils.text.chinese_mandarin.numbers import replace_numbers_to_characters_in_text

Expand Down Expand Up @@ -189,7 +187,7 @@ def no_cleaners(text: str) -> str:
return text


def normalize_nfc(text: str) -> str:
"""Canonical decomposition followed by canonical composition"""
def normalize_unicode(text: str) -> str:
"""Normalize Unicode characters."""
text = normalize("NFC", text)
return text
2 changes: 1 addition & 1 deletion tests/text_tests/test_text_cleaners.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

from TTS.tts.utils.text.cleaners import english_cleaners, multilingual_phoneme_cleaners, phoneme_cleaners, normalize_nfc
from TTS.tts.utils.text.cleaners import english_cleaners, multilingual_phoneme_cleaners, normalize_nfc, phoneme_cleaners


def test_time() -> None:
Expand Down

0 comments on commit 636ea59

Please sign in to comment.