def __call__(self, index_list, padded_value=-1):
"""
Args:
index_list (list): phone indices
padded_value (int): the value used for padding
Returns:
str_phone (string): a sequence of phones
"""
# Remove padded values
assert type(index_list) == np.ndarray, 'index_list should be np.ndarray.'
index_list = np.delete(index_list, np.where(index_list == -1), axis=0)
# Convert from indices to the corresponding phones
phone_list = list(map(lambda x: self.map_dict[x], index_list))
str_phone = ' '.join(phone_list)
return str_phone
phone.py 文件源码
python
阅读 28
收藏 0
点赞 0
评论 0
评论列表
文章目录