Skip to content

Commit 41558bb

Browse files
authored
Code formatting crfcut.py
1 parent dd4ebfe commit 41558bb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pythainlp/tokenize/crfcut.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)