[prev] [index] [next]

Markov Chain Algorithm (cont)

Text generation phase:   (use model of text)
  • start with some prefix (e.g. first two words of sample text)
  • randomly choose one of the suffixes for the current prefix
    e.g. if we start with "this is", we have three choices: "mine" or "yours" or "ours"
  • print the selected suffix word
  • advance prefix to become second prefix word and suffix word
    e.g. if we chose "yours", then the new prefix becomes "is yours"
  • repeat the above three steps until no suffix or enough words