(self)
return True
Sanity check. Make sure everything is (probably) OK.
Sanity check. Make sure everything is (probably) OK.
Sanity check . Make sure everything is ( probably ) OK .
def validate(self):
    ''' Sanity check. Make sure everything is (probably) OK. '''
    # TODO: more efficient and robust. Also check speakers.
    for utt_key in self.utts.keys():
      first_utt_key = utt_key
      break
    num_props = len(self.utts[first_utt_key])
    for utt_key, utt in self.utts.items():
      if len(utt) != num_props:
        logging.warning('Utt %s has unequal number of props with %s.' % \
                     (utt_key, first_utt_key))
        return False
      if 'spkid' not in utt:
        utt['spkid'] = self.spks[utt.spk].id
    logging.warning(
        'All utts have same number of props, data dir appears to be OK.')
    return True
def validate ( self ) : # TODO: more efficient and robust. Also check speakers. for utt_key in self . utts . keys ( ) : first_utt_key = utt_key break num_props = len ( self . utts [ first_utt_key ] ) for utt_key , utt in self . utts . items ( ) : if len ( utt ) != num_props : logging . warning ( 'Utt %s has unequal number of props with %s.' % ( utt_key , first_utt_key ) ) return False if 'spkid' not in utt : utt [ 'spkid' ] = self . spks [ utt . spk ] . id logging . warning ( 'All utts have same number of props, data dir appears to be OK.' ) return True