input: Write a function to generate a Markov chain given a text input and generate a new text using the Markov chain. The input text should be split into words, and a dictionary should be created where each key is a word from the text and the value is another dictionary representing possible next words with their frequency. Use this dictionary to generate a new text of up to 100 words. If the given text is empty, return an empty string.
  
  assert generateMarkov('')==''
  assert generateMarkov('to be or not to be')=='to be or not to be' # Simplified case to assert accurate implementation.
  assert generateMarkov('a b c d e f g h')=='a b c d e f g h' # Another simple case.
  assert generateMarkov('one two three one two one one')=='one two three one two one one' # Assert complex dictionary and sentence gen.
  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?')  # Longer text for Markov generation.
  
output: def generateMarkov(text):
      if not text:
          return ''
      
      words = text.split()
      chain = {}
      
      for i in range(len(words) - 1):
          word = words[i]
          next_word = words[i + 1]
          
          if word not in chain:
              chain[word] = {}
          
          if next_word not in chain[word]:
              chain[word][next_word] = 0
          
          chain[word][next_word] += 1
      
      current_word = words[0]
      result = [current_word]
      
      for _ in range(1, 100):
          if current_word not in chain:
              break
          
          next_words = chain[current_word]
          next_word = max(next_words, key=next_words.get)
          result.append(next_word)
          current_word = next_word
      
      return ' '.join(result)