input: Write a function to generate a Markov chain given a text input and generate 100 words of text based on the Markov chain. The function should split the text into words, create a Markov chain dictionary where each word maps to a dictionary of possible following words and their frequencies, and generate 100 words by randomly choosing the next word based on the Markov chain. If the text runs out of choices before 100 words, the function should stop generating and return the generated text so far.
  assert generateMarkov('Alice was beginning to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had peeped into the book her sister was reading, but it had no pictures or conversations in it, and what is the use of a book, thought Alice without pictures or conversation?')==<some output>
  assert generateMarkov('')==<some output>
  assert generateMarkov('The quick brown fox jumps over the lazy dog')==<some output>
output: def generateMarkov(text):
      import random
      words = text.split()
      markov_chain = {}
      for i in range(len(words) - 1):
          current_word = words[i]
          next_word = words[i + 1]
          if current_word not in markov_chain:
              markov_chain[current_word] = {}
          if next_word not in markov_chain[current_word]:
              markov_chain[current_word][next_word] = 0
          markov_chain[current_word][next_word] += 1
  
      if not words:
          return ''
  
      current_word = random.choice(words)
      generated_text = [current_word]
  
      for _ in range(99):
          if current_word not in markov_chain:
              break
          next_words = markov_chain[current_word]
          next_word = random.choices(list(next_words.keys()), weights=list(next_words.values()))[0]
          generated_text.append(next_word)
          current_word = next_word
  
      return ' '.join(generated_text)