Skip to content

Commit 07f16b1

Browse files
Copilotbact
andcommitted
Improve type precision per bot review feedback
Co-authored-by: bact <128572+bact@users.noreply.github.com>
1 parent 3b548ed commit 07f16b1

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pythainlp/corpus/common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@
6363
_THAI_ORST_WORDS: frozenset[str] = frozenset()
6464

6565
_THAI_DICT: dict[str, list[str]] = {}
66-
_THAI_WSD_DICT: dict[str, list[Any]] = {}
67-
_THAI_SYNONYMS: dict[str, list[Any]] = {}
66+
_THAI_WSD_DICT: dict[str, Union[list[str], list[list[str]]]] = {}
67+
_THAI_SYNONYMS: dict[str, Union[list[str], list[list[str]]]] = {}
6868

6969

7070
def countries() -> frozenset[str]:

pythainlp/translate/tokenization_small100.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def __init__(
171171
encoder_data = load_json(vocab_file)
172172
if not isinstance(encoder_data, dict):
173173
raise ValueError("encoder must be a dict")
174-
self.encoder: dict[str, int] = cast(dict, encoder_data)
174+
self.encoder: dict[str, int] = cast(dict[str, int], encoder_data)
175175
self.decoder = {v: k for k, v in self.encoder.items()}
176176
self.spm_file = spm_file
177177
self.sp_model = load_spm(spm_file, self.sp_model_kwargs)

0 commit comments

Comments
 (0)