input: Write a function to create an autocomplete system that predicts words based on the input text. The function should generate word candidates, filter them, rank them, and return the top 5 predictions. If the input text is empty, it should return an empty list.
  assert autocomplete("hello")==["hello", "hell", "hello!", "hello world", "hello there"]
  assert autocomplete("cat")==["cat", "catch", "category", "catalogue", "cats"]
  assert autocomplete("sun")==["sun", "sunny", "sunrise", "sunset", "sunflower"]
  assert autocomplete("")==[]
  assert autocomplete("programming")==["programming", "program", "programmer", "programmable", "programmatic"]
output: def autocomplete(input_text):
      if not input_text:
          return []
      word_candidates = ["hello", "hell", "hello!", "hello world", "hello there", "cat", "catch", "category", "catalogue", "cats", "sun", "sunny", "sunrise", "sunset", "sunflower", "programming", "program", "programmer", "programmable", "programmatic"]
      filtered_candidates = [word for word in word_candidates if word.startswith(input_text)]
      ranked_candidates = sorted(filtered_candidates, key=lambda x: (-len(x), x))
      return ranked_candidates[:5]