translator.py 352 B

123456789101112
  1. """
  2. Voice service abstract class
  3. """
  4. class Translator(object):
  5. # please use https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes to specify language
  6. def translate(self, query: str, from_lang: str = "", to_lang: str = "en") -> str:
  7. """
  8. Translate text from one language to another
  9. """
  10. raise NotImplementedError