日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > python >内容正文

python

python len ljust_Python string.ljust方法代码示例

發布時間:2025/3/15 python 12 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python len ljust_Python string.ljust方法代码示例 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

# 需要導入模塊: import string [as 別名]

# 或者: from string import ljust [as 別名]

def process_utterance(self, utt, make_label=True):

utt_data = []

utt_questions = defaultdict(int)

nodelist = utt.xpath(self.config["target_nodes"])

if nodelist == []:

print('WARNING: FeatureDumper\'s target_nodes matches no nodes: %s'%(self.config["target_nodes"]))

for node in nodelist:

self.htk_state_xpath = None ## make sure this is none.

self.start_time_xpath = None

self.end_time_xpath = None

## for phone!:--

node_data, node_questions = self.get_node_context_label(node)

statelist = node.xpath('.//'+self.state_tag)

assert statelist != []

for (i, state) in enumerate(statelist):

state_ix = i + 2

state_node_data = "%s[%s]"%(node_data, state_ix)

start_time = state.attrib.get(self.start_attribute, '_NA_') ## no time at runtime!

end_time = state.attrib.get(self.end_attribute, '_NA_')

if not (start_time=="_NA_" or end_time=="_NA_"):

start_time = string.ljust(str(ms_to_htk(start_time)), 10)

end_time = string.ljust(str(ms_to_htk(end_time)), 10)

state_node_data = "%s %s %s"%(start_time, end_time, state_node_data)

utt_data.append(state_node_data)

##utt_questions.update(node_questions)

## Sum the dictionaries' values:

for question in node_questions:

utt_questions[question]+=node_questions[question]

if make_label:

label_file = utt.get_filename(self.config["output_filetype"])

writelist(utt_data, label_file, uni=True)

return (utt_data, utt_questions) ## for writing utterance-level labels,

## these returned values will be ignored. But these can be used to

## acccumulate questions and features over the whole corpus for

## training (see train() method).

總結

以上是生活随笔為你收集整理的python len ljust_Python string.ljust方法代码示例的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。