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

Fails to replace adjacent keywords with empty non-word boundaries #135

Open
jamespicone opened this issue Sep 4, 2022 · 0 comments
Open

Comments

@jamespicone
Copy link

In this example:

test_replacer = KeywordProcessor(case_sensitive=True)
test_replacer.add_keyword("aa", "b")
test_replacer.add_keyword("cc", "d")
test_replacer.set_non_word_boundaries("")

teststring = "aacc"
replacedstring = test_replacer.replace_keywords(teststring)

print("Teststring:\n" + teststring)
print("Replacedstring:\n" + replacedstring)

I get this output:

Teststring:
aacc
Replacedstring:
bcc

I expect to get bd. Am I misunderstanding the intended behaviour, or is this a bug?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant