<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def process_directory_statements_sorted_by_pmid(directory_name):
 """Processes a directory filled with CSXML files, first normalizing the character encoding to utf-8, and then processing into INDRA statements sorted by pmid. Parameters directory_name : str The name of a directory filled with csxml files to process Returns ------- pmid_dict : dict A dictionary mapping pmids to a list of statements corresponding to that pmid """

    s_dict = defaultdict(list)
    mp = process_directory(directory_name, lazy=True)

    for statement in mp.iter_statements():
        s_dict[statement.evidence[0].pmid].append(statement)
    return s_dict