File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -201,19 +201,18 @@ def segment(text: str) -> List[str]:
201
201
202
202
# To ensure splitting of sentences using Terminal Punctuation
203
203
for idx , _ in enumerate (toks ):
204
- if toks [idx ].strip ().endswith (('!' , '.' , '?' )):
204
+ if toks [idx ].strip ().endswith (("!" , "." , "?" )):
205
205
labs [idx ] = "E"
206
-
207
206
# Spaces or empty strings would no longer be treated as end of sentence.
208
- elif ( toks [idx ].strip () == "" ) :
207
+ elif toks [idx ].strip () == "" :
209
208
labs [idx ] = "I"
210
209
211
210
sentences = []
212
211
sentence = ""
213
212
for i , w in enumerate (toks ):
214
213
sentence = sentence + w
215
214
# Empty strings should not be part of output.
216
- if labs [i ] == "E" and sentence != '' :
215
+ if labs [i ] == "E" and sentence != "" :
217
216
sentences .append (sentence )
218
217
sentence = ""
219
218
You can’t perform that action at this time.
0 commit comments