import re


def row_to_dictionary(row):
    """extract from row the information of library

    Args:
        row (str): row from the outputted by dpkg -l 

    Returns:
        dictionary: dictionary of library information : name , version , architecture
    """
    field_pattern = r'\s+\S+\s+\S+\s+\S+'
    str_without_i = re.findall(field_pattern, row)[0]
    field_list = re.split(r'\s+', str_without_i)
    lib_dict = {
        "name": field_list[1], "version": field_list[2], "architecture": field_list[3]}
    return lib_dict