File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ def __init__(self, weights=None):
164164
165165 def find_strict_speech_duration_criterion (self , criteria_keys , suffix = 'StrictSpeechDurationCriterion' ):
166166 for criteria in criteria_keys :
167- if suffix in criteria :
167+ if criteria . endswith ( suffix ) :
168168 return criteria
169169
170170 def evaluate_feedback (self , criteria_results ):
@@ -178,10 +178,15 @@ def evaluate_feedback(self, criteria_results):
178178 return super ().evaluate_feedback (criteria_results )
179179
180180 def get_result_as_sum_str (self , criteria_results ):
181+ self .ssd_criterion = self .find_strict_speech_duration_criterion (criteria_results .keys ())
182+
181183 if criteria_results is None or self .weights is None or \
182184 criteria_results .get (self .ssd_criterion , {}).get ('result' , 0 ) == 0 or \
183185 criteria_results .get ("DEFAULT_SPEECH_PACE_CRITERION" , {}).get ('result' , 0 ) == 0 :
184186 return None
187+
188+ criteria_results ["StrictSpeechDurationCriterion" ] = criteria_results .pop (self .ssd_criterion )
189+
185190 return super ().get_result_as_sum_str (criteria_results )
186191
187192
You can’t perform that action at this time.
0 commit comments