mirror of
https://github.com/yihong0618/bilingual_book_maker.git
synced 2025-06-05 19:15:34 +00:00

* Minor improvements for loader and translator * use rotate key * fix: typo --------- Co-authored-by: yihong0618 <zouzou0208@gmail.com>
17 lines
321 B
Python
17 lines
321 B
Python
import itertools
|
|
from abc import ABC, abstractmethod
|
|
|
|
|
|
class Base(ABC):
|
|
def __init__(self, key, language):
|
|
self.keys = itertools.cycle(key.split(","))
|
|
self.language = language
|
|
|
|
@abstractmethod
|
|
def rotate_key(self):
|
|
pass
|
|
|
|
@abstractmethod
|
|
def translate(self, text):
|
|
pass
|