generate_main_table.py
def format_vals(stats):
    "Function to format the numbers in the stats."
    stats['average_sentence_length'] = "{:.1f}".format(stats['average_sentence_length'])
    stats['std_sentence_length'] = "{:.2f}".format(stats['std_sentence_length'])
    stats['type_token_ratio'] = "{:.2f}".format(stats['type_token_ratio'])
    stats['bittr'] = "{:.2f}".format(stats['bittr'])
    stats['trittr'] = "{:.2f}".format(stats['trittr'])
    stats['ttr10k'] = "{:.2f}".format(stats['ttr10k'])
    stats['ttr100k'] = "{:.2f}".format(stats['ttr100k'])
    if 'percentage_novel' in stats:
        stats['percentage_novel'] = "{:.1f}".format(stats['percentage_novel'])
Function to format the numbers in the stats.
Function to format the numbers in the stats.
Function to format the numbers in the stats .
def format_vals(stats):
    stats['average_sentence_length'] = "{:.1f}".format(stats['average_sentence_length'])
    stats['std_sentence_length'] = "{:.2f}".format(stats['std_sentence_length'])
    stats['type_token_ratio'] = "{:.2f}".format(stats['type_token_ratio'])
    stats['bittr'] = "{:.2f}".format(stats['bittr'])
    stats['trittr'] = "{:.2f}".format(stats['trittr'])
    stats['ttr10k'] = "{:.2f}".format(stats['ttr10k'])
    stats['ttr100k'] = "{:.2f}".format(stats['ttr100k'])
    if 'percentage_novel' in stats:
        stats['percentage_novel'] = "{:.1f}".format(stats['percentage_novel'])
def format_vals ( stats ) : stats [ 'average_sentence_length' ] = "{:.1f}" . format ( stats [ 'average_sentence_length' ] ) stats [ 'std_sentence_length' ] = "{:.2f}" . format ( stats [ 'std_sentence_length' ] ) stats [ 'type_token_ratio' ] = "{:.2f}" . format ( stats [ 'type_token_ratio' ] ) stats [ 'bittr' ] = "{:.2f}" . format ( stats [ 'bittr' ] ) stats [ 'trittr' ] = "{:.2f}" . format ( stats [ 'trittr' ] ) stats [ 'ttr10k' ] = "{:.2f}" . format ( stats [ 'ttr10k' ] ) stats [ 'ttr100k' ] = "{:.2f}" . format ( stats [ 'ttr100k' ] ) if 'percentage_novel' in stats : stats [ 'percentage_novel' ] = "{:.1f}" . format ( stats [ 'percentage_novel' ] )
Function to format the numbers in the stats.
Function to format the numbers in the stats .
"Function to format the numbers in the stats."
stats