add type annotations for legacy tokenizer

This commit is contained in:
Sarah Hoffmann
2022-07-15 22:52:26 +02:00
parent e37cfc64d2
commit 18b16e06ca
3 changed files with 83 additions and 62 deletions

View File

@@ -9,7 +9,7 @@ Abstract class defintions for tokenizers. These base classes are here
mainly for documentation purposes.
"""
from abc import ABC, abstractmethod
from typing import List, Tuple, Dict, Any
from typing import List, Tuple, Dict, Any, Optional
from pathlib import Path
from typing_extensions import Protocol
@@ -187,7 +187,7 @@ class AbstractTokenizer(ABC):
@abstractmethod
def check_database(self, config: Configuration) -> str:
def check_database(self, config: Configuration) -> Optional[str]:
""" Check that the database is set up correctly and ready for being
queried.