今日分的数据处理函数(.item)

248
-----------------------------------------------------
['you', 'can', 'change', 'the', 'size', 'of', 'navigationview', 'icon', 'by', 'overriding', 'design_navigation_icon_size', 'attribute', 'you', 'can', 'put', 'it', 'in', 'dimens', 'and', 'because', 'you', "'re", 'overriding', 'a', 'private', 'attribute', 'you', 'need', 'to', 'include', 'tools', 'override', '=', 'true', 'xa', 'xa', '<', 'dimen', 'name', '=', 'design_navigation_icon_size', 'tools', 'override', '=', 'true', '>', '40dp', '<', 'dimen', '>', 'xa', 'xa', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0']
[205829, 63980, 66023, 187114, 175395, 143519, 138330, 109677, 62889, 147099, 80662, 55659, 205829, 63980, 156603, 116241, 111634, 82159, 51604, 58908, 205829, 7427, 147099, 46036, 154489, 55659, 205829, 138572, 189053, 111777, 189728, 147071, 26312, 191323, 204223, 204223, 26311, 82158, 137779, 26312, 80662, 189728, 147071, 26312, 191323, 26313, 20434, 26311, 82158, 26313, 204223, 204223, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435, 10435]
<p>You can change the size of navigationView icon by overriding <code>design_navigation_icon_size</code> attribute. You can put it in dimens and because you're overriding a private attribute, you need to include <code>tools:override="true"</code></p>&#xA;&#xA;<pre><code>&lt;dimen name="design_navigation_icon_size" tools:override="true"&gt;40dp&lt;/dimen&gt;&#xA;</code></pre>&#xA;
['you', 'can', 'change', 'the', 'size', 'of', 'navigationview', 'icon', 'by', 'overriding', 'design_navigation_icon_size', 'attribute', 'you', 'can', 'put', 'it', 'in', 'dimens', 'and', 'because', 'you', "'re", 'overriding', 'a', 'private', 'attribute', 'you', 'need', 'to', 'include', 'tools', 'override', '=', 'true', 'xa', 'xa', '<', 'dimen', 'name', '=', 'design_navigation_icon_size', 'tools', 'override', '=', 'true', '>', '40dp', '<', 'dimen', '>', 'xa', 'xa']

Process finished with exit code 0

对文本信息进行处理,对一个句子基本的正则,再进行padding。

 

 

函数2

a = {'a':1,'b':2}
a.items()
print(a)
print(a.items())

for k,v in a.items():
    print (k,v)

输出:

{'a': 1, 'b': 3}
dict_items([('a', 1), ('b', 3)])
a 1
b 3

 

 

函数3

import json def get_inv_vocabulary(vocabulary):

    # for k, v in vocabulary.items():
    #     print(k,v)
    inv_vocabulary = {v:k for k, v in vocabulary.items()}
    return inv_vocabulary if __name__=="__main__": with open('../voc.txt', 'r') as fv: vocabulary = json.load(fv) inv_vocabulary= get_inv_vocabulary(vocabulary) print(inv_vocabulary)

这个函数

v:k for k, v in vocabulary.items()}遍历完转换成v:k这样的格式而已
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值