Browse Source

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

master
Starbeamrainbowlabs 3 years ago
parent
commit
03fad1ab78
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      MarkovGrams/UnweightedMarkovChain.cs

+ 1
- 0
MarkovGrams/UnweightedMarkovChain.cs 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;


Loading…
Cancel
Save