input: Write a function to generate a Markov chain given a text input. The function should split the text into words, create a dictionary where each word is a key and its value is another dictionary containing subsequent words as keys and their occurrence count as values. Then, the function should generate a random text of 100 words based on the Markov chain. If the chain runs out of words before reaching 100, the function should stop. The function should return the generated text. If the input text is empty, the function 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?')[:5]=='Alice'
  assert generateMarkov('')==''
output: def generateMarkov(text):
      if not text:
          return ''
      
      words = text.split()
      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] = {}
          
          if next_word not in markov_dict[current_word]:
              markov_dict[current_word][next_word] = 0
          
          markov_dict[current_word][next_word] += 1
      
      import random
      generated_text = []
      current_word = random.choice(list(markov_dict.keys()))
      
      for _ in range(100):
          generated_text.append(current_word)
          if current_word not in markov_dict:
              break
          
          next_words = list(markov_dict[current_word].keys())
          weights = list(markov_dict[current_word].values())
          current_word = random.choices(next_words, weights=weights)[0]
      
      return ' '.join(generated_text)