asrtoolkit/data_handlers/stm.py
def parse_line(line):
  " parse a single line of an stm file"

  data = line.strip().split()

  seg = None
  if len(data) > 6:
    audiofile, channel, speaker, start, stop, label = data[:6]
    text = " ".join(data[6:])
    seg = segment(
      {
        'audiofile': audiofile,
        'channel': channel,
        'speaker': speaker,
        'start': start,
        'stop': stop,
        'label': label,
        'text': text
      }
    )
  return seg if seg and seg.validate() else None
 parse a single line of an stm file
parse a single line of an stm file
parse a single line of an stm file
def parse_line(line):
  data = line.strip().split()
  seg = None
  if len(data) > 6:
    audiofile, channel, speaker, start, stop, label = data[:6]
    text = " ".join(data[6:])
    seg = segment(
      {
        'audiofile': audiofile,
        'channel': channel,
        'speaker': speaker,
        'start': start,
        'stop': stop,
        'label': label,
        'text': text
      }
    )
  return seg if seg and seg.validate() else None
def parse_line ( line ) : data = line . strip ( ) . split ( ) seg = None if len ( data ) > 6 : audiofile , channel , speaker , start , stop , label = data [ : 6 ] text = " " . join ( data [ 6 : ] ) seg = segment ( { 'audiofile' : audiofile , 'channel' : channel , 'speaker' : speaker , 'start' : start , 'stop' : stop , 'label' : label , 'text' : text } ) return seg if seg and seg . validate ( ) else None
parse a single line of an stm file
parse a single line of an stm file
" parse a single line of an stm file"
line