I have a dictionary like this (sample data thus it doesn't make sense):
Dictionary<char, string[]> codes = new Dictionary<char, string[]>();
string[]
is an array of possible replacements for the Dictionary's key.
Filling up the dictionary with some sample data...
codes.Add("A", new string[] {"噅噅", "裧", "頖", "11"});
codes.Add("B", new string[] {"垥", "2", "鉠"});
codes.Add("C", new string[] {"33", "韎"});
codes.Add("D", new string[] {"櫋", "緟", "嘕", "鈖", "灡", "犅"});
...
codes.Add("T", new string[] {"濇", "汫", "岕", "5"});
...
Now lets "encode" the following word:
char[] charArray = "act".ToCharArray();
foreach (char c in charArray) {
string[] replacements = codes[c].Where(x => !String.IsNullOrEmpty(x)).ToArray();//removing empty elements
...
}
I cannot wrap my head now on what to do next, I want to have a list of all possible combinations, it should return a list like this (for the word "act"):
噅噅韎5
裧33濇
裧33汫
裧33岕
裧335
裧韎濇
裧韎汫
裧韎岕
...
Can't show all combinations because of stackoverflow's spam filter...