File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -291,7 +291,7 @@ def split_on_token(tok, text):
291
291
full_word += sub_text + tok
292
292
elif full_word :
293
293
full_word += sub_text
294
- result += [ full_word ]
294
+ result . append ( full_word )
295
295
full_word = ""
296
296
continue
297
297
# Strip white spaces on the right
@@ -310,16 +310,16 @@ def split_on_token(tok, text):
310
310
sub_text = sub_text .lstrip ()
311
311
312
312
if i == 0 and not sub_text :
313
- result += [ tok ]
313
+ result . append ( tok )
314
314
elif i == len (split_text ) - 1 :
315
315
if sub_text :
316
- result += [ sub_text ]
316
+ result . append ( sub_text )
317
317
else :
318
318
pass
319
319
else :
320
320
if sub_text :
321
- result += [ sub_text ]
322
- result += [ tok ]
321
+ result . append ( sub_text )
322
+ result . append ( tok )
323
323
return result
324
324
325
325
def split_on_tokens (tok_list , text ):
@@ -334,9 +334,9 @@ def split_on_tokens(tok_list, text):
334
334
tokenized_text = []
335
335
for sub_text in text_list :
336
336
if sub_text not in self .unique_no_split_tokens :
337
- tokenized_text += split_on_token (tok , sub_text )
337
+ tokenized_text . extend ( split_on_token (tok , sub_text ) )
338
338
else :
339
- tokenized_text += [ sub_text ]
339
+ tokenized_text . append ( sub_text )
340
340
text_list = tokenized_text
341
341
342
342
return list (
You can’t perform that action at this time.
0 commit comments