title: English Dictionary word matching from a string
body: <p>I'm trying to get my head around a problem of identifying the best match of English words from a dictionary file to a given string.</p>
  
  <p>For example ("lines" being a List of dictionary words):</p>
  
  <pre><code>string testStr = "cakeday";
  
  for (int x= 0; x&lt;= testStr.Length; x++)
  {
    string test = testStr.Substring(x);
  
     if (test.Length &gt; 0)
     {
        string test2 = testStr.Remove(counter);
        int count = (from w in lines where w.Equals(test) || w.Equals(test2) select w).Count();
        Console.WriteLine("Test: {0} / {1} : {2}", test, test2, count);
      }
  }
  </code></pre>
  
  <p>Gives the output:</p>
  
  <pre><code>Test: cakeday /   : 0
  Test: akeday / c  : 1
  Test: keday / ca  : 0
  Test: eday / cak  : 0
  Test: day / cake  : 2
  Test: ay / caked  : 1
  Test: y / cakeda  : 1
  </code></pre>
  
  <p>Obviously "day / cake" is the best fit for the string however if I were to introduce a 3rd word into the string e.g "cakedaynow" it doesnt work so well.</p>
  
  <p>I know the example is primitive, its more a proof of concept and was wondering if anyone had any experience with this type of string analysis?</p>
  
  <p>Thanks!</p>