You can create a graph, then the vertices are your alphabet. For each word in your dictionary you'll add the first character in your graph something like:
G[word[0]].add({word, 0})
Then when you're visiting your text for each letter you visit the adyacency list for that letter. For each item in your list, you should add the next character for that word.
With your example:
S = "abccdde", D = {"ab","add","aced"}
First step:
G = {{'a', [{"ab", 0}, {"add", 0}, {"aced", 0}]}}
For each character in S
You visit the list for that character
[{"ab", 0}, {"add", 0}, {"aced", 0}]
and update your graph
G = {{'b', [{"ab", 1}]}, {'d', ["add", 1]}, {'c', [{"aced", 1}]}}
You visit the list for that character
[{"ab", 1}]
and update your graph
G = {{'d', ["add", 1]}, {'c', [{"aced", 1}]}}
as you finished "ab" you can try to improve your answer.
You visit the list for that character
[{"aced", 1}]
and update your graph
G = {{'d', ["add", 1]}, {'e', [{"aced", 2}]}}
There is not list for that character then you continue with the next character
You visit the list for that character
["add", 1]
and update your graph
G = {{'d', ["add", 2]}, {'e', [{"aced", 2}]}}
...