From 7cd4d036a7ebc1e0107fca530d1172f20da094de Mon Sep 17 00:00:00 2001 From: zhangruinan Date: Mon, 25 Nov 2019 14:17:05 +0800 Subject: [PATCH] rm non_word_boundaries --- flashtext/keyword.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flashtext/keyword.py b/flashtext/keyword.py index f358c77..f21e3e1 100644 --- a/flashtext/keyword.py +++ b/flashtext/keyword.py @@ -45,10 +45,10 @@ def __init__(self, case_sensitive=False): self._white_space_chars = set(['.', '\t', '\n', '\a', ' ', ',']) try: # python 2.x - self.non_word_boundaries = set(string.digits + string.letters + '_') + self.non_word_boundaries = set('_') except AttributeError: # python 3.x - self.non_word_boundaries = set(string.digits + string.ascii_letters + '_') + self.non_word_boundaries = set('_') self.keyword_trie_dict = dict() self.case_sensitive = case_sensitive self._terms_in_trie = 0