Skip to content

Commit 2cb28e8

Browse files
committed
Apply isort and black reformatting
Signed-off-by: jasro23 <jasro23@users.noreply.github.com>
1 parent 23b2422 commit 2cb28e8

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

nemo/collections/tts/g2p/models/kn_in_ipa.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ class KannadaG2p(BaseG2p):
4444
['k', 'a', 'n', 'n', 'a', 'ɖ', 'a']
4545
"""
4646

47-
4847
def __init__(
4948
self,
5049
phoneme_dict: Optional[Union[str, pathlib.Path, Dict[str, List[str]]]] = None,
@@ -93,8 +92,7 @@ def __init__(
9392

9493
# ASCII letter handling for code-mixed text (Kannada + English)
9594
self.ascii_letter_dict = {
96-
x: ascii_letter_prefix + x
97-
for x in get_grapheme_character_set(locale="en-US", case=ascii_letter_case)
95+
x: ascii_letter_prefix + x for x in get_grapheme_character_set(locale="en-US", case=ascii_letter_case)
9896
}
9997
self.ascii_letter_list = sorted(self.ascii_letter_dict)
10098
self.ascii_letter_case = ascii_letter_case
@@ -109,9 +107,7 @@ def __init__(
109107
self._init_kannada_rules()
110108

111109
if apply_to_oov_word is None:
112-
logging.info(
113-
"apply_to_oov_word=None. Using rule-based G2P for out-of-vocabulary words."
114-
)
110+
logging.info("apply_to_oov_word=None. Using rule-based G2P for out-of-vocabulary words.")
115111

116112
super().__init__(
117113
phoneme_dict=phoneme_dict,
@@ -224,24 +220,21 @@ def _init_kannada_rules(self):
224220

225221
def _split_phoneme(self, phoneme: str, prefix: str) -> List[str]:
226222
"""Split multi-character phonemes into separate tokens for consistency.
227-
223+
228224
Splits multi-character phonemes into individual characters for consistent tokenization.
229-
225+
230226
Args:
231227
phoneme: The phoneme string to potentially split.
232228
prefix: Prefix to add to each token.
233-
229+
234230
Returns:
235231
List of prefixed phoneme tokens.
236232
"""
237233
# Split phonemes character-by-character
238234
return [prefix + char for char in phoneme]
239235

240236
@staticmethod
241-
def _parse_phoneme_dict(
242-
phoneme_dict_path: Union[str, pathlib.Path],
243-
phoneme_prefix: str
244-
) -> Dict[str, List[str]]:
237+
def _parse_phoneme_dict(phoneme_dict_path: Union[str, pathlib.Path], phoneme_prefix: str) -> Dict[str, List[str]]:
245238
"""Load pronunciation dictionary file.
246239
247240
Args:

0 commit comments

Comments
 (0)