Merge pull request #270 from alibaba-damo-academy/dev_lzr

modify abbr postprocess
This commit is contained in:
Xian Shi 2023-03-21 14:13:12 +08:00 committed by GitHub
commit c096432ebc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -106,17 +106,18 @@ def abbr_dispose(words: List[Any], time_stamp: List[List] = None) -> List[Any]:
if num in abbr_begin:
if time_stamp is not None:
begin = time_stamp[ts_nums[num]][0]
word_lists.append(words[num].upper())
abbr_word = words[num].upper()
num += 1
while num < words_size:
if num in abbr_end:
word_lists.append(words[num].upper())
abbr_word += words[num].upper()
last_num = num
break
else:
if words[num].encode('utf-8').isalpha():
word_lists.append(words[num].upper())
abbr_word += words[num].upper()
num += 1
word_lists.append(abbr_word)
if time_stamp is not None:
end = time_stamp[ts_nums[num]][1]
ts_lists.append([begin, end])