-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_label.py
More file actions
26 lines (20 loc) · 815 Bytes
/
create_label.py
File metadata and controls
26 lines (20 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# create label in script
import script_preprocess
import script_manipulate
import fileOI
from tqdm import tqdm
def extract_singular_labels(filelist, divider=' ', encoding='cp949'):
phn_list = []
for file in tqdm(filelist):
temp = fileOI.filename_script_pair_tolist(file, encoding)
if script_manipulate.is_remove_line(temp[1]):
break
original = temp[1]
temp[1] = script_preprocess.remove_options(temp[1])
for word in temp[1]:
if word not in phn_list:
phn_list.append(word)
if word in ['Q', 'A', 'Z', 'W', 'S', 'X', 'E', 'D', 'C', 'R', 'F', 'V', 'T', 'G', 'B', 'Y', 'H', 'N', 'U',
'J', 'M', 'I', 'K', 'O', 'L', 'P']:
print(temp[0], temp[1], original)
return phn_list