From d82a4087b75dbbfded5e1af405ba7d278194566f Mon Sep 17 00:00:00 2001 From: "justin.hsu" Date: Sun, 10 Nov 2024 17:10:18 +0800 Subject: [PATCH] fix: ckip pre-commit issue --- src/utils/ckip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/ckip.py b/src/utils/ckip.py index f136d50..23d192e 100644 --- a/src/utils/ckip.py +++ b/src/utils/ckip.py @@ -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)