Update egs/commonvoice/ASR/local/word_segment_yue.py

Co-authored-by: Fangjun Kuang <csukuangfj@gmail.com>
This commit is contained in:
zr_jin 2024-04-08 17:06:23 +08:00 committed by GitHub
parent 8347436e82
commit b9d34fb9d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,7 +91,7 @@ def get_word_segments(lines: List[str]) -> List[str]:
# segments.extend(pycantonese.segment(segment)) # segments.extend(pycantonese.segment(segment))
except Exception as e: except Exception as e:
logging.error(f"Failed to process segment: {segment}") logging.error(f"Failed to process segment: {segment}")
raise e raise
if curr_str: # process the last segment if curr_str: # process the last segment
segments.extend(pycantonese.segment(curr_str)) segments.extend(pycantonese.segment(curr_str))
new_lines.append(" ".join(segments) + "\n") new_lines.append(" ".join(segments) + "\n")