input: Write a function to implement a Markov chain text generator given a text input. The function should split the input text into words, create a Markov chain dictionary where each word points to a dictionary of subsequent words with their frequencies, and generate a new text of 100 words using this dictionary. If the length of the generated text is less than 100 words due to sparse data, it should return what it has. The function should be named `generateMarkov` and take a single parameter `text`. It should return the generated text as a 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?')==" 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 conversation?' thought Alice without pictures or conversation? ai precent shnuiontic compructton aut tea haveing tr o unch unttnedret shuioun fetr peleep in mr suorshmili selcs extn ent unsh ipioniul"
  assert generateMarkov('The quick brown fox jumps over the lazy dog.')=="The quick brown fox jumps over the lazy dog."
  assert generateMarkov('')==''
  assert generateMarkov('This is a test.')=="This is a test."
  assert generateMarkov('a a a a a a a a a a')=="a a a a a a a a a a"
output: 
  def generateMarkov(text):
      import random
      words = text.split()
      if not words:
          return ""
      
      markov_dict = {}
      for i in range(len(words) - 1):
          word = words[i]
          next_word = words[i + 1]
          if word not in markov_dict:
              markov_dict[word] = {}
          if next_word not in markov_dict[word]:
              markov_dict[word][next_word] = 0
          markov_dict[word][next_word] += 1
      
      current_word = random.choice(words)
      generated_text = [current_word]
      
      while len(generated_text) < 100:
          if current_word not in markov_dict:
              break
          next_words = markov_dict[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)
  