input: Write a function to generate a Markov chain given a text input. The function should return a generated text of 100 words based on the Markov chain created from the input text. If the text has less than 100 words, the function should generate as many words as possible.
  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?')==generatedText
  assert generateMarkov('To be or not to be, that is the question.')==generatedText2
  assert generateMarkov('')==""
  assert generateMarkov('The quick brown fox jumps over the lazy dog.')==generatedText3
  assert generateMarkov('Hello world!')==generatedText4
output: import random
  
  def generateMarkov(text):
      words = text.split()
      if not words:
          return ""
      
      markov_dict = {}
      for i in range(len(words) - 1):
          current_word = words[i]
          next_word = words[i + 1]
          if current_word not in markov_dict:
              markov_dict[current_word] = []
          markov_dict[current_word].append(next_word)
      
      generated_text = []
      current_word = random.choice(words)
      while len(generated_text) < 100 and current_word in markov_dict:
          generated_text.append(current_word)
          current_word = random.choice(markov_dict[current_word])
      
      return ' '.join(generated_text)