I have a program (C#) that generates a list of strings (permutations of an original string). Most of the strings are random grouping of the original letters as expected (ie
You could download a list of words from the web (say one of the files mentioned here: http://www.outpost9.com/files/WordLists.html), then then do a quick:
// Read words from file.
string [] words = ReadFromFile();
Dictionary> permuteDict = new Dictionary>(StringComparer.OrdinalIgnoreCase);
foreach (String word in words) {
String sortedWord = new String(word.ToArray().Sort());
if (!permuteDict.ContainsKey(sortedWord)) {
permuteDict[sortedWord] = new List();
}
permuteDict[sortedWord].Add(word);
}
// To do a lookup you can just use
String sortedWordToLook = new String(wordToLook.ToArray().Sort());
List outWords;
if (permuteDict.TryGetValue(sortedWordToLook, out outWords)) {
foreach (String outWord in outWords) {
Console.WriteLine(outWord);
}
}