Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TTS][G2P] deprecate add_symbols #5961

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions nemo_text_processing/g2p/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,6 @@ def _normalize_dict(self, phoneme_dict_obj: Dict[str, List[List[str]]]) -> Tuple

return g2p_dict, symbols

# TODO @xueyang: deprecate this function because it is useless. If unknown graphemes appear, then apply_to_oov_words
# should handle it.
def add_symbols(self, symbols: str) -> None:
"""By default, the G2P symbols will be inferred from the words & pronunciations in the phoneme_dict.
Use this to add characters in the vocabulary that are not present in the phoneme_dict.
"""
symbols = normalize_unicode_text(symbols)
self.symbols.update(symbols)

def is_unique_in_phoneme_dict(self, word: str) -> bool:
return len(self.phoneme_dict[word]) == 1

Expand Down