docs: def convert_timestamps(files):
      '''Converts pocketsphinx transcriptions to usable timestamps'''
  
      sentences = []
  
      for f in files:
  
          if not f.endswith('.transcription.txt'):
              f = f + '.transcription.txt'
  
          if os.path.exists(f) is False:
              continue
  
          with open(f, 'r') as infile:
              lines = infile.readlines()
  
          lines = [re.sub(r'\(.*?\)', '', l).strip().split(' ') for l in lines]
          lines = [l for l in lines if len(l) == 4]
  
          seg_start = -1
          seg_end = -1
  
          for index, line in enumerate(lines):
              word, start, end, conf = line
              if word == '<s>' or word == '<sil>' or word == '</s>':
                  if seg_start == -1:
                      seg_start = index
                      seg_end = -1
                  else:
                      seg_end = index
  
                  if seg_start > -1 and seg_end > -1:
                      words = lines[seg_start+1:seg_end]
                      start = float(lines[seg_start][1])
                      end = float(lines[seg_end][1])
                      if words:
                          sentences.append({'start': start, 'end': end, 'words': words, 'file': f})
                      if word == '</s>':
                          seg_start = -1
                      else:
                          seg_start = seg_end
                      seg_end = -1
  
      return sentences