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]:
201201
202202 # To ensure splitting of sentences using Terminal Punctuation
203203 for idx , _ in enumerate (toks ):
204- if toks [idx ].strip ().endswith (('!' , '.' , '?' )):
204+ if toks [idx ].strip ().endswith (("!" , "." , "?" )):
205205 labs [idx ] = "E"
206-
207206 # Spaces or empty strings would no longer be treated as end of sentence.
208- elif ( toks [idx ].strip () == "" ) :
207+ elif toks [idx ].strip () == "" :
209208 labs [idx ] = "I"
210209
211210 sentences = []
212211 sentence = ""
213212 for i , w in enumerate (toks ):
214213 sentence = sentence + w
215214 # Empty strings should not be part of output.
216- if labs [i ] == "E" and sentence != '' :
215+ if labs [i ] == "E" and sentence != "" :
217216 sentences .append (sentence )
218217 sentence = ""
219218
You can’t perform that action at this time.
0 commit comments