input: Write a function to generate a Markov chain given a text input. The function should take in a string of text, tokenize it into words, and then build a Markov chain model based on the frequency of word sequences. The function should then generate a new text sequence of 100 words based on the Markov chain model. If the model does not have enough data to generate 100 words, it should stop as soon as it runs out of data.
  
  def generateMarkov(text):
    words = text.split(' ')
    markovChain = {}
  
    for i in range(len(words) - 2):
      current = words[i]
      next = words[i + 1]
      if current in markovChain:
        if next in markovChain[current]:
          markovChain[current][next] += 1
        else:
          markovChain[current][next] = 1
      else:
        markovChain[current] = {next: 1}
  
    generatedText = ""
    current = random.choice(list(markovChain))
    generatedText += current
  
    for i in range(100):
      choices = markovChain[current]
      choices = [
        key for key, value in choices.items()
        for i in range(value)
      ]
      try:
        current = random.choice(choices)
        generatedText += " " + current
      except:
        break
  
    return generatedText
  
  assert generateMarkov('The quick brown fox jumps over the lazy dog.')=="The quick brown fox jumps over the lazy dog. the quick brown fox jumps over the lazy dog. the quick brown fox jumps over the lazy dog. the quick brown fox jumps over the lazy dog. the quick brown fox jumps over the lazy dog. the quick brown fox jumps over the lazy dog."
  assert generateMarkov('')==""
  assert generateMarkov('A B C D.')=="A B C D. A B C D. A B C D. A B C D. A B C D. A B C D. A B C D. A B C D. A B C D. A B C D."
output: 
  def generateMarkov(text):
    words = text.split(' ')
    markovChain = {}
  
    for i in range(len(words) - 2):
      current = words[i]
      next = words[i + 1]
      if current in markovChain:
        if next in markovChain[current]:
          markovChain[current][next] += 1
        else:
          markovChain[current][next] = 1
      else:
        markovChain[current] = {next: 1}
  
    generatedText = ""
    current = random.choice(list(markovChain))
    generatedText += current
  
    for i in range(100):
      choices = markovChain[current]
      choices = [
        key for key, value in choices.items()
        for i in range(value)
      ]
      try:
        current = random.choice(choices)
        generatedText += " " + current
      except:
        break
  
    return generatedText
  