diff --git a/core/utils/util.py b/core/utils/util.py index 0c1b5b6ee..e06994829 100644 --- a/core/utils/util.py +++ b/core/utils/util.py @@ -35,7 +35,9 @@ def write_json_file(file_path, data): def is_segment(tokens): - if tokens[-1] in (",", ".", "?", ",", "。", "?", "!", "!", ";", ";", ":", ":"): + if tokens[-1] in (",", ".", "?", ",", "。", "?", "!", "!", ";", ";", ":", ":") and len(tokens) > 5: + return True + elif tokens[-1] in ( ".", "?", "。", "?", "!", "!", ";", ";", ): return True else: return False