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