File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -63,13 +63,18 @@ def get_proportional_result(value: float,
6363
6464def get_fillers (fillers : list , audio : Audio ) -> list :
6565 found_fillers = []
66+ # пунктуация + пробелы для str.translate
67+ removable = string .punctuation + string .whitespace
68+ translation_table = str .maketrans ('' , '' , removable )
69+
6670 for audio_slide in audio .audio_slides :
6771 found_slide_fillers = []
6872 # добавлена предобработка слов - перевод в нижний регистр, очистка от пунктуации
6973 audio_slide_words = [
70- recognized_word .word .value .strip (). lower ().translate (str . maketrans ( '' , '' , string . punctuation ) )
74+ recognized_word .word .value .lower ().translate (translation_table )
7175 for recognized_word in audio_slide .recognized_words
7276 ]
77+
7378 for i in range (len (audio_slide_words )):
7479 for filler in fillers :
7580 filler_split = filler .split ()
You can’t perform that action at this time.
0 commit comments