title: Java: How to think about Modelling a Markov Chain?
body: <p>I have a program that I am trying to make a Markov text generator for. I plan on splitting some text up at a set interval and then storing that into a class. The problem that I don't know how to solve is how to handle naming the instances of the class I am going to make. I was planning on generating the instances in a for loop. The user will pass the method some amount of text (the length of which is not known beforehand). Pseudo-code below:</p>
  
  <pre><code>    create vector for sets and tail letter;
  for (int c = 0; c &lt; text.length; c++) {
      Check to make sure overflow doesnt happen;
      Create instance of set named c;
      store set and tailLetter into vector;
  }
  
  public class set {
      String characters;
      char tailLetter;
  }
  </code></pre>
  
  <p>I'm sorry if that's not clear enough. I'm teaching myself Java and this is my first post here. </p>