@@ -46,11 +46,15 @@ def redux(self, files, **kwargs):
46
46
47
47
def file_filter (self , f , clas , consultant , repetition ):
48
48
d_specs = self .video_info (f )
49
- return ((int (self .word_class (d_specs )) == int (clas ) if clas else True ) and
50
- (int (self .consultant_of (d_specs )) == consultant if consultant else True ) and
51
- (int (self .rept (d_specs )) == repetition if repetition else True ))
49
+ try :
50
+ clas = clas .lower ()
51
+ consultant = consultant .lower ()
52
+ finally :
53
+ return ((self .word_class (d_specs ) == clas if clas else True ) and
54
+ (self .consultant_of (d_specs ) == consultant if consultant else True ) and
55
+ (self .rept (d_specs ) == repetition if repetition else True ))
52
56
l = list (filter (lambda f : file_filter (
53
- self , f , kwargs .get ('index ' ), kwargs .get ('consultant' ), kwargs .get ('repetition' )), l ))
57
+ self , f , kwargs .get ('word ' ), kwargs .get ('consultant' ), kwargs .get ('repetition' )), l ))
54
58
return l
55
59
56
60
def specs_from (self , filename ):
@@ -111,9 +115,9 @@ def get_my_file_ext(self):
111
115
def video_info (self ,filename ):
112
116
splited = filename .split ('_' )
113
117
info_dict = {}
114
- info_dict ['class' ]= splited [0 ]
115
- info_dict ['consultant' ]= splited [1 ]
116
- info_dict ['repetition' ] = splited [2 ].split ('.' )[0 ]
118
+ info_dict ['class' ]= int ( splited [0 ])
119
+ info_dict ['consultant' ]= int ( splited [1 ])
120
+ info_dict ['repetition' ] = int ( splited [2 ].split ('.' )[0 ])
117
121
return info_dict
118
122
119
123
@@ -133,9 +137,9 @@ def get_pos_url(self):
133
137
def video_info (self , filename ):
134
138
splited = filename .split ('_' )
135
139
info_dict = {}
136
- info_dict ['class' ]= splited [0 ]
137
- info_dict ['consultant' ]= splited [1 ]
138
- info_dict ['repetition' ] = splited [2 ]
140
+ info_dict ['class' ]= int ( splited [0 ])
141
+ info_dict ['consultant' ]= int ( splited [1 ])
142
+ info_dict ['repetition' ] = int ( splited [2 ])
139
143
info_dict ['hand' ] = splited [3 ].split ('.' )[0 ]
140
144
return info_dict
141
145
@@ -197,10 +201,10 @@ def video_info(self, filename):
197
201
return self .dframe .loc [:, 'Consultant' :'Passive Arm' ][(self .dframe .Filename == filename )].to_dict ('records' )[0 ]
198
202
199
203
def consultant_of (self , d ):
200
- return d ['Consultant' ]
204
+ return d ['Consultant' ]. lower ()
201
205
202
206
def word_class (self , d ):
203
- return d ['Main_Gloss' ]
207
+ return d ['Main_Gloss' ]. lower ()
204
208
205
209
def rept (self , d ):
206
210
return None
0 commit comments