Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove strip_punctuation2 alias of strip_punctuation #2965

Merged
merged 7 commits into from
Jun 29, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gensim/parsing/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""This package contains functions to preprocess raw text"""

from .porter import PorterStemmer # noqa:F401
from .preprocessing import (remove_stopwords, strip_punctuation, strip_punctuation2, # noqa:F401
from .preprocessing import (remove_stopwords, strip_punctuation, # noqa:F401
strip_tags, strip_short, strip_numeric,
strip_non_alphanum, strip_multiple_whitespaces,
split_alphanum, stem_text, preprocess_string,
Expand Down
3 changes: 0 additions & 3 deletions gensim/parsing/preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ def strip_punctuation(s):
return RE_PUNCT.sub(" ", s)


strip_punctuation2 = strip_punctuation


def strip_tags(s):
"""Remove tags from `s` using :const:`~gensim.parsing.preprocessing.RE_TAGS`.

Expand Down
4 changes: 2 additions & 2 deletions gensim/test/test_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import unittest
import numpy as np
from gensim.parsing.preprocessing import \
remove_stopwords, strip_punctuation2, strip_tags, strip_short, strip_numeric, strip_non_alphanum, \
remove_stopwords, strip_punctuation, strip_tags, strip_short, strip_numeric, strip_non_alphanum, \
strip_multiple_whitespaces, split_alphanum, stem_text


Expand Down Expand Up @@ -38,7 +38,7 @@
for many searching purposes, a little fuzziness would help. """


dataset = [strip_punctuation2(x.lower()) for x in [doc1, doc2, doc3, doc4]]
dataset = [strip_punctuation(x.lower()) for x in [doc1, doc2, doc3, doc4]]
# doc1 and doc2 have class 0, doc3 and doc4 avec class 1
classes = np.array([[1, 0], [1, 0], [0, 1], [0, 1]])

Expand Down