-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
47 lines (39 loc) · 1.24 KB
/
test.py
File metadata and controls
47 lines (39 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
key_class = ("Hello", "xiaogua", "nihao", "xiaoyi", "jixu", "tingzhi", "bofang", "null")
# 关键字起止,向下取整,最小单位为fbank的40唯Tensor
first_key_start = 0
first_key_end = 0
second_key_start = 0
second_key_end = 0
first_key = ""
second_key = ""
def ini_key_se():
first_key_start = 0
first_key_end = 0
second_key_start = 0
second_key_end = 0
def set_key_se(first_key_start_, first_key_end_, second_key_start_, second_key_end_):
first_key_start = first_key_start_
first_key_end = first_key_end_
second_key_start = second_key_start_
second_key_end = second_key_end_
def return_first_halfkey(whole_key):
if whole_key.startswith(key_class[0]):
return key_class[0]
elif whole_key.startswith(key_class[2]):
return key_class[2]
elif whole_key.startswith(key_class[4]):
return key_class[4]
else:
return key_class[6]
def return_second_halfkey(whole_key):
if whole_key.startswith(key_class[0]):
return key_class[1]
elif whole_key.startswith(key_class[2]):
return key_class[3]
elif whole_key.startswith(key_class[4]):
return key_class[5]
else:
return key_class[7]
list = [1,5,6,6]
for i,data in enumerate(list):
print(i)