kensho-technologies / pyctcdecode

A fast and lightweight python-based CTC beam search decoder for speech recognition.
Apache License 2.0
421 stars 89 forks source link

remove redundant token check #113

Open milspect18 opened 1 year ago

milspect18 commented 1 year ago

As new_part_frames will be assigned with beam.partial_frames when char == "" and new_end_frame wont be used in that case, doing the additional if char == "" is redundant and can be removed. With the removal of the if check, it seemed practical to remove the else block as well and just put the frame_idx + 1 in the assignment else block. This eliminates the need for the new_end_frame local variable and simplifies this block.