From 0b4269dc0ac34f2495259ae36839e2caa9fc4209 Mon Sep 17 00:00:00 2001 From: David Huggins-Daines Date: Mon, 20 Nov 2023 14:11:44 -0500 Subject: [PATCH] fix(ci): wtf mypy --- alexi/segment.py | 6 ++++-- requirements-dev.txt | 13 ------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/alexi/segment.py b/alexi/segment.py index 3eb0e8a..50069de 100644 --- a/alexi/segment.py +++ b/alexi/segment.py @@ -277,8 +277,10 @@ def literal(_, word): def page2features(page, feature_func: Union[str, FeatureFunc] = literal, n: int = 1): if isinstance(feature_func, str): - feature_func = FEATURES.get(feature_func, literal) - features = [feature_func(i, w) for i, w in enumerate(page)] + feature_func_func = FEATURES.get(feature_func, literal) + else: + feature_func_func = feature_func + features = [feature_func_func(i, w) for i, w in enumerate(page)] def adjacent(features, label): return (":".join((label, feature)) for feature in features if feature != "bias") diff --git a/requirements-dev.txt b/requirements-dev.txt index 5896202..72b01d1 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,17 +6,4 @@ pytest coverage pytest-cov types-beautifulsoup4 -types-colorama -types-decorator -types-docutils -types-html5lib -types-Pillow -types-psutil -types-Pygments -types-python-dateutil -types-pytz types-requests -types-setuptools -types-tabulate -types-tqdm -types-urllib3