input: Write a function to generate a Markov chain from a given text input. The function should split the text into words and then build a Markov chain where each word leads to the next word based on frequency of occurrence in the text. The function should then generate a new text of 100 words based on the Markov chain. If there are less than 100 words generated, it should return as many as possible. If the given input text is empty, it should return an empty string.
  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 as per Markov chain
  assert generateMarkov("Hello world")==generatedText as per Markov chain
  assert generateMarkov("")==""
output: 
  import random
  
  def generateMarkov(text):
      if not text:
          return ""
      
      words = text.split()
      chain = {}
      
      for i in range(len(words) - 1):
          current_word = words[i]
          next_word = words[i + 1]
          
          if current_word in chain:
              chain[current_word].append(next_word)
          else:
              chain[current_word] = [next_word]
      
      current_word = random.choice(words)
      generated_text = [current_word]
      
      for _ in range(99):
          if current_word not in chain:
              break
          next_word = random.choice(chain[current_word])
          generated_text.append(next_word)
          current_word = next_word
      
      return ' '.join(generated_text)
  