input: Write a function to generate a Markov chain given a text input. The function should split the text into words and create a dictionary where each word points to a dictionary of subsequent words and their frequencies. The function should then generate a new text of 100 words using the Markov chain, starting with a random word and selecting subsequent words based on their probabilities in the chain. If the chain runs out of words before reaching 100, it should stop and 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?') != ''
  assert generateMarkov('The quick brown fox jumps over the lazy dog.') != ''
  assert generateMarkov('') == ''
  assert generateMarkov('Hello world') != ''
  assert generateMarkov('This is a test. This is only a test.') != ''
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 not in chain:
              chain[current_word] = {}
          
          if next_word not in chain[current_word]:
              chain[current_word][next_word] = 0
          
          chain[current_word][next_word] += 1
      
      current_word = random.choice(list(chain.keys()))
      result = [current_word]
      
      while len(result) < 100:
          if current_word not in chain:
              break
          
          next_words = chain[current_word]
          next_word = random.choices(list(next_words.keys()), weights=list(next_words.values()))[0]
          result.append(next_word)
          current_word = next_word
      
      return ' '.join(result)