def _dict_to_text(freq_dict):
    """
    _dict_to_text(freq_dict):

    Internal routine to print items and values
    in a sorted dictionary, to avoid duplicating
    this code in process_file and in process_dir.

    Inputs:
        freq_dict, dict
            Dictionary of words and frequencies.

    Outputs:
        str:
            Text block with numerated key-value pairs.
    """
    stats_text = ''
    for i, (key, value) in enumerate(freq_dict.items()):
        stats_text += f'{i + 1}. {key}, {value}\n'
    stats_text += '\n'
    return stats_text
