mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
15 lines
347 B
Python
15 lines
347 B
Python
from abc import ABC
|
|
from abc import abstractmethod
|
|
from typing import Iterable
|
|
from typing import List
|
|
|
|
|
|
class AbsTokenizer(ABC):
|
|
@abstractmethod
|
|
def text2tokens(self, line: str) -> List[str]:
|
|
raise NotImplementedError
|
|
|
|
@abstractmethod
|
|
def tokens2text(self, tokens: Iterable[str]) -> str:
|
|
raise NotImplementedError
|