We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c963771 + 0318eb3 commit df067b4Copy full SHA for df067b4
py/makeqstrdata.py
@@ -109,7 +109,11 @@ class TextSplitter:
109
def __init__(self, words):
110
words.sort(key=lambda x: len(x), reverse=True)
111
self.words = set(words)
112
- self.pat = re.compile("|".join(re.escape(w) for w in words) + "|.", flags=re.DOTALL)
+ if words:
113
+ pat = "|".join(re.escape(w) for w in words) + "|."
114
+ else:
115
+ pat = "."
116
+ self.pat = re.compile(pat, flags=re.DOTALL)
117
118
def iter_words(self, text):
119
s = []
0 commit comments