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>

<pre><code><dimen name="design_navigation_icon_size" tools:override="true">40dp</dimen>
</code></pre>

['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这样的格式而已