code: def iter_cognates(dataset, column='Segments', method='turchin', threshold=0.5, **kw):
      
      if method == 'turchin':
          for row in dataset.objects['FormTable']:
              sounds = ''.join(lingpy.tokens2class(row[column], 'dolgo'))
              if sounds.startswith('V'):
                  sounds = 'H' + sounds
              sounds = '-'.join([s for s in sounds if s != 'V'][:2])
              cogid = slug(row['Parameter_ID']) + '-' + sounds
              if '0' not in sounds:
                  yield dict(
                      Form_ID=row['ID'],
                      Form=row['Value'],
                      Cognateset_ID=cogid,
                      Cognate_Detection_Method='CMM')
  
      if method in ['sca', 'lexstat']:
          lex = _cldf2lexstat(dataset)
          if method == 'lexstat':
              lex.get_scorer(**kw)
          lex.cluster(method=method, threshold=threshold, ref='cogid')
          for k in lex:
              yield Cognate(
                  Form_ID=lex[k, 'lid'],
                  Form=lex[k, 'value'],
                  Cognateset_ID=lex[k, 'cogid'],
                  Cognate_Detection_Method=method + '-t{0:.2f}'.format(threshold))
docs: Compute cognates automatically for a given dataset.