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方法代码示例相关推荐
- python中string.digits_Python string.hexdigits方法代码示例
本文整理汇总了Python中string.hexdigits方法的典型用法代码示例.如果您正苦于以下问题:Python string.hexdigits方法的具体用法?Python string.he ...
- python中uppercase是什么意思_Python string.uppercase方法代码示例
本文整理汇总了Python中string.uppercase方法的典型用法代码示例.如果您正苦于以下问题:Python string.uppercase方法的具体用法?Python string.up ...
- python中uppercase是什么意思_Python string.ascii_uppercase方法代码示例
本文整理汇总了Python中string.ascii_uppercase方法的典型用法代码示例.如果您正苦于以下问题:Python string.ascii_uppercase方法的具体用法?Pyth ...
- python中summary_Python summary_pb2.Summary方法代码示例
本文整理汇总了Python中tensorflow.core.framework.summary_pb2.Summary方法的典型用法代码示例.如果您正苦于以下问题:Python summary_pb2 ...
- python里defoults_Python Part.Compound方法代码示例
本文整理汇总了Python中Part.Compound方法的典型用法代码示例.如果您正苦于以下问题:Python Part.Compound方法的具体用法?Python Part.Compound怎么 ...
- python中weekday_Python calendar.weekday方法代码示例
本文整理汇总了Python中calendar.weekday方法的典型用法代码示例.如果您正苦于以下问题:Python calendar.weekday方法的具体用法?Python calendar. ...
- python clr createinstance_Python System.Byte方法代码示例
本文整理汇总了Python中System.Byte方法的典型用法代码示例.如果您正苦于以下问题:Python System.Byte方法的具体用法?Python System.Byte怎么用?Pyth ...
- g的python实现_Python flask.g方法代码示例
本文整理汇总了Python中flask.g方法的典型用法代码示例.如果您正苦于以下问题:Python flask.g方法的具体用法?Python flask.g怎么用?Python flask.g使用 ...
- python使用loaddata_Python data.load方法代码示例
本文整理汇总了Python中data.load方法的典型用法代码示例.如果您正苦于以下问题:Python data.load方法的具体用法?Python data.load怎么用?Python dat ...
最新文章
- MinGW安装与使用简介
- linux命令学习之 cp(命令学习之四)
- 【Java 注解】自定义注解 ( 元注解 )
- 第8章例题 6-4 输入年份和天数,输出对应的年、月、日
- 基于Xml 的IOC 容器-载入<bean>元素
- Android消息传递之EventBus 3.0使用详解
- Android 编码规范:(七)避免使用终结方法
- icmp基于tcp还是udp_imi -- 基于PHP协程应用开发框架,支持WebSocket,TCP,UDP应用开发...
- RUBY常用类库文档翻译以及使用示例
- MyBatis的基本增删改查及条件操作及main方法调用
- window10运行不了1stopt_函数模型分析画图软件-1stopt非线性拟合工具Win10专业版1.7免费版 - 维维软件园...
- 微信小程序SEO排名优化
- 最大流算法之Dinic
- 口袋小精灵JAVA版下载_口袋小精灵200合一
- java太阳系论文摘要_毕业论文摘要
- 纯CSS实现手风琴效果(附演示)
- 2021MySQL面试题
- 全方位掌握 NSIS 的操作
- 电脑计算机不显示桌面了怎么办,电脑不显示桌面黑屏了 电脑黑屏不显示桌面怎么办 - 云骑士一键重装系统...
- leetcode 二分法 最大值最小化/最小值最大化
热门文章
- 图书《图像并行处理技术》简介
- 如何把 DropDownList 某一个 Item 的 Text 改成粗体 ?
- 现代谱估计:Blackman-Tukey 相关图
- Hough Transform 的算法思想
- tensorflow调用问题解决
- php localtion,详解Nginx Location配置
- [云炬创业基础笔记]第九章企业的法律形态测试8
- VTK修炼之道64:纹理映射体绘制_三维纹理映射
- [骨科手术导航]2D/3D医学图像配准研究_罗博博_南方科技大学
- 一个比较完整的Inno Setup 安装脚本