def toString(wordsX, wordsY, sorted_edge_cost, lex=None):
    N = len(sorted_edge_cost)
    s = ''
    for n in xrange(N):
        weight = sorted_edge_cost[n]
        source_word = wordsX[n]
        target_word = wordsY[n]
        if lex is not None:
            matched = BU.is_valid_match(lex, source_word, target_word)
            matched = "correct" if matched else " wrong "
        else:
            matched = source_word == target_word
        #common.log(200, '{},{},{},{:>6},{:>12}'.format(source_word, target_word, matched, weight, n))
        #common.log(200, '{} - {:>12}) {:>12} {:>12} {:>6}'.format(matched, n, source_word, target_word, weight))
        # s += '{} - {:>4}),{:>10},{:>10},{:>4}'.format(matched, n, source_word, target_word, weight)
        s += '{} - {:>10},{:>10}'.format(matched, source_word, target_word)
        s += '\n'
    return s