input: Write a function to generate a Markov chain from a given text input and then generate a new text sequence based on the Markov chain. If the function is unable to generate a new text due to insufficient data in the Markov chain, 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?'") != ""
  assert generateMarkov("The quick brown fox jumps over the lazy dog.") != ""
  assert generateMarkov("") == ""
output: import random
  
  def generateMarkov(text):
      if not text:
          return ""
      
      words = text.split()
      if len(words) < 2:
          return ""
      
      markov_chain = {}
      for i in range(len(words) - 1):
          current_word = words[i]
          next_word = words[i + 1]
          if current_word in markov_chain:
              markov_chain[current_word].append(next_word)
          else:
              markov_chain[current_word] = [next_word]
      
      start_word = random.choice(list(markov_chain.keys()))
      result = [start_word]
      current_word = start_word
      
      while current_word in markov_chain:
          next_words = markov_chain[current_word]
          current_word = random.choice(next_words)
          result.append(current_word)
          if len(result) > len(words):
              break
      
      return ' '.join(result)