blocks = re_han.split(sentence)
start_idx = 0
for blk in blocks:
if not blk:
continue
if re_han.match(blk):
maybe_errors += self._detect_short(blk, start_idx)
start_idx += len(blk)
else:
After Change
// 文本归一化
text = uniform(text)
// 长句切分为短句
blocks = self.split_2_short_text(text)
for blk, idx in blocks:
maybe_errors += self.detect_short(blk, idx)
return maybe_errors