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

Some key_words have multiple different clean_names #71

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all 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
7 changes: 6 additions & 1 deletion flashtext/keyword.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,12 @@ def __setitem__(self, keyword, clean_name=None):
if self._keyword not in current_dict:
status = True
self._terms_in_trie += 1
current_dict[self._keyword] = clean_name
current_dict[self._keyword] = clean_name
else:
status = True
clean_names = set(current_dict[self._keyword].split('_|_'))
clean_names.add(clean_name)
current_dict[self._keyword] = '_|_'.join(clean_names)
return status

def __delitem__(self, keyword):
Expand Down