Fix markov chain generation to base the next ngram on the previous one - not the first one

This commit is contained in:
Starbeamrainbowlabs 2017-04-26 21:51:35 +01:00
parent a6564e4ce7
commit 03fad1ab78

View file

@ -64,6 +64,7 @@ namespace MarkovGrams
string nextNgram = nextNgrams.ElementAt(rand.Next(0, nextNgrams.Count));
// Add the last character from the n-gram to the string we're building
result += nextNgram[nextNgram.Length - 1];
lastNgram = nextNgram;
}
return result;