Skip to content

Commit

Permalink
fix: ckip pre-commit issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinHsu1019 committed Nov 10, 2024
1 parent 809bfd4 commit d82a408
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/ckip.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ def clean(sentence_ws, sentence_pos):
short_sentence = []
stop_pos = set(['Nep', 'Nh', 'Nb'])
for word_ws, word_pos in zip(sentence_ws, sentence_pos):
is_N_or_V = word_pos.startswith('V') or word_pos.startswith('N')
is_n_or_v = word_pos.startswith('V') or word_pos.startswith('N')
is_not_stop_pos = word_pos not in stop_pos
is_not_one_charactor = not (len(word_ws) == 1)
if is_N_or_V and is_not_stop_pos and is_not_one_charactor:
if is_n_or_v and is_not_stop_pos and is_not_one_charactor:
short_sentence.append(f'{word_ws}')
return ' '.join(short_sentence)

0 comments on commit d82a408

Please sign in to comment.