input: Write a function to create an autocomplete system that predicts words based on the input text. The function should generate possible word candidates, filter them based on some criteria, rank the words, and return the top 5 predicted words. If the input text is empty, it should return an empty list.
  assert autocomplete("hel")==["hello", "help", "held", "helm", "help"]
  assert autocomplete("lov")==["love", "loved", "lover", "lovely", "loves"]
  assert autocomplete("ca")==["can", "car", "call", "care", "came"]
  assert autocomplete("")==[]
  assert autocomplete("z")==["zebra", "zero", "zone", "zoo", "zip"]
output: def autocomplete(text):
      if not text:
          return []
      words = ["hello", "help", "held", "helm", "help", "love", "loved", "lover", "lovely", "loves", "can", "car", "call", "care", "came", "zebra", "zero", "zone", "zoo", "zip"]
      filtered_words = [word for word in words if word.startswith(text)]
      ranked_words = sorted(filtered_words, key=lambda x: (-len(x), x))
      return ranked_words[:5]