Source code for espnet2.text.abs_tokenizer

from abc import ABC, abstractmethod
from typing import Iterable, List


[docs]class AbsTokenizer(ABC):
[docs] @abstractmethod def text2tokens(self, line: str) -> List[str]: raise NotImplementedError
[docs] @abstractmethod def tokens2text(self, tokens: Iterable[str]) -> str: raise NotImplementedError