def substring_dict(string):
    sub_dict = {}
    for i in range(0, len(string)):
        sub_dict[i] = {i: string[i:] for _, char in enumerate(string)}
    return sub_dict
Return all substrings of a given string as a dict.
dataset/ETHPy150Open christabor/MoAL/MOAL/helpers/generic.py/substring_dict